Skip to content

Commit 0f5e024

Browse files
ShivangiRejaShivangiReja
and
ShivangiReja
authored
Add Experimental attribute to public APIs in Batch and Fine-Tuning namespaces (#202)
Co-authored-by: ShivangiReja <[email protected]>
1 parent 79014ab commit 0f5e024

File tree

7 files changed

+26
-5
lines changed

7 files changed

+26
-5
lines changed

CHANGELOG.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
### Other Changes
1919

2020
- Reverted the removal of the version path parameter "v1" from the default endpoint URL. (commit_hash)
21-
- Added the `Experimental` attribute to all public APIs in the `OpenAI.Assistants` namespace. (commit_hash)
22-
- Added the `Experimental` attribute to all public APIs in the `OpenAI.VectorStores` namespace. (commit_hash)
23-
21+
- Added the `Experimental` attribute to the following APIs:
22+
- All public APIs in the `OpenAI.Assistants` namespace. (commit_hash)
23+
- All public APIs in the `OpenAI.VectorStores` namespace. (commit_hash)
24+
- All public APIs in the `OpenAI.Batch` namespace. (commit_hash)
25+
- All public APIs in the `OpenAI.FineTuning` namespace. (commit_hash)
26+
- The `ChatCompletionOptions.Seed` property. (commit_hash)
2427

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

src/Custom/Batch/BatchClient.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.ClientModel;
33
using System.ClientModel.Primitives;
44
using System.Collections.Generic;
5+
using System.Diagnostics.CodeAnalysis;
56

67
namespace OpenAI.Batch;
78

@@ -10,6 +11,7 @@ namespace OpenAI.Batch;
1011
// - Suppressed constructor that takes endpoint parameter; endpoint is now a property in the options class.
1112
// - Suppressed convenience methods for now.
1213
/// <summary> The service client for OpenAI batch operations. </summary>
14+
[Experimental("OPENAI001")]
1315
[CodeGenClient("Batches")]
1416
[CodeGenSuppress("BatchClient", typeof(ClientPipeline), typeof(ApiKeyCredential), typeof(Uri))]
1517
[CodeGenSuppress("CreateBatch", typeof(string), typeof(InternalCreateBatchRequestEndpoint), typeof(InternalBatchCompletionTimeframe), typeof(IDictionary<string, string>))]

src/Custom/Chat/ChatCompletionOptions.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Diagnostics.CodeAnalysis;
23

34
namespace OpenAI.Chat;
45

@@ -136,4 +137,11 @@ public ChatCompletionOptions()
136137
/// </summary>
137138
[CodeGenMember("User")]
138139
public string EndUserId { get; set; }
139-
}
140+
141+
// CUSTOM: Added the Experimental attribute
142+
/// <summary>
143+
/// 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.
144+
/// </summary>
145+
[Experimental("OPENAI001")]
146+
public long? Seed { get; set; }
147+
}

src/Custom/FineTuning/FineTuningClient.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.ClientModel;
33
using System.ClientModel.Primitives;
4+
using System.Diagnostics.CodeAnalysis;
45

56
namespace OpenAI.FineTuning;
67

@@ -9,6 +10,7 @@ namespace OpenAI.FineTuning;
910
// - Suppressed constructor that takes endpoint parameter; endpoint is now a property in the options class.
1011
// - Suppressed convenience methods for now.
1112
/// <summary> The service client for OpenAI fine-tuning operations. </summary>
13+
[Experimental("OPENAI001")]
1214
[CodeGenClient("FineTuning")]
1315
[CodeGenSuppress("FineTuningClient", typeof(ClientPipeline), typeof(ApiKeyCredential), typeof(Uri))]
1416
[CodeGenSuppress("CreateFineTuningJobAsync", typeof(InternalCreateFineTuningJobRequest))]

src/Custom/OpenAIClient.cs

+2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ protected internal OpenAIClient(ClientPipeline pipeline, OpenAIClientOptions opt
148148
/// the same configuration details.
149149
/// </remarks>
150150
/// <returns> A new <see cref="BatchClient"/>. </returns>
151+
[Experimental("OPENAI001")]
151152
public virtual BatchClient GetBatchClient() => new(_pipeline, _options);
152153

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

197199
/// <summary>

src/Generated/Models/ChatCompletionOptions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ internal ChatCompletionOptions(IList<ChatMessage> messages, InternalCreateChatCo
4343
public int? MaxTokens { get; set; }
4444
public float? PresencePenalty { get; set; }
4545
public ChatResponseFormat ResponseFormat { get; set; }
46-
public long? Seed { get; set; }
4746
public float? Temperature { get; set; }
4847
public float? TopP { get; set; }
4948
public IList<ChatTool> Tools { get; }

tests/OpenAI.Tests.csproj

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
4+
45
<!--Ignore XML doc comments on test types and members-->
56
<NoWarn>$(NoWarn);CS1591</NoWarn>
7+
8+
<!-- OPENAI001 - Ignore experimental warnings-->
9+
<NoWarn>$(NoWarn);OPENAI001;</NoWarn>
10+
611
<LangVersion>latest</LangVersion>
712
</PropertyGroup>
813
<ItemGroup>

0 commit comments

Comments
 (0)