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
1 change: 1 addition & 0 deletions .dotnet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### Other Changes

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public partial class AssistantExamples
public void Example01_RetrievalAugmentedGeneration()
{
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
FileClient fileClient = openAIClient.GetFileClient();
AssistantClient assistantClient = openAIClient.GetAssistantClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public partial class AssistantExamples
public async Task Example01_RetrievalAugmentedGenerationAsync()
{
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
FileClient fileClient = openAIClient.GetFileClient();
AssistantClient assistantClient = openAIClient.GetAssistantClient();
Expand Down
1 change: 0 additions & 1 deletion .dotnet/examples/Assistants/Example02_FunctionCalling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ string GetCurrentWeather(string location, string unit = "celsius")
#endregion

// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
AssistantClient client = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));

#region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ string GetCurrentWeather(string location, string unit = "celsius")
#endregion

// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
AssistantClient client = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));

#region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public async Task Example02b_FunctionCallingStreaming()
#endregion

// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
AssistantClient client = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));

#region Create a new assistant with function tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public partial class AssistantExamples
public void Example03_ListAssistantsWithPagination()
{
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
AssistantClient client = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));

int count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public partial class AssistantExamples
public async Task Example03_ListAssistantsWithPaginationAsync()
{
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
AssistantClient client = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));

int count = 0;
Expand Down
2 changes: 0 additions & 2 deletions .dotnet/examples/Assistants/Example04_AllTheTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public partial class AssistantExamples
[Test]
public void Example04_AllTheTools()
{
#pragma warning disable OPENAI001

#region Define a function tool
static string GetNameOfFamilyMember(string relation)
=> relation switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public partial class AssistantExamples
public void Example05_AssistantsWithVision()
{
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
FileClient fileClient = openAIClient.GetFileClient();
AssistantClient assistantClient = openAIClient.GetAssistantClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public partial class AssistantExamples
public async Task Example05_AssistantsWithVisionAsync()
{
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
#pragma warning disable OPENAI001
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
FileClient fileClient = openAIClient.GetFileClient();
AssistantClient assistantClient = openAIClient.GetAssistantClient();
Expand Down
2 changes: 0 additions & 2 deletions .dotnet/examples/ClientExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public void CreateAssistantAndFileClients()
{
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
FileClient fileClient = openAIClient.GetFileClient();
#pragma warning disable OPENAI001
AssistantClient assistantClient = openAIClient.GetAssistantClient();
#pragma warning restore OPENAI001
}
}
9 changes: 7 additions & 2 deletions .dotnet/examples/OpenAI.Examples.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>

<!-- CS1591 - 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
3 changes: 3 additions & 0 deletions .dotnet/src/Custom/Assistants/Assistant.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

[Experimental("OPENAI001")]
[CodeGenModel("AssistantObject")]
public partial class Assistant
{
Expand Down
3 changes: 3 additions & 0 deletions .dotnet/src/Custom/Assistants/AssistantCollectionOptions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

/// <summary>
/// Represents addition options available when requesting a collection of <see cref="Assistant"/> instances.
/// </summary>
[Experimental("OPENAI001")]
public class AssistantCollectionOptions
{
/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion .dotnet/src/Custom/Assistants/AssistantCreationOptions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

/// <summary>
/// Represents additional options available when creating a new <see cref="Assistant"/>.
/// </summary>
[Experimental("OPENAI001")]
[CodeGenModel("CreateAssistantRequest")]
[CodeGenSuppress(nameof(AssistantCreationOptions), typeof(string))]
public partial class AssistantCreationOptions
Expand Down Expand Up @@ -51,4 +53,4 @@ public AssistantCreationOptions()
Metadata = new ChangeTrackingDictionary<string, string>();
Tools = new ChangeTrackingList<ToolDefinition>();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

/// <summary>
/// Represents additional options available when modifying an existing <see cref="Assistant"/>.
/// </summary>
[Experimental("OPENAI001")]
[CodeGenModel("ModifyAssistantRequest")]
public partial class AssistantModificationOptions
{
Expand Down Expand Up @@ -40,4 +42,4 @@ public partial class AssistantModificationOptions
/// </summary>
[CodeGenMember("TopP")]
public float? NucleusSamplingFactor { get; set; }
}
}
4 changes: 3 additions & 1 deletion .dotnet/src/Custom/Assistants/AssistantResponseFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using System;
using System.ClientModel.Primitives;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

[Experimental("OPENAI001")]
[CodeGenModel("AssistantResponseFormat")]
public partial class AssistantResponseFormat : IEquatable<AssistantResponseFormat>, IEquatable<string>
{
Expand Down Expand Up @@ -106,4 +108,4 @@ public override string ToString()
return ModelReaderWriter.Write(this).ToString();
}
}
}
}
3 changes: 3 additions & 0 deletions .dotnet/src/Custom/Assistants/AssistantThread.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

