Add assistant api

This commit is contained in:
Dongri Jin
2023-11-11 18:24:51 +09:00
parent 6e07047c27
commit cfca665c21
19 changed files with 966 additions and 48 deletions

View File

@ -1,5 +1,6 @@
use openai_api_rs::v1::api::Client;
use openai_api_rs::v1::chat_completion::{self, ChatCompletionRequest, FunctionCallType};
use openai_api_rs::v1::common::GPT3_5_TURBO_0613;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::{env, vec};
@ -30,7 +31,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
);
let req = ChatCompletionRequest::new(
chat_completion::GPT3_5_TURBO_0613.to_string(),
GPT3_5_TURBO_0613.to_string(),
vec![chat_completion::ChatCompletionMessage {
role: chat_completion::MessageRole::user,
content: String::from("What is the price of Ethereum?"),