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

fix(magentic-one): Enhance error handling in orchestrate_step to manage invalid ledger formats #4845

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

r-bit-rry
Copy link
Contributor

lets

Why are these changes needed?

fix the selected code, progress_ledger[key] might not be a string, it can also be Boolean or integer or whatever, in that case we will get a TypeError and except out of the loop, instead it should be handled as part of the handling of key_error in the selected code

Related issue number

Checks

@jackgerrits jackgerrits requested a review from afourney December 30, 2024 20:11
@afourney
Copy link
Member

Thanks. This looks good to me and catches a reasonable error case.

We weren't seeing this often on our end. Would you mind sharing which version of which model you are using?

(In any case, this is a good error to catch)

@r-bit-rry
Copy link
Contributor Author

I'm fiddling with local models, mostly Llama3.2-vision served through ollama.
Since both ollama and azure/openai API support structured output, and receiving output schema. maybe we should move to pydantic BaseModel and declare the ledge and other classes/object that we would like to receive in a structured way, can maybe even save tokens in the prompts and retry attempts:
https://ollama.com/blog/structured-outputs
https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/structured-outputs?tabs=python-secure

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.

3 participants