Skip to content

Commit 423cca1

Browse files
CopilotByron
andcommitted
Port code to async-openai 0.31.1
- Update async-openai from 0.30.1 to 0.31.1 - Add chat-completion feature to enable API support - Update imports from async_openai::types:: to async_openai::types::chat:: - Adapt to new ChatCompletionTools and ChatCompletionMessageToolCalls enums - Remove usage of deprecated ChatCompletionToolType enum - Wrap tool calls in enum variants (Function) as required by new API Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
1 parent 9e96ae7 commit 423cca1

File tree

6 files changed

+134
-98
lines changed

6 files changed

+134
-98
lines changed

Cargo.lock

Lines changed: 19 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ schemars = { version = "1.0.4", default-features = false, features = [
115115
"std",
116116
"derive",
117117
] }
118-
async-openai = { version = "0.30.1", default-features = false, features = [
118+
async-openai = { version = "0.31.1", default-features = false, features = [
119119
"rustls",
120+
"chat-completion",
120121
] }
121122
open = "5.3.3"
122123
regex = { version = "1.11.3", default-features = false, features = ["std", "unicode" ] }

crates/but-action/src/generate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use async_openai::{
22
Client,
33
config::OpenAIConfig,
4-
types::{
4+
types::chat::{
55
ChatCompletionRequestSystemMessage, ChatCompletionRequestUserMessage,
66
CreateChatCompletionRequestArgs, ResponseFormat, ResponseFormatJsonSchema,
77
},

0 commit comments

Comments
 (0)