Skip to content

Commit

Permalink
Add Experimental attribute to public APIs in Batch and Fine-Tuning na…
Browse files Browse the repository at this point in the history
…mespaces (#202)

Co-authored-by: ShivangiReja <shivangi.reja@microsoft.com>
  • Loading branch information
ShivangiReja and ShivangiReja authored Aug 30, 2024
1 parent 79014ab commit 0f5e024
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
### Other Changes

- Reverted the removal of the version path parameter "v1" from the default endpoint URL. (commit_hash)
- Added the `Experimental` attribute to all public APIs in the `OpenAI.Assistants` namespace. (commit_hash)
- Added the `Experimental` attribute to all public APIs in the `OpenAI.VectorStores` namespace. (commit_hash)

- Added the `Experimental` attribute to the following APIs:
- All public APIs in the `OpenAI.Assistants` namespace. (commit_hash)
- All public APIs in the `OpenAI.VectorStores` namespace. (commit_hash)
- All public APIs in the `OpenAI.Batch` namespace. (commit_hash)
- All public APIs in the `OpenAI.FineTuning` namespace. (commit_hash)
- The `ChatCompletionOptions.Seed` property. (commit_hash)

## 2.0.0-beta.10 (2024-08-26)

Expand Down
2 changes: 2 additions & 0 deletions src/Custom/Batch/BatchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Batch;

Expand All @@ -10,6 +11,7 @@ namespace OpenAI.Batch;
// - Suppressed constructor that takes endpoint parameter; endpoint is now a property in the options class.
// - Suppressed convenience methods for now.
/// <summary> The service client for OpenAI batch operations. </summary>
[Experimental("OPENAI001")]
[CodeGenClient("Batches")]
[CodeGenSuppress("BatchClient", typeof(ClientPipeline), typeof(ApiKeyCredential), typeof(Uri))]
[CodeGenSuppress("CreateBatch", typeof(string), typeof(InternalCreateBatchRequestEndpoint), typeof(InternalBatchCompletionTimeframe), typeof(IDictionary<string, string>))]
Expand Down
10 changes: 9 additions & 1 deletion src/Custom/Chat/ChatCompletionOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Chat;

Expand Down Expand Up @@ -136,4 +137,11 @@ public ChatCompletionOptions()
/// </summary>
[CodeGenMember("User")]
public string EndUserId { get; set; }
}

// CUSTOM: Added the Experimental attribute
/// <summary>
/// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
/// </summary>
[Experimental("OPENAI001")]
public long? Seed { get; set; }
}
2 changes: 2 additions & 0 deletions src/Custom/FineTuning/FineTuningClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.FineTuning;

Expand All @@ -9,6 +10,7 @@ namespace OpenAI.FineTuning;
// - Suppressed constructor that takes endpoint parameter; endpoint is now a property in the options class.
// - Suppressed convenience methods for now.
/// <summary> The service client for OpenAI fine-tuning operations. </summary>
[Experimental("OPENAI001")]
[CodeGenClient("FineTuning")]
[CodeGenSuppress("FineTuningClient", typeof(ClientPipeline), typeof(ApiKeyCredential), typeof(Uri))]
[CodeGenSuppress("CreateFineTuningJobAsync", typeof(InternalCreateFineTuningJobRequest))]
Expand Down
2 changes: 2 additions & 0 deletions src/Custom/OpenAIClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ protected internal OpenAIClient(ClientPipeline pipeline, OpenAIClientOptions opt
/// the same configuration details.
/// </remarks>
/// <returns> A new <see cref="BatchClient"/>. </returns>
[Experimental("OPENAI001")]
public virtual BatchClient GetBatchClient() => new(_pipeline, _options);

/// <summary>
Expand Down Expand Up @@ -192,6 +193,7 @@ protected internal OpenAIClient(ClientPipeline pipeline, OpenAIClientOptions opt
/// the same configuration details.
/// </remarks>
/// <returns> A new <see cref="FineTuningClient"/>. </returns>
[Experimental("OPENAI001")]
public virtual FineTuningClient GetFineTuningClient() => new(_pipeline, _options);

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Generated/Models/ChatCompletionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ internal ChatCompletionOptions(IList<ChatMessage> messages, InternalCreateChatCo
public int? MaxTokens { get; set; }
public float? PresencePenalty { get; set; }
public ChatResponseFormat ResponseFormat { get; set; }
public long? Seed { get; set; }
public float? Temperature { get; set; }
public float? TopP { get; set; }
public IList<ChatTool> Tools { get; }
Expand Down
5 changes: 5 additions & 0 deletions tests/OpenAI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>

<!--Ignore XML doc comments on test types and members-->
<NoWarn>$(NoWarn);CS1591</NoWarn>

<!-- OPENAI001 - Ignore experimental warnings-->
<NoWarn>$(NoWarn);OPENAI001;</NoWarn>

<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit 0f5e024

Please sign in to comment.