You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GPT-4 Turbo supports multiple function calls, but I couldn't any examples of this in async-openai yet. It took me a little while to stitch together how to do this since it's a bit divergent from single function calls, so maybe this minimal demonstration will be helpful to someone else:
let request = CreateChatCompletionRequestArgs::default().model("gpt-4-1106-preview").messages([ChatCompletionRequestUserMessageArgs::default().content(prompt).build()?
.into(),ChatCompletionRequestSystemMessageArgs::default().content(SYSTEM_PROMPT).build()?
.into(),]).max_tokens(512u16).stream(false).tools([ChatCompletionToolArgs::default().r#type(ChatCompletionToolType::Function).function(// ... build ChatCompletionFunctions here ...).build()?,
...]).build()?;ifletSome(tool_calls) = response_message.tool_calls{
tool_calls
.into_iter().map(|tool_call| ...).collect()?;}
The text was updated successfully, but these errors were encountered:
GPT-4 Turbo supports multiple function calls, but I couldn't any examples of this in async-openai yet. It took me a little while to stitch together how to do this since it's a bit divergent from single function calls, so maybe this minimal demonstration will be helpful to someone else:
The text was updated successfully, but these errors were encountered: