Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Nov 15, 2025

Important

Update API spec and client code to require URL encoding for prompt names with folder paths.

  • Behavior:
    • Updated API spec in reference.md to require URL encoding for prompt names with folder paths.
    • Updated update() in PromptVersionClient and AsyncPromptVersionClient to require URL encoding for prompt names.
    • Updated get() in PromptsClient and AsyncPromptsClient to require URL encoding for prompt names.
  • Documentation:
    • Updated docstrings in client.py files to reflect URL encoding requirement for prompt names.

This description was created by Ellipsis 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:

  • Added clarification that prompt names containing folder paths (e.g., folder/subfolder/prompt-name) require URL encoding
  • Updated docstrings in PromptsClient.get(), AsyncPromptsClient.get(), PromptVersionClient.update(), and AsyncPromptVersionClient.update()
  • Updated API reference documentation

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-level Langfuse client (in langfuse/_client/client.py) already handles this encoding automatically via its _url_encode() method.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • This is a documentation-only change that clarifies existing behavior. The changes are consistent across all affected files and accurately describe the URL encoding requirement for folder paths in prompt names. No code logic was modified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
langfuse/api/reference.md 5/5 Documentation updated to clarify that folder paths in prompt names must be URL encoded
langfuse/api/resources/prompt_version/client.py 5/5 Docstring updated to clarify URL encoding requirement for folder paths in prompt names
langfuse/api/resources/prompts/client.py 5/5 Docstring updated to clarify URL encoding requirement for folder paths in prompt names

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
Loading

Copy link
Contributor

@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.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@marcklingen marcklingen merged commit 81bca77 into main Nov 16, 2025
12 checks passed
@marcklingen marcklingen deleted the api-spec-bot-53b8ec8 branch November 16, 2025 12:26
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.

3 participants