Dage 16: response validation Schemas#171
Merged
Merged
Conversation
added 2 commits
July 18, 2025 15:58
- Add LLMQueryResponse Pydantic model with JSON array validation - Update LLMService to use LLMQueryResponse - Add proper type hints and documentation
- Add LLMQueryResponse Pydantic model with JSON array validation - Update LLMService to use LLMQueryResponse - Add proper type hints and documentation
nseidan
reviewed
Jul 22, 2025
nseidan
reviewed
Jul 22, 2025
nseidan
reviewed
Jul 22, 2025
nseidan
reviewed
Jul 22, 2025
nicolo-rinaldi
left a comment
Collaborator
There was a problem hiding this comment.
I left just minor comments. I'd add some logging along the way. The comments are a bit ugly to look at. Maybe is better to keep them in separate files(?)
added 4 commits
July 23, 2025 12:14
…MService basic tests to adopt JSON format; and added a custom test file. Also: removed comments as feedback was asking for
…tests. Impact in pipeline and other points in the code --> We will need a refactor; this is a breaking change
nseidan
previously approved these changes
Jul 23, 2025
dantuzi
reviewed
Jul 25, 2025
dantuzi
reviewed
Jul 25, 2025
dantuzi
reviewed
Jul 25, 2025
…iel - splited in 2 files - added exhaustive tests - updated llm_service
nseidan
reviewed
Jul 28, 2025
dantuzi
approved these changes
Jul 28, 2025
nicolo-rinaldi
pushed a commit
that referenced
this pull request
Jul 28, 2025
* Minor fixes / improvements * Used simple data structures to perform validation of LLM responses in the LLM Service * Explored Pydantic, decided simple dict / lists / custom objetcts
nseidan
reviewed
Jul 28, 2025
| description = (" - 0: the query is NOT relevant to the given document" | ||
| " - 1: the query may be relevant to the given document" | ||
| " - 2: the document proposed is the answer to the query") | ||
| allowed = {0, 1, 2} |
Collaborator
Author
There was a problem hiding this comment.
Hello Naz, you're right. Feel free to update as discussed!
nseidan
reviewed
Jul 28, 2025
| Returns the validated score. | ||
|
|
||
| Returns: | ||
| The validated score. |
Collaborator
Author
There was a problem hiding this comment.
Will bring up the Docstring unification in next standups
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.
TASK TICKET
DAGE-16 – Introduces Pydantic model LLMScoreResponse and refactors LLMService to enforce structured output and "free" validation / checks.
Last update: back to basics
We decide to use simple data-structures (dicts / lists) for simplicity / efficiency. Pydantic it's (yet) an over kill - but might come back around.
-> Back to simple approaches. Used simple data structures to perform validation of LLM responses in the LLM Service
Previous (Pydantic Approach)
Changes