-
Notifications
You must be signed in to change notification settings - Fork 30
refactor ChatCompletionsRequest #375
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
refactor ChatCompletionsRequest #375
Conversation
a79ac02
to
884fd34
Compare
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.
Left a few nits. Looks like there are a couple of conflicts with the current code base due to recent merges.
Signed-off-by: declark1 <[email protected]>
Signed-off-by: declark1 <[email protected]>
Signed-off-by: declark1 <[email protected]>
Signed-off-by: declark1 <[email protected]>
Signed-off-by: declark1 <[email protected]>
Signed-off-by: declark1 <[email protected]>
Signed-off-by: declark1 <[email protected]>
aec4fd3
to
dfed34f
Compare
Signed-off-by: declark1 <[email protected]>
Added unit test, addressed initial review comments, rebased to bring in new tests, and updated the new validation test scenarios accordingly to use |
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.
LGTM! Left a few nit comments.
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Co-authored-by: Mateus Devino <[email protected]> Signed-off-by: Dan Clark <[email protected]>
Signed-off-by: declark1 <[email protected]>
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.
LGTM!
NOTE: I want to test this a bit more and add a deserialization unit test, but opening this for review now. This seems to be the only approach that I can see working for this.
Changes:
ChatCompletionRequest
to a subset of fields used by the orchestrator (detectors
,stream
,model
,messages
) andinner: Map<String, Value>
containing the full request#[serde(try_from = "Map<String, Value>")]
for deserialization, with the validation and extraction of the fields noted above happening in theTryFrom<Map<String, Value>> for ChatCompletionsRequest
implementationSerialize
implementation, which just serializes theinner
requestjson!()
macro instead ofChatCompletionsRequest
as the latter now needs to be built via deserialization rather than directlyorchestrator_validation_error
integration test scenario for unknown fields and these can no longer be validated. We only validate fields used by the service, with full validation now delegated to the downstream server.Closes #367