Skip to content

Conversation

GDaamn
Copy link
Contributor

@GDaamn GDaamn commented Sep 1, 2025

Further changes for #2663

  • Add provider_response_id as an additional property to streamed responses.
  • Added this as part of ModelResponse for OpenAIResponsesStreamedResponse and OpenAIStreamedResponse

@@ -609,6 +609,7 @@ def get(self) -> ModelResponse:
timestamp=self.timestamp,
usage=self.usage(),
provider_name=self.provider_name,
provider_response_id=self.provider_response_id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please add a test for this?

Copy link
Contributor Author

@GDaamn GDaamn Sep 3, 2025

Choose a reason for hiding this comment

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

where would you suggest to add this ?
here maybe ?

class TestStreamedResponse(StreamedResponse):
"""A structured response that streams test data."""
_model_name: str
_structured_response: ModelResponse
_messages: InitVar[Iterable[ModelMessage]]
_provider_name: str
_timestamp: datetime = field(default_factory=_utils.now_utc, init=False)

and subsequently reflect it in https://github.com/pydantic/pydantic-ai/blob/main/tests/test_streaming.py ?

Copy link
Contributor Author

@GDaamn GDaamn Sep 3, 2025

Choose a reason for hiding this comment

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

created a new PR as uv.lock was causing issues: #2782

@DouweM DouweM self-assigned this Sep 2, 2025
@GDaamn GDaamn closed this Sep 3, 2025
@GDaamn GDaamn force-pushed the feat/add-response-id-streaming branch from d090ff9 to 3b7f299 Compare September 3, 2025 08:33
@GDaamn GDaamn had a problem deploying to deploy-docs-preview September 3, 2025 08:51 — with GitHub Actions Failure
@alexmojaki alexmojaki temporarily deployed to deploy-docs-preview September 3, 2025 09:29 — with GitHub Actions Inactive
@DouweM DouweM had a problem deploying to deploy-docs-preview September 3, 2025 14:35 — with GitHub Actions Failure
@DouweM DouweM had a problem deploying to deploy-docs-preview September 3, 2025 14:39 — with GitHub Actions Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants