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

Add error handling for unknown fields in orchestrator request #285

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

swith004
Copy link
Collaborator

Story: foundation-model-stack/fms-guardrails-orchestrator#261

What does your PR do?

This PR adds a container attribute from the serde framework to handle unknown fields passed into to a request for ochestrator APIs. A unit test is also added asserting the case used for the scenario used in the git issue.

How this was tested

In addition to the unit test, each endpoint was modified to have a field name with a typo, or an outright made up field, and compared with an older orchestrator version deployed on openshift, versus the locally modified version.

Example:

curl --request POST   --url 'http://localhost:8033/api/v1/task/server-streaming-classification-with-text-generation'  --header 'Content-Type: application/json'  --data '{"inputs": "All people from Kish are cruel and evil.","model_id": "bloom-560m","guardrails_config": {"input": {"models": {"en_syntax_slate.38m.hap": {}}},"output": {"models": {"en_syntax_slate.38m.hap": {}}}},"text_gen_parameters": {"preserve_input_text": true,"max_new_tokens": 99,"min_new_tokens": 1,"truncate_input_tokens": 500,"decoding_method": "SAMPLING","top_k": 2,"top_p": 0.9,"typical_p": 0.5,"temperature": 0.8,"seed": 42,"repetition_penalty": 2,"max_time": 0,"stop_sequences": ["42"]}}'
{"code":422,"details":"guardrails_config: unknown field `guardrails_config`, expected one of `model_id`, `inputs`, `guardrail_config`, `text_gen_parameters` at line 1 column 98"}

Shonda-Adena-Witherspoon added 3 commits January 23, 2025 09:31
@evaline-ju evaline-ju linked an issue Jan 23, 2025 that may be closed by this pull request
2 tasks
Copy link
Collaborator

@declark1 declark1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@declark1 declark1 merged commit 87361ac into foundation-model-stack:main Jan 23, 2025
2 checks passed
@swith004 swith004 deleted the error_handling_1507 branch January 23, 2025 23:38
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.

Error during deserialization when encountering unknown fields
2 participants