-
-
Notifications
You must be signed in to change notification settings - Fork 348
Closed
Labels
out of scopeRequests which are not related to OpenAI APIRequests which are not related to OpenAI API
Description
I am new to Rust and new to async_openai library and trying to use the OpenAIConfig with openrouter.ai, see code below.
I receive an error when async_openai tries to deserialise the response from openrouter cause the field status is missing in the response.
Error: failed to deserialize api response: error:missing field status
is this a bug, or do I do something wrong ? Do I need somekind of a custom response type for OpenRouter ?
my code (as I said I am new to Rust as well.)
let config = OpenAIConfig::new()
.with_api_key(api_key)
.with_api_base("https://openrouter.ai/api/v1");
let client = Client::with_config(config);
let request = CreateResponseArgs::default()
.model(model)
.input("What is the capitol of France?")
.max_output_tokens(512u32)
.build().unwrap();
let response = client
.responses() // Get the API "group" (responses, images, etc.) from the client
.create(request) // Make the API call in that "group"
.await;
match response{
Ok(response) => println!("Response: {:?}", response.output_text()),
Err(err) => println!("Error: {}", err),
}
Metadata
Metadata
Assignees
Labels
out of scopeRequests which are not related to OpenAI APIRequests which are not related to OpenAI API