You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#1821. Resolves repeated PydanticSerializationUnexpectedValue warnings logged for every streamed chat chunk. Langflow's /response SSE always wraps text deltas as {"content": "..."} for every provider, but the openai SDK's response event models declare delta: str. When chunk.model_dump() runs, Pydantic's serializer checks delta against that str type, finds a dict, and logs a warning for every chunk which pollutes the openrag-backend logs
Changes
exclude delta from model_dump()'s serialization (which is what triggers the type-check warning), then reattach the raw, unvalidated delta value back onto the resulting dict. Output shape sent to the frontend/SDK is unchanged and only the noisy serializer warning is avoided.
Added a comment above my agent.py changes explaining why and when this workaround can be removed.
Added a simple regression unit test to verify that the pydantic warning isnt being raised and the fields to be expected
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3fd74ad3-a76c-4a82-a0fa-7fc708a218f7
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
Warning
.coderabbit.yaml has a parsing error
The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.
💥 Parsing errors (1)
Validation error: Too big: expected number to be <=900000 at "reviews.tools.github-checks.timeout_ms"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing Touches🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch chat-message-pydantic-field-warning-log-fix
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend🔷 Issues related to backend services (OpenSearch, Langflow, APIs)bug🔴 Something isn't working.lgtmtests
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1821. Resolves repeated
PydanticSerializationUnexpectedValuewarnings logged for every streamed chat chunk. Langflow's/responseSSE always wraps text deltas as{"content": "..."}for every provider, but the openai SDK's response event models declaredelta: str. Whenchunk.model_dump()runs, Pydantic's serializer checksdeltaagainst thatstrtype, finds a dict, and logs a warning for every chunk which pollutes the openrag-backend logsChanges
deltafrommodel_dump()'s serialization (which is what triggers the type-check warning), then reattach the raw, unvalidateddeltavalue back onto the resulting dict. Output shape sent to the frontend/SDK is unchanged and only the noisy serializer warning is avoided.