pub struct Client { /* private fields */ }Expand description
EN: OpenAI SDK client. 中文:OpenAI SDK 客户端。
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(api_key: impl Into<String>) -> Result<Self, LingerError>
pub fn new(api_key: impl Into<String>) -> Result<Self, LingerError>
EN: Creates a client with the default transport. 中文:使用默认传输层创建客户端。
Sourcepub fn with_config(config: ClientConfig) -> Result<Self, LingerError>
pub fn with_config(config: ClientConfig) -> Result<Self, LingerError>
EN: Creates a client with the provided config and default transport. 中文:使用提供的配置和默认传输层创建客户端。
Sourcepub fn with_config_and_transport(
config: ClientConfig,
transport: SharedTransport,
) -> Self
pub fn with_config_and_transport( config: ClientConfig, transport: SharedTransport, ) -> Self
EN: Creates a client from config and a custom transport. 中文:通过配置和自定义传输层创建客户端。
Sourcepub fn responses(&self) -> ResponsesResource
pub fn responses(&self) -> ResponsesResource
EN: Returns the Responses API resource. 中文:返回 Responses API 资源。
Sourcepub fn completions(&self) -> CompletionsResource
pub fn completions(&self) -> CompletionsResource
EN: Returns the legacy Completions API resource. 中文:返回 legacy Completions API 资源。
Sourcepub fn conversations(&self) -> ConversationsResource
pub fn conversations(&self) -> ConversationsResource
EN: Returns the Conversations API resource. 中文:返回 Conversations API 资源。
Sourcepub fn realtime(&self) -> RealtimeResource
pub fn realtime(&self) -> RealtimeResource
EN: Returns the Realtime API resource. 中文:返回 Realtime API 资源。
Sourcepub fn containers(&self) -> ContainersResource
pub fn containers(&self) -> ContainersResource
EN: Returns the Containers API resource. 中文:返回 Containers API 资源。
Sourcepub fn evals(&self) -> EvalsResource
pub fn evals(&self) -> EvalsResource
EN: Returns the Evals API resource. 中文:返回 Evals API 资源。
Sourcepub fn models(&self) -> ModelsResource
pub fn models(&self) -> ModelsResource
EN: Returns the Models API resource. 中文:返回 Models API 资源。
Sourcepub fn skills(&self) -> SkillsResource
pub fn skills(&self) -> SkillsResource
EN: Returns the Skills API resource. 中文:返回 Skills API 资源。
Sourcepub fn videos(&self) -> VideosResource
pub fn videos(&self) -> VideosResource
EN: Returns the Videos API resource. 中文:返回 Videos API 资源。
Sourcepub fn batches(&self) -> BatchesResource
pub fn batches(&self) -> BatchesResource
EN: Returns the Batches API resource. 中文:返回 Batches API 资源。
Sourcepub fn files(&self) -> FilesResource
pub fn files(&self) -> FilesResource
EN: Returns the Files API resource. 中文:返回 Files API 资源。
Sourcepub fn uploads(&self) -> UploadsResource
pub fn uploads(&self) -> UploadsResource
EN: Returns the Uploads API resource. 中文:返回 Uploads API 资源。
Sourcepub fn vector_stores(&self) -> VectorStoresResource
pub fn vector_stores(&self) -> VectorStoresResource
EN: Returns the Vector Stores API resource. 中文:返回 Vector Stores API 资源。
Sourcepub fn fine_tuning(&self) -> FineTuningResource
pub fn fine_tuning(&self) -> FineTuningResource
EN: Returns the Fine-tuning API resource. 中文:返回 Fine-tuning API 资源。
Sourcepub fn images(&self) -> ImagesResource
pub fn images(&self) -> ImagesResource
EN: Returns the Images API resource. 中文:返回 Images API 资源。
Sourcepub fn audio(&self) -> AudioResource
pub fn audio(&self) -> AudioResource
EN: Returns the Audio API resource. 中文:返回 Audio API 资源。
Sourcepub fn embeddings(&self) -> EmbeddingsResource
pub fn embeddings(&self) -> EmbeddingsResource
EN: Returns the Embeddings API resource. 中文:返回 Embeddings API 资源。
Sourcepub fn moderations(&self) -> ModerationsResource
pub fn moderations(&self) -> ModerationsResource
EN: Returns the Moderations API resource. 中文:返回 Moderations API 资源。
Sourcepub fn chat(&self) -> ChatResource
pub fn chat(&self) -> ChatResource
EN: Returns the Chat API resource. 中文:返回 Chat API 资源。
Sourcepub fn chatkit(&self) -> ChatKitResource
pub fn chatkit(&self) -> ChatKitResource
EN: Returns the ChatKit beta API resource. 中文:返回 ChatKit beta API 资源。
Sourcepub fn assistants(&self) -> AssistantsResource
pub fn assistants(&self) -> AssistantsResource
EN: Returns the Assistants API resource. 中文:返回 Assistants API 资源。
Sourcepub fn threads(&self) -> ThreadsResource
pub fn threads(&self) -> ThreadsResource
EN: Returns the Threads API resource. 中文:返回 Threads API 资源。