-
Notifications
You must be signed in to change notification settings - Fork 615
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
fix: enforce valid JSON response in interior design assistant #126
base: main
Are you sure you want to change the base?
Conversation
@@ -10,7 +10,7 @@ | |||
import uuid | |||
from pathlib import Path | |||
from typing import List | |||
|
|||
from examples.interior_design_assistant.utils import enforce_response_format |
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.
broken import here?
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.
You may have forgot to push changes related to enforce_response_format
?
This is not what the issue really is referring to. You need to use the |
Thank you for the clarification! I’ll update the implementation accordingly and push the changes soon. |
I’ve pushed the latest changes to implement |
Hi @yanxi0830, can you please go through the changes I've made and let me know if everything works as intended? Thank you. |
Hi @ashwinb @yanxi0830, I've addressed all the review comments on my PRs. Just wanted to check if there are any other issues I should address or if there's anything else needed from my side to help move these forward. Thanks! |
Description:
Problem:
The interior_design_assistant app expected the model to return a valid JSON output. However, in some cases, the model's output was either invalid JSON or missing expected fields, causing runtime errors and breaking the functionality.
Solution:
Implemented response_format in the turn.create calls for list_items and suggest_alternatives to enforce structured JSON outputs.
Key Changes:
Added JSON schema in response_format for both methods: