-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement Pydantic models from neon-data-models
#9
Conversation
unit_tests: | ||
strategy: | ||
matrix: | ||
python-version: [ 3.9, "3.10", "3.11", "3.12" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not intend to support Python 3.8 in our system anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been dropping it from tests as it recently reached EoL
request_data=request_data.model_dump(), | ||
target_queue=queue, | ||
response_queue=f"{queue}.response") | ||
return LLMProposeResponse(**resp_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would omit kwargs-like argument passing here, to make it more flexible to any potential updates to the callback body of send_mq_request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should handle any mis-match of keys as part of the Pydantic validation. My intent with the Pydantic models here is that anything moving across MQ (and HTTP and Messagebus) is defined in neon-data-models
; any added parameters will have defaults defined there, so the defaults are consistent across different handlers.
requirements/requirements.txt
Outdated
pydantic~=2.6 | ||
neon-data-models@git+https://github.com/neongeckocom/neon-data-models@FEAT_LLMRequestModels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets first merge this PR and then publish it to PyPi to further get the actual version there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyPI upload will fail with git dependencies, so the neon-data-models
PR must be merged before this one.
Outline unit tests with automation Add test extra dependencies
Add tests of MQ request/response handling in `chatbot` module Update `chatbot` module to use Pydantic models in place of `dict` objects for MQ message validation
…ser` Refactor `chatbot` methods to safely handle missing context
Include `routing_key` in LLM responses to associate inputs/responses
Update tests to reference constant strings for more specific testing
40e7dcd
to
16fa24a
Compare
Description
Implements shared models for data sent via MQ (NeonGeckoCom/neon-data-models#4)
Refactors
persona
handling to validate configured personasIssues
Other Notes
This refactoring allows MQ consumers to more easily decode received messages into Pydantic models so that passed parameters are consistent and new parameters have clearly-defined defaults