Skip to content

Added pydantic query wrapper code#11

Merged
justinsunyt merged 4 commits intomainfrom
keell0renz_pydantic_query
Dec 21, 2024
Merged

Added pydantic query wrapper code#11
justinsunyt merged 4 commits intomainfrom
keell0renz_pydantic_query

Conversation

@keell0renz
Copy link
Contributor

So, I added at this point a wrapper of .scrape function which gets dict, and tries to put that into pydantic class. schema is taken from inserted pydantic class.

Future considerations:

  1. Implement server-side validation with jsonschema so agent outputs valid JSON
  2. Add a return type like QueryResponse which would contain generic of response pydantic class + screenshot and other metadata

At this point it is nice as a prototype to test demand.

I did not test it practically because I believe it has no things to break, just a wrapper with functions with known behavior. If scrape itself works this will work.

Thanks @justinsunyt !

Copy link
Contributor

@justinsunyt justinsunyt left a comment

Choose a reason for hiding this comment

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

LGTM!

@justinsunyt justinsunyt merged commit a27937f into main Dec 21, 2024
3 checks passed
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

Comments