mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +00:00
Cargo fmt
This commit is contained in:
@ -83,20 +83,23 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
let req = ChatCompletionRequest {
|
||||
model: chat_completion::GPT3_5_TURBO_0613.to_string(),
|
||||
messages: vec![chat_completion::ChatCompletionMessage {
|
||||
role: chat_completion::MessageRole::user,
|
||||
content: Some(String::from("What is the price of Ethereum?")),
|
||||
name: None,
|
||||
function_call: None,
|
||||
}, chat_completion::ChatCompletionMessage {
|
||||
role: chat_completion::MessageRole::function,
|
||||
content: Some({
|
||||
let price = get_coin_price(&coin).await;
|
||||
format!("{{\"price\": {}}}", price)
|
||||
}),
|
||||
name: Some(String::from("get_coin_price")),
|
||||
function_call: None,
|
||||
}],
|
||||
messages: vec![
|
||||
chat_completion::ChatCompletionMessage {
|
||||
role: chat_completion::MessageRole::user,
|
||||
content: Some(String::from("What is the price of Ethereum?")),
|
||||
name: None,
|
||||
function_call: None,
|
||||
},
|
||||
chat_completion::ChatCompletionMessage {
|
||||
role: chat_completion::MessageRole::function,
|
||||
content: Some({
|
||||
let price = get_coin_price(&coin).await;
|
||||
format!("{{\"price\": {}}}", price)
|
||||
}),
|
||||
name: Some(String::from("get_coin_price")),
|
||||
function_call: None,
|
||||
},
|
||||
],
|
||||
functions: None,
|
||||
function_call: None,
|
||||
temperature: None,
|
||||
|
Reference in New Issue
Block a user