Fix ValueError: Dataclass has a union type error#6266
Merged
victordibia merged 2 commits intomicrosoft:mainfrom Apr 10, 2025
Merged
Fix ValueError: Dataclass has a union type error#6266victordibia merged 2 commits intomicrosoft:mainfrom
victordibia merged 2 commits intomicrosoft:mainfrom
Conversation
Fixes microsoft#6265 Convert the `Message` and `Resource` dataclasses to Pydantic models in the `llamaindex-agent` cookbook. * Replace `dataclass` with `BaseModel` for `Message` and `Resource` classes. * Update imports to use `BaseModel` from `pydantic`
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6266 +/- ##
=======================================
Coverage 77.27% 77.27%
=======================================
Files 200 200
Lines 14321 14321
=======================================
Hits 11067 11067
Misses 3254 3254
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
victordibia
approved these changes
Apr 10, 2025
peterj
added a commit
to kagent-dev/autogen
that referenced
this pull request
Apr 11, 2025
* upstream/main: (120 commits) Update discover.md with adding email agent package (microsoft#6274) Expose TCM TypedDict classes for apps to use (microsoft#6269) Fix publish_message-method() notes (microsoft#6250) Fix ValueError: Dataclass has a union type error (microsoft#6266) [Bugfix] Fix for Issue microsoft#6241 - ChromaDB removed IncludeEnum (microsoft#6260) Add note on ModelInfo for Gemini Models (microsoft#6259) .NET update autogen 0.2.2 -> autogen 0.2.3 (microsoft#6257) [Draft] Enable File Upload/Paste as Task in AGS (microsoft#6091) Bugfix/azure ai search embedding (microsoft#6248) Expose more Task-Centric Memory parameters (microsoft#6246) fix: typo in usage.md (microsoft#6245) .NET update oai and aoai package version (microsoft#6239) Fix sha256_hash docstring (microsoft#6236) Update json_schema_to_pydantic version and make relaxed requirement on arry item. (microsoft#6209) Fix terminations conditions. (microsoft#6229) Docker Code Exec delete temp files (microsoft#6211) clean codes notes for autogen-core. (microsoft#6218) Fix/transformer aware any modelfamily (microsoft#6213) chore: Add powershell path check for code executor (microsoft#6212) added: gemini 2.5 pro preview (microsoft#6226) ... Signed-off-by: Peter Jausovec <[email protected]>
abhinav-aegis
pushed a commit
to abhinav-aegis/autogen
that referenced
this pull request
Apr 12, 2025
Closes microsoft#6265 Convert the `Message` and `Resource` dataclasses to Pydantic models in the `llamaindex-agent` cookbook. * Replace `dataclass` with `BaseModel` for `Message` and `Resource` classes. * Update imports to use `BaseModel` from `pydantic` Co-authored-by: Victor Dibia <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #6265
Convert the
MessageandResourcedataclasses to Pydantic models in thellamaindex-agentcookbook.dataclasswithBaseModelforMessageandResourceclasses.BaseModelfrompydantic