Skip to content

Commit fc17c9c

Browse files
committed
fix cherrypick issues
1 parent 06baee9 commit fc17c9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+56
-98
lines changed

async-openai/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ eventsource-stream = "0.2"
4747
hmac = { version = "0.12", optional = true, default-features = false}
4848
sha2 = { version = "0.10", optional = true, default-features = false }
4949
hex = { version = "0.4", optional = true, default-features = false }
50+
serde_urlencoded = "0.7.1"
51+
url = "2.5"
5052

5153

5254
[target.'cfg(target_arch = "wasm32")'.dependencies]

async-openai/src/admin_api_keys.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use crate::{
2-
Client,
2+
Client, RequestOptions,
33
config::Config,
44
error::OpenAIError,
55
types::admin::api_keys::{
66
AdminApiKey, AdminApiKeyDeleteResponse, ApiKeyList, CreateAdminApiKeyRequest,
77
},
8-
Client, RequestOptions,
98
};
109

1110
/// Admin API keys enable Organization Owners to programmatically manage various aspects of their

async-openai/src/assistants.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use crate::{
2-
Client,
2+
Client, RequestOptions,
33
config::Config,
44
error::OpenAIError,
55
types::assistants::{
66
AssistantObject, CreateAssistantRequest, DeleteAssistantResponse, ListAssistantsResponse,
77
ModifyAssistantRequest,
88
},
9-
Client, RequestOptions,
109
};
1110

1211
/// Build assistants that can call models and use tools to perform tasks.

async-openai/src/audit_logs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
config::Config, error::OpenAIError, types::admin::audit_logs::ListAuditLogsResponse, Client,
3-
RequestOptions,
2+
Client, RequestOptions, config::Config, error::OpenAIError,
3+
types::admin::audit_logs::ListAuditLogsResponse,
44
};
55

66
/// Logs of user actions and configuration changes within this organization.

async-openai/src/batches.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use crate::{
2-
Client,
2+
Client, RequestOptions,
33
config::Config,
44
error::OpenAIError,
55
types::batches::{Batch, BatchRequest, ListBatchesResponse},
6-
Client, RequestOptions,
76
};
87

98
/// Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.

async-openai/src/certificates.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use crate::{
2-
Client,
2+
Client, RequestOptions,
33
config::Config,
44
error::OpenAIError,
55
types::admin::certificates::{
66
Certificate, DeleteCertificateResponse, ListCertificatesResponse, ModifyCertificateRequest,
77
ToggleCertificatesRequest, UploadCertificateRequest,
88
},
9-
Client, RequestOptions,
109
};
1110

1211
/// Certificates enable Mutual TLS (mTLS) authentication for your organization.

async-openai/src/chat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
use crate::{
2-
Client,
2+
Client, RequestOptions,
33
config::Config,
44
error::OpenAIError,
55
types::chat::{
66
ChatCompletionDeleted, ChatCompletionList, ChatCompletionMessageList,
77
ChatCompletionResponseStream, CreateChatCompletionRequest, CreateChatCompletionResponse,
88
UpdateChatCompletionRequest,
99
},
10-
Client, RequestOptions,
1110
};
1211

1312
/// Given a list of messages comprising a conversation, the model will return a response.

async-openai/src/chatkit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use crate::{
2-
Client,
2+
Client, RequestOptions,
33
config::Config,
44
error::OpenAIError,
55
types::chatkit::{
66
ChatSessionResource, CreateChatSessionBody, DeletedThreadResource, ThreadItemListResource,
77
ThreadListResource, ThreadResource,
88
},
9-
Client, RequestOptions,
109
};
1110

1211
/// ChatKit API for managing sessions and threads.

async-openai/src/client.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use serde::{Serialize, de::DeserializeOwned};
1717
use crate::error::{ApiError, StreamError};
1818
use crate::{
1919
Assistants, Audio, Batches, Chat, Completions, Containers, Conversations, Embeddings, Evals,
20-
FineTuning, Models, Responses, Threads, Uploads, Usage, VectorStores, Videos,
20+
FineTuning, Models, RequestOptions, Responses, Threads, Uploads, Usage, VectorStores, Videos,
2121
admin::Admin,
2222
chatkit::Chatkit,
2323
config::{Config, OpenAIConfig},
@@ -26,8 +26,6 @@ use crate::{
2626
image::Images,
2727
moderation::Moderations,
2828
traits::AsyncTryFrom,
29-
Assistants, Audio, Batches, Chat, Completions, Containers, Conversations, Embeddings, Evals,
30-
FineTuning, Models, RequestOptions, Responses, Threads, Uploads, Usage, VectorStores, Videos,
3129
};
3230

3331
#[cfg(feature = "realtime")]
@@ -223,9 +221,8 @@ impl<C: Config> Client<C> {
223221
}
224222

225223
Ok(request_builder.build()?)
226-
};
227-
228-
self.execute(request_maker).await
224+
})
225+
.await
229226
}
230227

231228
/// Make a DELETE request to {path} and deserialize the response body

async-openai/src/completion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::{
2+
RequestOptions,
23
client::Client,
34
config::Config,
45
error::OpenAIError,
56
types::{CompletionResponseStream, CreateCompletionRequest, CreateCompletionResponse},
6-
RequestOptions,
77
};
88

99
/// Given a prompt, the model will return one or more predicted completions,

0 commit comments

Comments
 (0)