[Experimental("OPENAI001")]
[CodeGenModel("ThreadObject")]
public partial class AssistantThread
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand All @@ -23,4 +20,4 @@ protected override void WriteCore(Utf8JsonWriter writer, ModelReaderWriterOption
writer.WriteSerializedAdditionalRawData(SerializedAdditionalRawData, options);
writer.WriteEndObject();
}
}
}
2 changes: 2 additions & 0 deletions .dotnet/src/Custom/Assistants/CodeInterpreterToolResources.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

/// <summary> The AssistantObjectToolResourcesCodeInterpreter. </summary>
[Experimental("OPENAI001")]
[CodeGenModel("AssistantObjectToolResourcesCodeInterpreter")]
public partial class CodeInterpreterToolResources
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
3 changes: 1 addition & 2 deletions .dotnet/src/Custom/Assistants/FileSearchToolDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

[Experimental("OPENAI001")]
[CodeGenModel("AssistantToolsFileSearch")]
[CodeGenSuppress(nameof(FileSearchToolDefinition))]
public partial class FileSearchToolDefinition : ToolDefinition
Expand Down
2 changes: 2 additions & 0 deletions .dotnet/src/Custom/Assistants/FileSearchToolResources.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;

namespace OpenAI.Assistants;

[Experimental("OPENAI001")]
[CodeGenModel("ToolResourcesFileSearch")]
[CodeGenSerialization(nameof(NewVectorStores), "vector_stores", SerializationValueHook = nameof(SerializeNewVectorStores))]
public partial class FileSearchToolResources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand All @@ -25,4 +22,4 @@ protected override void WriteCore(Utf8JsonWriter writer, ModelReaderWriterOption
writer.WriteSerializedAdditionalRawData(SerializedAdditionalRawData, options);
writer.WriteEndObject();
}
}
}
1 change: 1 addition & 0 deletions .dotnet/src/Custom/Assistants/FunctionToolDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace OpenAI.Assistants;

[Experimental("OPENAI001")]
[CodeGenModel("AssistantToolsFunction")]
[CodeGenSuppress(nameof(FunctionToolDefinition), typeof(InternalFunctionDefinition))]
public partial class FunctionToolDefinition : ToolDefinition
Expand Down
18 changes: 17 additions & 1 deletion .dotnet/src/Custom/Assistants/GeneratorStubs.cs
Original file line number Diff line number Diff line change
@@ -1,51 +1,67 @@
using System.Diagnostics.CodeAnalysis;

namespace OpenAI.Assistants;

/*
* This file stubs and performs minimal customization to generated public types for the OpenAI.Assistants namespace
* that are not otherwise attributed elsewhere.
*/

[Experimental("OPENAI001")]
[CodeGenModel("AssistantToolsCode")]
public partial class CodeInterpreterToolDefinition : ToolDefinition { }
Comment thread
ShivangiReja marked this conversation as resolved.

[Experimental("OPENAI001")]
[CodeGenModel("MessageObjectStatus")]
public readonly partial struct MessageStatus { }

[Experimental("OPENAI001")]
[CodeGenModel("MessageObjectIncompleteDetails")]
public partial class MessageFailureDetails { }

[Experimental("OPENAI001")]
[CodeGenModel("MessageObjectIncompleteDetailsReason")]
public readonly partial struct MessageFailureReason { }

[Experimental("OPENAI001")]
[CodeGenModel("RunCompletionUsage")]
public partial class RunTokenUsage { }

[Experimental("OPENAI001")]
[CodeGenModel("RunObjectLastError")]
public partial class RunError { }

[Experimental("OPENAI001")]
[CodeGenModel("RunObjectLastErrorCode")]
public readonly partial struct RunErrorCode { }

[Experimental("OPENAI001")]
[CodeGenModel("RunObjectIncompleteDetails")]
public partial class RunIncompleteDetails { }

[Experimental("OPENAI001")]
[CodeGenModel("RunObjectIncompleteDetailsReason")]
public readonly partial struct RunIncompleteReason { }

[Experimental("OPENAI001")]
[CodeGenModel("RunStepObjectType")]
public readonly partial struct RunStepType { }

[Experimental("OPENAI001")]
[CodeGenModel("RunStepObjectStatus")]
public readonly partial struct RunStepStatus { }

[Experimental("OPENAI001")]
[CodeGenModel("RunStepObjectLastError")]
public partial class RunStepError { }

[Experimental("OPENAI001")]
[CodeGenModel("RunStepObjectLastErrorCode")]
public readonly partial struct RunStepErrorCode { }

[Experimental("OPENAI001")]
[CodeGenModel("RunStepCompletionUsage")]
public partial class RunStepTokenUsage { }

[Experimental("OPENAI001")]
[CodeGenModel("RunStepDetailsToolCallsCodeObjectCodeInterpreterOutputsObject")]
public partial class RunStepCodeInterpreterOutput { }
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;

namespace OpenAI.Assistants;
Expand Down
Loading