fix: enforce valid JSON response in interior design assistant#126
fix: enforce valid JSON response in interior design assistant#126Anirudh2112 wants to merge 3 commits intollamastack:mainfrom
Conversation
| from pathlib import Path | ||
| from typing import List | ||
|
|
||
| from examples.interior_design_assistant.utils import enforce_response_format |
yanxi0830
left a comment
There was a problem hiding this comment.
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: