Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Feb 10, 2025

Important

Add commit_message parameter to prompt creation in Langfuse, updating models, client methods, and tests.

  • Behavior:
    • Added commit_message parameter to prompt creation functions in client.py and async_client.py.
    • Updated create_prompt() in Langfuse to accept commit_message.
  • Models:
    • Added commit_message field to BasePrompt, CreateChatPromptRequest, CreatePromptRequest_Chat, CreatePromptRequest_Text, CreateTextPromptRequest, Prompt_Chat, and Prompt_Text.
  • Tests:
    • Updated test_prompt.py to include tests for commit_message in prompt creation and retrieval.
  • Documentation:
    • Updated reference.md to reflect the new commit_message parameter in prompt creation examples.

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

Greptile Summary

Disclaimer: Experimental PR review

This PR adds support for commit messages in prompt creation across the Langfuse Python SDK, enabling better version tracking and documentation of prompt changes.

  • Added optional commit_message field (aliased as 'commitMessage') to all prompt-related classes in /langfuse/api/resources/prompts/types/
  • Updated BasePromptClient in model.py to handle commit messages in prompt initialization
  • Added proper Pydantic configuration with allow_population_by_field_name and populate_by_name for field aliasing support
  • Added comprehensive test coverage in test_prompt.py for commit message functionality
  • Maintained backward compatibility by making the commit message parameter optional throughout the implementation

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.

LGTM

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

@hassiebp hassiebp merged commit b36ed5c into main Feb 10, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-3915-prompt-commit-msg branch February 10, 2025 11:43
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