-
Notifications
You must be signed in to change notification settings - Fork 576
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: handle OpenAI API errors better #1291
base: main
Are you sure you want to change the base?
Conversation
dfa4502
to
d46ced8
Compare
Rebased post #1293 merge (which touched the same things). @yingjiehe-xyz, since you authored that one, mind reviewing this (or at least allowing CI on it to begin with)? Thanks! :) |
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.
Thanks for the contribution! some minor comments
d46ced8
to
975f7d7
Compare
@yingjiehe-xyz Rebased and took care of your suggestions :) |
975f7d7
to
2c05253
Compare
Fixed rustfmt 🤦 |
We have a fix for the lint: #1314 (review) |
PR #1314 (review) is merged, can you do a quick rebase? |
2c05253
to
7ede4c8
Compare
@yingjiehe-xyz Done deal! |
crates/goose/src/providers/utils.rs
Outdated
use std::io::Read; | ||
use std::path::Path; | ||
|
||
use crate::providers::errors::ProviderError; | ||
use mcp_core::content::ImageContent; | ||
|
||
#[derive(serde::Deserialize)] | ||
struct OpenAIError { |
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.
oh, sorry, just realized we had errors.rs file under the same dir, can we move these to errors.rs file instead of utils.rs?
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.
Absolutely. Moved! I kept the response type where it was, because it's related to response unwrapping alone and shouldn't be needed by other modules at this point :)
7ede4c8
to
e74555d
Compare
I wanted to try Goose out, so I built it from source and tried configuring it with my local Ollama, only to be met with "Request failed with status: 404 Not Found". While I, knowing Ollama, could guess that meant "that model is not found", not everyone might.
This PR:
with the end result that the "model "qwen2.5" not found, try pulling it first" error is now surfaced.
Before
After