diff --git a/sdk/openai/inference/examples/azure_chat_completions.rs b/sdk/openai/inference/examples/azure_chat_completions.rs index 7ff2f0067a..8199a6b60c 100644 --- a/sdk/openai/inference/examples/azure_chat_completions.rs +++ b/sdk/openai/inference/examples/azure_chat_completions.rs @@ -11,7 +11,7 @@ pub async fn main() -> Result<()> { std::env::var("AZURE_OPENAI_ENDPOINT").expect("Set AZURE_OPENAI_ENDPOINT env variable"); let secret = std::env::var("AZURE_OPENAI_KEY").expect("Set AZURE_OPENAI_KEY env variable"); - let chat_completions_client = AzureOpenAIClient::with_key( + let chat_completions_client = AzureOpenAIClient::with_key_credential( endpoint, secret, Some( diff --git a/sdk/openai/inference/examples/azure_chat_completions_stream.rs b/sdk/openai/inference/examples/azure_chat_completions_stream.rs index 16bb277a37..5b676c478d 100644 --- a/sdk/openai/inference/examples/azure_chat_completions_stream.rs +++ b/sdk/openai/inference/examples/azure_chat_completions_stream.rs @@ -13,7 +13,7 @@ async fn main() -> Result<()> { std::env::var("AZURE_OPENAI_ENDPOINT").expect("Set AZURE_OPENAI_ENDPOINT env variable"); let secret = std::env::var("AZURE_OPENAI_KEY").expect("Set AZURE_OPENAI_KEY env variable"); - let chat_completions_client = AzureOpenAIClient::with_key( + let chat_completions_client = AzureOpenAIClient::with_key_credential( endpoint, secret, Some( diff --git a/sdk/openai/inference/examples/chat_completions.rs b/sdk/openai/inference/examples/chat_completions.rs index 5a4742094c..e0dd04ef33 100644 --- a/sdk/openai/inference/examples/chat_completions.rs +++ b/sdk/openai/inference/examples/chat_completions.rs @@ -7,7 +7,8 @@ use azure_openai_inference::{ pub async fn main() -> azure_core::Result<()> { let secret = std::env::var("OPENAI_KEY").expect("Set OPENAI_KEY env variable"); - let chat_completions_client = OpenAIClient::with_key(secret, None)?.chat_completions_client(); + let chat_completions_client = + OpenAIClient::with_key_credential(secret, None)?.chat_completions_client(); let chat_completions_request = CreateChatCompletionsRequest::new_with_user_message( "gpt-3.5-turbo-1106", diff --git a/sdk/openai/inference/examples/chat_completions_stream.rs b/sdk/openai/inference/examples/chat_completions_stream.rs index dc3905efa4..95c0c6245d 100644 --- a/sdk/openai/inference/examples/chat_completions_stream.rs +++ b/sdk/openai/inference/examples/chat_completions_stream.rs @@ -10,7 +10,8 @@ use std::io::{self, Write}; async fn main() -> Result<()> { let secret = std::env::var("OPENAI_KEY").expect("Set OPENAI_KEY env variable"); - let chat_completions_client = OpenAIClient::with_key(secret, None)?.chat_completions_client(); + let chat_completions_client = + OpenAIClient::with_key_credential(secret, None)?.chat_completions_client(); let chat_completions_request = CreateChatCompletionsRequest::new_stream_with_user_message( "gpt-3.5-turbo-1106", diff --git a/sdk/openai/inference/src/clients/azure_openai_client.rs b/sdk/openai/inference/src/clients/azure_openai_client.rs index eb023ef5a0..562790d6cb 100644 --- a/sdk/openai/inference/src/clients/azure_openai_client.rs +++ b/sdk/openai/inference/src/clients/azure_openai_client.rs @@ -19,7 +19,7 @@ pub trait AzureOpenAIClientMethods: BaseOpenAIClientMethods { where Self: Sized; - fn with_key( + fn with_key_credential( endpoint: impl AsRef, secret: impl Into, client_options: Option, @@ -63,7 +63,7 @@ impl AzureOpenAIClientMethods for AzureOpenAIClient { }) } - fn with_key( + fn with_key_credential( endpoint: impl AsRef, secret: impl Into, client_options: Option, diff --git a/sdk/openai/inference/src/clients/openai_client.rs b/sdk/openai/inference/src/clients/openai_client.rs index 01c3f56c5a..93a4a75689 100644 --- a/sdk/openai/inference/src/clients/openai_client.rs +++ b/sdk/openai/inference/src/clients/openai_client.rs @@ -7,7 +7,7 @@ use crate::{auth::OpenAIKeyCredential, OpenAIClientOptions}; use super::{BaseOpenAIClientMethods, ChatCompletionsClient}; pub trait OpenAIClientMethods { - fn with_key( + fn with_key_credential( secret: impl Into, client_options: Option, ) -> Result @@ -26,7 +26,7 @@ pub struct OpenAIClient { } impl OpenAIClientMethods for OpenAIClient { - fn with_key( + fn with_key_credential( secret: impl Into, client_options: Option, ) -> Result {