-
Notifications
You must be signed in to change notification settings - Fork 59
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
invalid type: map, expected a string #116
Comments
Are you using rust version 1.83? https://github.com/rust-lang/rust/blob/master/RELEASES.md Rust version: 1.81 #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = OpenAIClient::new(env::var("OPENAI_API_KEY").unwrap().to_string());
let response = client.list_assistant(None,None,None,None).await?;
println!("List Assistants: {:?}", response);
return Ok(());
} The output was correct.
|
Hi Jin! How are you doing? Thanks for this open-source project. I'm encountering an issue with the code, which results in the following error:
I'm using the nightly version, and the stable 1.81 version gives the same results. My best guess is that the response from OpenAI contains something that Another possibility is the size of the response. Perhaps I have too many assistants, and the way the response is handled doesn't account for something. I suggest improving the quality of the error message by including a slice of the response that caused the error, so it's clear how to fix the bug. For example, miette does a great job formatting slices of text. |
@Wandalen Please try use v5.0.12 |
Thank you for the quick response, Jin. Unfortunately, the change prints the entire response, so it's unclear exactly which line serde failed to parse. I’ve removed sensitive information and published the first 30 lines and the slice near 90 line, though I’m not sure if the data I’ve provided is detailed enough to be helpful.
By the way, the list of files works perfectly fine. |
Ok, send me the response dump at [email protected] and I'll look into it. (Please edit confidential information) |
I've just sent it. I hope that helps. Programmatically selecting lines would address other similar issues. |
@Wandalen |
Hi, I haven't had the chance to try it yet. Could you let me know what the issue was? Also, could you share the link to the commit with the fix? |
Changed code: https://github.com/dongri/openai-api-rs/pull/118/files |
Describe the bug
List of assistants does not work.
Looks like serde error?
How can I see more verbose output?
To Reproduce
Code snippets
OS
windows
Rust version
1.83
Library version
5.0.11
The text was updated successfully, but these errors were encountered: