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