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 {
|
let req = ChatCompletionRequest {
|
||||||
model: chat_completion::GPT3_5_TURBO_0613.to_string(),
|
model: chat_completion::GPT3_5_TURBO_0613.to_string(),
|
||||||
messages: vec![chat_completion::ChatCompletionMessage {
|
messages: vec![
|
||||||
role: chat_completion::MessageRole::user,
|
chat_completion::ChatCompletionMessage {
|
||||||
content: Some(String::from("What is the price of Ethereum?")),
|
role: chat_completion::MessageRole::user,
|
||||||
name: None,
|
content: Some(String::from("What is the price of Ethereum?")),
|
||||||
function_call: None,
|
name: None,
|
||||||
}, chat_completion::ChatCompletionMessage {
|
function_call: None,
|
||||||
role: chat_completion::MessageRole::function,
|
},
|
||||||
content: Some({
|
chat_completion::ChatCompletionMessage {
|
||||||
let price = get_coin_price(&coin).await;
|
role: chat_completion::MessageRole::function,
|
||||||
format!("{{\"price\": {}}}", price)
|
content: Some({
|
||||||
}),
|
let price = get_coin_price(&coin).await;
|
||||||
name: Some(String::from("get_coin_price")),
|
format!("{{\"price\": {}}}", price)
|
||||||
function_call: None,
|
}),
|
||||||
}],
|
name: Some(String::from("get_coin_price")),
|
||||||
|
function_call: None,
|
||||||
|
},
|
||||||
|
],
|
||||||
functions: None,
|
functions: None,
|
||||||
function_call: None,
|
function_call: None,
|
||||||
temperature: None,
|
temperature: None,
|
||||||
|
Reference in New Issue
Block a user