feat(api): update API spec from langfuse/langfuse 53b8ec8 #1441
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.
Important
Update API spec and client code to require URL encoding for prompt names with folder paths.
reference.mdto require URL encoding for prompt names with folder paths.update()inPromptVersionClientandAsyncPromptVersionClientto require URL encoding for prompt names.get()inPromptsClientandAsyncPromptsClientto require URL encoding for prompt names.client.pyfiles to reflect URL encoding requirement for prompt names.This description was created by
for 217bd34. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Summary
This PR updates API documentation to clarify that folder paths in prompt names must be URL encoded when using the low-level API client.
Key changes:
folder/subfolder/prompt-name) require URL encodingPromptsClient.get(),AsyncPromptsClient.get(),PromptVersionClient.update(), andAsyncPromptVersionClient.update()Context:
The implementation uses
jsonable_encoder()which does not perform URL encoding, so users must manually encode folder paths (converting/to%2F) before passing prompt names to these API methods. The higher-levelLangfuseclient (inlangfuse/_client/client.py) already handles this encoding automatically via its_url_encode()method.Confidence Score: 5/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant User participant PromptsClient participant PromptVersionClient participant HttpClient participant API Note over User,API: Fetching a prompt by name User->>PromptsClient: get(prompt_name="folder/subfolder/prompt") Note over PromptsClient: prompt_name must be URL encoded<br/>by the user before passing PromptsClient->>HttpClient: request(path="api/public/v2/prompts/{encoded_name}") HttpClient->>API: GET /api/public/v2/prompts/{encoded_name} API-->>HttpClient: Prompt response HttpClient-->>PromptsClient: Prompt object PromptsClient-->>User: Prompt object Note over User,API: Updating prompt version labels User->>PromptVersionClient: update(name="folder/subfolder/prompt", version=1) Note over PromptVersionClient: name must be URL encoded<br/>by the user before passing PromptVersionClient->>HttpClient: request(path="api/public/v2/prompts/{encoded_name}/versions/{version}") HttpClient->>API: PATCH /api/public/v2/prompts/{encoded_name}/versions/{version} API-->>HttpClient: Updated Prompt response HttpClient-->>PromptVersionClient: Prompt object PromptVersionClient-->>User: Prompt object