Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Mar 14, 2025

Important

Add support for OpenAI's Response API, including new schemas, environment filtering, and updated OpenAI integration for handling new inputs/outputs and streaming responses.

  • Behavior:
    • Added support for OpenAI's Response API in langfuse-python.
    • New schemas OpenAiCompletionUsageSchema and OpenAiResponseUsageSchema in types for handling different API response types.
    • Added environment filtering in client.py files for metrics, observations, scores, sessions, and traces.
    • New deletion endpoints for dataset items, runs, and traces in delete_*_response.py files.
    • Updated OpenAI integration in openai.py to handle Response API inputs/outputs and streaming responses.
  • Models:
    • Added resolution_graph field to prompt types in base_prompt.py and prompt.py for dependency resolution.
  • Misc:
    • Updated tests in test_openai.py to cover new Response API functionalities.

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


Greptile Summary

Disclaimer: Experimental PR review

This PR adds comprehensive support for OpenAI's Response API to the langfuse-python library, including new schema classes, environment filtering, and deletion endpoints.

  • Added new OpenAI usage schemas OpenAiCompletionUsageSchema and OpenAiResponseUsageSchema in /langfuse/api/resources/ingestion/types/ to better handle different API response types
  • Added environment filtering support across multiple clients (metrics, observations, scores, sessions, traces) in /langfuse/api/resources/*/client.py files
  • Added new deletion endpoints with response types for dataset items, runs and traces in /langfuse/api/resources/*/types/delete_*_response.py
  • Added resolution_graph field to prompt types in /langfuse/api/resources/prompts/types/ for dependency resolution
  • Updated OpenAI integration in /langfuse/openai.py to handle Response API inputs/outputs and streaming responses

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
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.

42 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

hassiebp and others added 3 commits March 14, 2025 15:52
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@hassiebp hassiebp enabled auto-merge (squash) March 17, 2025 10:20
@hassiebp hassiebp merged commit 7db5b75 into main Mar 17, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-4388-openai-response-api branch March 17, 2025 10: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.

2 participants