Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Dependency upgrades introduced breaking API changes: async-openai 0.32.2 moved chat completion types to a gated submodule, and base64 0.22.1 deprecated the decode() function.

Changes

async-openai API migration:

  • Enable chat-completion feature flag to access Chat Completion API
  • Update imports from async_openai::types::* to async_openai::types::chat::*

base64 API migration:

  • Replace deprecated base64::decode() with general_purpose::STANDARD.decode()
  • Update imports to include Engine trait

Dependency resolution:

  • Resolve bytes version conflict (1.10.1 → 1.11.0) between aws-config and async-openai
// Before
use async_openai::types::{CreateChatCompletionRequestArgs, ...};
base64::decode(s)

// After  
use async_openai::types::chat::{CreateChatCompletionRequestArgs, ...};
use base64::{Engine as _, engine::general_purpose};
general_purpose::STANDARD.decode(s)
Original prompt

fix issues due to dependencies upgrade: Compiling aws-config v1.8.12
error[E0432]: unresolved imports async_openai::types::ChatCompletionRequestAssistantMessageArgs, async_openai::types::ChatCompletionRequestMessage, async_openai::types::ChatCompletionRequestUserMessageArgs, async_openai::types::CreateChatCompletionRequestArgs
--> src/openai_client.rs:2:5
|
2 | ChatCompletionRequestAssistantMessageArgs, ChatCompletionRequestMessage,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no ChatCompletionRequestMessage in types
| |
| no ChatCompletionRequestAssistantMessageArgs in types
3 | ChatCompletionRequestUserMessageArgs, CreateChatCompletionRequestArgs,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no CreateChatCompletionRequestArgs in types
| |
| no ChatCompletionRequestUserMessageArgs in types

error[E0432]: unresolved imports async_openai::config, async_openai::Client
--> src/openai_client.rs:5:20
|
5 | use async_openai::{config::OpenAIConfig, Client};
| ^^^^^^ ^^^^^^ no Client in the root
| |
| could not find config in async_openai
|
note: found an item that was configured out
--> /Users/blank/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-openai-0.32.2/src/lib.rs:258:9
|
257 | #[cfg(feature = "_api")]
| ---------------- the item is gated behind the _api feature
258 | pub mod config;
| ^^^^^^
= help: consider importing one of these structs instead:
aws_config::imds::Client
aws_sdk_dynamodb::Client
reqwest::Client
note: found an item that was configured out
--> /Users/blank/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-openai-0.32.2/src/lib.rs:326:17
|
325 | #[cfg(feature = "_api")]
| ---------------- the item is gated behind the _api feature
326 | pub use client::Client;
| ^^^^^^

warning: use of deprecated function base64::decode: Use Engine::decode
--> src/dynamo/create_item.rs:30:37
|
30 | ... base64::decode(s).unwrap_or_default(),
| ^^^^^^
|
= note: #[warn(deprecated)] on by default

warning: use of deprecated function base64::decode: Use Engine::decode
--> src/dynamo/create_item.rs:55:53
|
55 | ... base64::decode(s).unwrap_or_default(),
| ^^^^^^

error[E0282]: type annotations needed
--> src/openai_client.rs:122:25
|
122 | Some(client) => client.clone(),
| ^^^^^^ cannot infer type

error[E0282]: type annotations needed
--> src/openai_client.rs:139:27
|
139 | .map_err(|e| e.to_string())?
| ^ - type must be known at this point
|
help: consider giving this closure parameter an explicit type
|
139 | .map_err(|e: /* Type */| e.to_string())?
| ++++++++++++

error[E0282]: type annotations needed
--> src/openai_client.rs:144:27
|
144 | .map_err(|e| e.to_string())?
| ^ - type must be known at this point
|
help: consider giving this closure parameter an explicit type
|
144 | .map_err(|e: /* Type */| e.to_string())?
| ++++++++++++

error[E0282]: type annotations needed
--> src/openai_client.rs:155:23
|
155 | .map_err(|e| e.to_string())?
| ^ - type must be known at this point
|
help: consider giving this closure parameter an explicit type
|
155 | .map_err(|e: /* Type */| e.to_string())?
| ++++++++++++

error[E0282]: type annotations needed
--> src/openai_client.rs:165:19
|
165 | .map_err(|e| e.to_string())?;
| ^ - type must be known at this point
|
help: consider giving this closure parameter an explicit type
|
165 | .map_err(|e: /* Type */| e.to_string())?;
| ++++++++++++

error[E0282]: type annotations needed
--> src/openai_client.rs:168:9
|
168 | let mut stream = match openai_client.chat().create_stream(request).await {
| ^^^^^^^^^^
...
184 | while let Some(result) = stream.next().await {
| ------ type must be known at this point
|
help: consider giving stream an explicit type
|
168 | let mut stream: /* Type */ = match openai_client.chat().create_stream(request).await {
| ++++++++++++

error[E0282]: type annotations needed
--> src/openai_client.rs:212:37
|
212 | let error_message = e.to_string();
| ^ cannot infer type

Some errors have detailed ...


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 29, 2025 10:48
Co-authored-by: Blankll <28639911+Blankll@users.noreply.github.com>
Co-authored-by: Blankll <28639911+Blankll@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues due to dependencies upgrade Fix compilation errors from async-openai 0.32.2 and base64 0.22.1 upgrades Dec 29, 2025
Copilot AI requested a review from Blankll December 29, 2025 10:58
@Blankll Blankll marked this pull request as ready for review December 29, 2025 15:21
@Blankll Blankll merged commit 2449728 into feat/update-dependencies Dec 29, 2025
1 check passed
@Blankll Blankll deleted the copilot/fix-dependency-upgrade-issues branch December 29, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants