Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed JSON Schema Serialization for Components #7

Merged
merged 5 commits into from
May 9, 2024

Conversation

tellmewyatt
Copy link

Currently if you try to go to http://localhost:1416/docs#/ with an extractive pipeline, an error will be thrown because the response class, ExtractedAnswer, contains a DataFrame, which pydantic is unable to serialize. I have added a function create_valid_type that creates a new type, replacing invalid types with those specified. This also means that it is no longer necessary to convert Documents to HaystackDocument for validation by pydantic.

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

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

Thanks! I made some changes and handled invalid inputs for inputs too.
Merging.

@silvanocerza silvanocerza merged commit 75f91c3 into deepset-ai:main May 9, 2024
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