Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Dec 4, 2025

Important

Adds delete method to PromptsClient and AsyncPromptsClient for deleting prompt versions by prompt_name, label, or version.

  • Behavior:
    • Adds delete method to PromptsClient and AsyncPromptsClient to delete prompt versions by prompt_name, label, or version.
    • If neither label nor version is specified, all versions of the prompt are deleted.
  • Documentation:
    • Updates reference.md to include usage and parameters for the new delete method in client.prompts.
  • Error Handling:
    • Handles HTTP errors (400, 401, 403, 404, 405) in delete method for both sync and async clients.

This description was created by Ellipsis for 14faa79. You can customize this summary. It will automatically update as commits are pushed.

Disclaimer: Experimental PR review

Greptile Overview

Greptile Summary

Auto-generated API spec update adds a delete method to the prompts client (both sync and async) and clarifies documentation for the projects API.

  • Added client.prompts.delete() method with optional label and version parameters for filtering deletion
  • Updated projects endpoint documentation to clarify that GET /api/public/projects requires project-scoped API key
  • All imports are properly placed at module top (compliant with custom rule)
  • Error handling follows existing patterns with proper exception types for all HTTP error codes

Confidence Score: 5/5

  • Safe to merge - auto-generated API spec update with consistent patterns
  • This is an auto-generated API client update that follows existing code patterns precisely. All imports are at module top, error handling mirrors existing methods, and the new delete functionality is straightforward with proper typing and documentation
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
langfuse/api/reference.md 5/5 Updated API documentation for projects endpoint and added delete method documentation for prompts
langfuse/api/resources/projects/client.py 5/5 Updated docstring to clarify API key scope requirements for get method
langfuse/api/resources/prompts/client.py 5/5 Added delete method for prompts in both sync and async clients with proper error handling

Sequence Diagram

sequenceDiagram
    participant Client
    participant PromptsClient
    participant HTTPClient
    participant API
    
    Client->>PromptsClient: delete(prompt_name, label?, version?)
    PromptsClient->>HTTPClient: request(DELETE /api/public/v2/prompts/{name})
    HTTPClient->>API: DELETE with params (label, version)
    
    alt Success (200-299)
        API-->>HTTPClient: 200 OK
        HTTPClient-->>PromptsClient: Success response
        PromptsClient-->>Client: None
    else Bad Request (400)
        API-->>HTTPClient: 400 Error
        HTTPClient-->>PromptsClient: Error response
        PromptsClient-->>Client: raise Error
    else Unauthorized (401)
        API-->>HTTPClient: 401 Error
        HTTPClient-->>PromptsClient: Error response
        PromptsClient-->>Client: raise UnauthorizedError
    else Access Denied (403)
        API-->>HTTPClient: 403 Error
        HTTPClient-->>PromptsClient: Error response
        PromptsClient-->>Client: raise AccessDeniedError
    else Not Found (404)
        API-->>HTTPClient: 404 Error
        HTTPClient-->>PromptsClient: Error response
        PromptsClient-->>Client: raise NotFoundError
    else Method Not Allowed (405)
        API-->>HTTPClient: 405 Error
        HTTPClient-->>PromptsClient: Error response
        PromptsClient-->>Client: raise MethodNotAllowedError
    end
Loading

@langfuse-bot langfuse-bot requested a review from nimarb December 4, 2025 19:38
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

@hassiebp hassiebp merged commit c048966 into main Dec 5, 2025
12 checks passed
@hassiebp hassiebp deleted the api-spec-bot-fc04a50 branch December 5, 2025 09:12
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