Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getPromptsStateless to list all prompts #498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rgarcia
Copy link

@rgarcia rgarcia commented Jan 25, 2025

Problem

I want to hit the promtps API to list all prompts.

Changes

Added a getPromptsStateless method trying to mimic the existing getPromptStateless

Release info Sub-libraries affected

Bump level

  • Major
  • Minor
  • Patch

Libraries affected

  • All of them
  • langfuse
  • [ x] langfuse-node

Changelog notes

  • Added support for getting all prompts and their versions via getPromptsStateless

Important

Adds getPromptsStateless method to fetch all prompts with optional filters and error handling, including tests.

  • Behavior:
    • Adds getPromptsStateless method in LangfuseCoreStateless to fetch all prompts with optional filters like name, label, tag, page, limit, fromUpdatedAt, and toUpdatedAt.
    • Handles network and HTTP errors using LangfuseFetchNetworkError and LangfuseFetchHttpError.
  • Types:
    • Adds GetLangfusePromptsResponse, GetLangfusePromptsSuccessData, and GetLangfusePromptsFailureData types in types.ts.
  • Tests:
    • Adds tests in langfuse.prompts.spec.ts for getPromptsStateless to verify fetching prompts with and without filters and error handling.

This description was created by Ellipsis for d140455. It will automatically update as commits are pushed.

Copy link

vercel bot commented Jan 25, 2025

@rgarcia is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Jan 25, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: Experimental PR review

PR Summary

Added new getPromptsStateless method to fetch and list all prompts with filtering capabilities, including pagination, labels, tags, and date ranges.

  • Added new types GetLangfusePromptsSuccessData, GetLangfusePromptsFailureData, and GetLangfusePromptsResponse in /langfuse-core/src/types.ts
  • Implemented getPromptsStateless method in /langfuse-core/src/index.ts with comprehensive query parameter support and error handling
  • Added thorough test coverage in /langfuse-core/test/langfuse.prompts.spec.ts for parameter handling and error cases
  • Maintained consistent retry logic and timeout handling with existing prompt-related methods
  • Follows established patterns for backward compatibility and proper OpenAPI schema integration

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants