Skip to content

Conversation

alexmojaki
Copy link
Contributor

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2025

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0ed904b
Status: ✅  Deploy successful!
Preview URL: https://baa61c30.logfire-docs.pages.dev
Branch Preview URL: https://alex-openai-streaming-respon.logfire-docs.pages.dev

View logs

@alexmojaki alexmojaki requested a review from Copilot October 9, 2025 10:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes the OpenAI Responses API streaming response format to use an events structure that is understood by the UI, moving away from storing raw response data to a more consistent event-based format.

  • Replaces raw response_data with structured events for OpenAI streaming responses
  • Adds a new get_attributes method to StreamState for customizing logged attributes
  • Updates test expectations to reflect the new event-based format

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
logfire/_internal/integrations/llm_providers/types.py Adds get_attributes method to StreamState base class
logfire/_internal/integrations/llm_providers/openai.py Implements event-based response format and custom attribute handling
logfire/_internal/integrations/llm_providers/llm_provider.py Updates streaming response logging to use new attribute method
tests/otel_integrations/test_openai.py Updates test expectations for new event-based format
tests/otel_integrations/test_anthropic.py Reorders JSON schema properties (likely due to dictionary ordering changes)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@alexmojaki alexmojaki merged commit 4c1abdf into main Oct 9, 2025
14 checks passed
@alexmojaki alexmojaki deleted the alex/openai-streaming-response-events branch October 9, 2025 10:36
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.

1 participant