feat(api): update API spec from langfuse/langfuse 9c9e1f6 #1440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Summary
This PR updates the API specification to add crucial documentation about URL encoding requirements for prompt names that contain folder paths.
Changes:
nameandprompt_nameparameters across sync and async client methods%2FAnalysis:
The documentation changes are correct and necessary. The underlying implementation uses
jsonable_encoder()which returns strings as-is without URL encoding, meaning users are responsible for pre-encoding prompt names containing slashes. This documentation update properly clarifies this requirement to prevent API call failures.Confidence Score: 5/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant User participant PromptsClient participant PromptVersionClient participant HTTPClient participant API as Langfuse API Note over User,API: Get Prompt Flow User->>PromptsClient: get(prompt_name="folder%2Fprompt") PromptsClient->>PromptsClient: jsonable_encoder(prompt_name) PromptsClient->>HTTPClient: request(f"api/public/v2/prompts/{prompt_name}") HTTPClient->>API: GET /api/public/v2/prompts/folder%2Fprompt API-->>HTTPClient: Prompt response HTTPClient-->>PromptsClient: Parse response PromptsClient-->>User: Return Prompt object Note over User,API: Update Prompt Version Flow User->>PromptVersionClient: update(name="folder%2Fprompt", version=1) PromptVersionClient->>PromptVersionClient: jsonable_encoder(name) PromptVersionClient->>HTTPClient: request(f"api/public/v2/prompts/{name}/versions/{version}") HTTPClient->>API: PATCH /api/public/v2/prompts/folder%2Fprompt/versions/1 API-->>HTTPClient: Updated Prompt response HTTPClient-->>PromptVersionClient: Parse response PromptVersionClient-->>User: Return Prompt objectImportant
Update API spec and client code to handle URL encoding for prompt names with folder paths.
reference.mdto specify that prompt names with folder paths must be URL encoded.update()inPromptVersionClientandAsyncPromptVersionClientto handle URL encoding for prompt names.get()inPromptsClientandAsyncPromptsClientto handle URL encoding for prompt names.reference.mdfor URL encoding folder paths in prompt names.update()inprompt_version/client.pyto include URL encoding logic.get()inprompts/client.pyto include URL encoding logic.This description was created by
for bc919fe. You can customize this summary. It will automatically update as commits are pushed.