feat!: simplify chat completion call
BREAKING CHANGE: Chat completions must now be called directly from client.chat() without building a request in between.
This commit is contained in:
@@ -87,8 +87,7 @@ fn main() {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let chat_completion_request = ChatCompletionRequest::new(model, messages, Some(options));
|
||||
let result = client.chat(chat_completion_request).unwrap();
|
||||
let result = client.chat(model, messages, Some(options)).unwrap();
|
||||
println!("Assistant: {}", result.choices[0].message.content);
|
||||
// => "Assistant: Tower. [...]"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user