Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/OpenAI.net8.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4298,7 +4298,12 @@ public class RealtimeClient {
protected RealtimeClient();
public RealtimeClient(ApiKeyCredential credential, OpenAIClientOptions options);
public RealtimeClient(ApiKeyCredential credential);
[Experimental("OPENAI001")]
public RealtimeClient(AuthenticationPolicy authenticationPolicy, OpenAIClientOptions options);
[Experimental("OPENAI001")]
public RealtimeClient(AuthenticationPolicy authenticationPolicy);
protected internal RealtimeClient(ClientPipeline pipeline, OpenAIClientOptions options);
public RealtimeClient(string apiKey);
public ClientPipeline Pipeline { get; }
public event EventHandler<BinaryData> OnReceivingCommand { add; remove; }
public event EventHandler<BinaryData> OnSendingCommand { add; remove; }
Expand Down
3 changes: 3 additions & 0 deletions api/OpenAI.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3766,7 +3766,10 @@ public class RealtimeClient {
protected RealtimeClient();
public RealtimeClient(ApiKeyCredential credential, OpenAIClientOptions options);
public RealtimeClient(ApiKeyCredential credential);
public RealtimeClient(AuthenticationPolicy authenticationPolicy, OpenAIClientOptions options);
public RealtimeClient(AuthenticationPolicy authenticationPolicy);
protected internal RealtimeClient(ClientPipeline pipeline, OpenAIClientOptions options);
public RealtimeClient(string apiKey);
public ClientPipeline Pipeline { get; }
public event EventHandler<BinaryData> OnReceivingCommand { add; remove; }
public event EventHandler<BinaryData> OnSendingCommand { add; remove; }
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Assistants/AssistantClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public partial class AssistantClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="AssistantClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public AssistantClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -51,7 +51,7 @@ public partial class AssistantClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="AssistantClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public AssistantClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal partial class InternalAssistantMessageClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalAssistantMessageClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public InternalAssistantMessageClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -33,7 +33,7 @@ internal partial class InternalAssistantMessageClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalAssistantMessageClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public InternalAssistantMessageClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal partial class InternalAssistantRunClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalAssistantRunClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public InternalAssistantRunClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -42,7 +42,7 @@ internal partial class InternalAssistantRunClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalAssistantRunClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public InternalAssistantRunClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal partial class InternalAssistantThreadClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalAssistantThreadClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public InternalAssistantThreadClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -31,7 +31,7 @@ internal partial class InternalAssistantThreadClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalAssistantThreadClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public InternalAssistantThreadClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Audio/AudioClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public partial class AudioClient
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="AudioClient"/>. </summary>
/// <param name="model"> The name of the model to use in requests sent to the service. To learn more about the available models, see <see href="https://platform.openai.com/docs/models"/>. </param>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="model"/> or <paramref name="credential"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="model"/> is an empty string, and was expected to be non-empty. </exception>
public AudioClient(string model, ApiKeyCredential credential) : this(model, credential, new OpenAIClientOptions())
Expand All @@ -50,7 +50,7 @@ public partial class AudioClient
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="AudioClient"/>. </summary>
/// <param name="model"> The name of the model to use in requests sent to the service. To learn more about the available models, see <see href="https://platform.openai.com/docs/models"/>. </param>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="model"/> or <paramref name="credential"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="model"/> is an empty string, and was expected to be non-empty. </exception>
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Batch/BatchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public partial class BatchClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="BatchClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public BatchClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -49,7 +49,7 @@ public partial class BatchClient
/// <summary>
/// Initializes a new instance of <see cref="BatchClient"/> that will use an API key when authenticating.
/// </summary>
/// <param name="credential"> The API key used to authenticate with the service endpoint. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> Additional options to customize the client. </param>
/// <exception cref="ArgumentNullException"> The provided <paramref name="credential"/> was null. </exception>
public BatchClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Chat/ChatClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public partial class ChatClient
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="ChatClient"/>. </summary>
/// <param name="model"> The name of the model to use in requests sent to the service. To learn more about the available models, see <see href="https://platform.openai.com/docs/models"/>. </param>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="model"/> or <paramref name="credential"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="model"/> is an empty string, and was expected to be non-empty. </exception>
public ChatClient(string model, ApiKeyCredential credential) : this(model, credential, new OpenAIClientOptions())
Expand All @@ -55,7 +55,7 @@ public partial class ChatClient
// - Added telemetry support.
/// <summary> Initializes a new instance of <see cref="ChatClient"/>. </summary>
/// <param name="model"> The name of the model to use in requests sent to the service. To learn more about the available models, see <see href="https://platform.openai.com/docs/models"/>. </param>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="model"/> or <paramref name="credential"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="model"/> is an empty string, and was expected to be non-empty. </exception>
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Containers/ContainerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class ContainerClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="ContainerClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public ContainerClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -31,7 +31,7 @@ public partial class ContainerClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="ContainerClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public ContainerClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Embeddings/EmbeddingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public partial class EmbeddingClient
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="EmbeddingClient"/>. </summary>
/// <param name="model"> The name of the model to use in requests sent to the service. To learn more about the available models, see <see href="https://platform.openai.com/docs/models"/>. </param>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="model"/> or <paramref name="credential"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="model"/> is an empty string, and was expected to be non-empty. </exception>
public EmbeddingClient(string model, ApiKeyCredential credential) : this(model, credential, new OpenAIClientOptions())
Expand All @@ -53,7 +53,7 @@ public partial class EmbeddingClient
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="EmbeddingClient"/>. </summary>
/// <param name="model"> The name of the model to use in requests sent to the service. To learn more about the available models, see <see href="https://platform.openai.com/docs/models"/>. </param>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="model"/> or <paramref name="credential"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="model"/> is an empty string, and was expected to be non-empty. </exception>
Expand Down
4 changes: 2 additions & 2 deletions src/Custom/Evals/EvaluationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public partial class EvaluationClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="EvaluationClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
public EvaluationClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -52,7 +52,7 @@ public partial class EvaluationClient
/// <summary>
/// Initializes a new instance of <see cref="EvaluationClient"/> that will use an API key when authenticating.
/// </summary>
/// <param name="credential"> The API key used to authenticate with the service endpoint. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> Additional options to customize the client. </param>
/// <exception cref="ArgumentNullException"> The provided <paramref name="credential"/> was null. </exception>
public EvaluationClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
11 changes: 9 additions & 2 deletions src/Custom/Files/Internal/InternalUploadsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ namespace OpenAI.Files;
[CodeGenSuppress("InternalUploadsClient", typeof(ClientPipeline), typeof(ApiKeyCredential), typeof(Uri))]
internal partial class InternalUploadsClient
{
// CUSTOM: Added as a convenience.
/// <summary> Initializes a new instance of <see cref="InternalUploadsClient"/>. </summary>
/// <param name="apiKey"> The API key to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="apiKey"/> is null. </exception>
public InternalUploadsClient(string apiKey) : this(new ApiKeyCredential(apiKey), new OpenAIClientOptions())
{
}

// CUSTOM:
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalUploadsClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
internal InternalUploadsClient(ApiKeyCredential credential) : this(credential, new OpenAIClientOptions())
{
Expand All @@ -23,7 +30,7 @@ internal partial class InternalUploadsClient
// - Used a custom pipeline.
// - Demoted the endpoint parameter to be a property in the options class.
/// <summary> Initializes a new instance of <see cref="InternalUploadsClient"/>. </summary>
/// <param name="credential"> The API key to authenticate with the service. </param>
/// <param name="credential"> The <see cref="ApiKeyCredential"/> to authenticate with the service. </param>
/// <param name="options"> The options to configure the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="credential"/> is null. </exception>
internal InternalUploadsClient(ApiKeyCredential credential, OpenAIClientOptions options) : this(OpenAIClient.CreateApiKeyAuthenticationPolicy(credential), options)
Expand Down
Loading