Skip to content
Open
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
3 changes: 2 additions & 1 deletion codegen/generator/src/OpenAI.Library.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250915.1" />
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250918.1" />
</ItemGroup>

<!-- Copy output to package dist path for local execution and -->
Expand All @@ -24,3 +24,4 @@
</Project>



2 changes: 1 addition & 1 deletion codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"@open-ai/plugin": "file:",
"@azure-tools/typespec-client-generator-core": "0.60.0",
"@typespec/http-client-csharp": "1.0.0-alpha.20250915.1",
"@typespec/http-client-csharp": "1.0.0-alpha.20250918.1",
"@typespec/http": "1.4.0",
"@typespec/openapi": "1.4.0"
},
Expand Down
234 changes: 116 additions & 118 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct AssistantCollectionOrder : IEquatable<AssistantCollectionOrder>
public readonly partial struct AssistantCollectionOrder : ValueType, IEquatable<AssistantCollectionOrder>
{
private readonly string _value;
private const string AscendingValue = "asc";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/FileSearchRanker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct FileSearchRanker : IEquatable<FileSearchRanker>
public readonly partial struct FileSearchRanker : ValueType, IEquatable<FileSearchRanker>
{
private readonly string _value;
private const string AutoValue = "auto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OpenAI.Assistants
{
public partial class FileSearchToolDefinition : IJsonModel<FileSearchToolDefinition>
public partial class FileSearchToolDefinition : ToolDefinition, IJsonModel<FileSearchToolDefinition>
{
void IJsonModel<FileSearchToolDefinition>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalAssistantSupportedModels : IEquatable<InternalAssistantSupportedModels>
internal readonly partial struct InternalAssistantSupportedModels : ValueType, IEquatable<InternalAssistantSupportedModels>
{
private readonly string _value;
private const string Gpt41Value = "gpt-4.1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalAssistantToolDefinitionType : IEquatable<InternalAssistantToolDefinitionType>
internal readonly partial struct InternalAssistantToolDefinitionType : ValueType, IEquatable<InternalAssistantToolDefinitionType>
{
private readonly string _value;
private const string CodeInterpreterValue = "code_interpreter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalAssistantsNamedToolChoiceType : IEquatable<InternalAssistantsNamedToolChoiceType>
internal readonly partial struct InternalAssistantsNamedToolChoiceType : ValueType, IEquatable<InternalAssistantsNamedToolChoiceType>
{
private readonly string _value;
private const string FunctionValue = "function";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalCreateThreadAndRunRequestModel : IEquatable<InternalCreateThreadAndRunRequestModel>
internal readonly partial struct InternalCreateThreadAndRunRequestModel : ValueType, IEquatable<InternalCreateThreadAndRunRequestModel>
{
private readonly string _value;
private const string Gpt41Value = "gpt-4.1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalCreateThreadAndRunRequestToolChoice : IEquatable<InternalCreateThreadAndRunRequestToolChoice>
internal readonly partial struct InternalCreateThreadAndRunRequestToolChoice : ValueType, IEquatable<InternalCreateThreadAndRunRequestToolChoice>
{
private readonly string _value;
private const string NoneValue = "none";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalIncludedRunStepProperty : IEquatable<InternalIncludedRunStepProperty>
internal readonly partial struct InternalIncludedRunStepProperty : ValueType, IEquatable<InternalIncludedRunStepProperty>
{
private readonly string _value;
private const string FileSearchResultContentValue = "step_details.tool_calls[*].file_search.results[*].content";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageContentImageFileObjectImageFileDetail : IEquatable<InternalMessageContentImageFileObjectImageFileDetail>
internal readonly partial struct InternalMessageContentImageFileObjectImageFileDetail : ValueType, IEquatable<InternalMessageContentImageFileObjectImageFileDetail>
{
private readonly string _value;
private const string AutoValue = "auto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageContentImageUrlObjectImageUrlDetail : IEquatable<InternalMessageContentImageUrlObjectImageUrlDetail>
internal readonly partial struct InternalMessageContentImageUrlObjectImageUrlDetail : ValueType, IEquatable<InternalMessageContentImageUrlObjectImageUrlDetail>
{
private readonly string _value;
private const string AutoValue = "auto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageContentTextAnnotationType : IEquatable<InternalMessageContentTextAnnotationType>
internal readonly partial struct InternalMessageContentTextAnnotationType : ValueType, IEquatable<InternalMessageContentTextAnnotationType>
{
private readonly string _value;
private const string FileCitationValue = "file_citation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageContentType : IEquatable<InternalMessageContentType>
internal readonly partial struct InternalMessageContentType : ValueType, IEquatable<InternalMessageContentType>
{
private readonly string _value;
private const string TextValue = "text";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageDeltaContentImageFileObjectImageFileDetail : IEquatable<InternalMessageDeltaContentImageFileObjectImageFileDetail>
internal readonly partial struct InternalMessageDeltaContentImageFileObjectImageFileDetail : ValueType, IEquatable<InternalMessageDeltaContentImageFileObjectImageFileDetail>
{
private readonly string _value;
private const string AutoValue = "auto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageDeltaContentImageUrlObjectImageUrlDetail : IEquatable<InternalMessageDeltaContentImageUrlObjectImageUrlDetail>
internal readonly partial struct InternalMessageDeltaContentImageUrlObjectImageUrlDetail : ValueType, IEquatable<InternalMessageDeltaContentImageUrlObjectImageUrlDetail>
{
private readonly string _value;
private const string AutoValue = "auto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageDeltaObjectDeltaRole : IEquatable<InternalMessageDeltaObjectDeltaRole>
internal readonly partial struct InternalMessageDeltaObjectDeltaRole : ValueType, IEquatable<InternalMessageDeltaObjectDeltaRole>
{
private readonly string _value;
private const string UserValue = "user";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalMessageObjectRole : IEquatable<InternalMessageObjectRole>
internal readonly partial struct InternalMessageObjectRole : ValueType, IEquatable<InternalMessageObjectRole>
{
private readonly string _value;
private const string UserValue = "user";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OpenAI.Assistants
{
internal partial class InternalRequiredFunctionToolCall : IJsonModel<InternalRequiredFunctionToolCall>
internal partial class InternalRequiredFunctionToolCall : InternalRequiredToolCall, IJsonModel<InternalRequiredFunctionToolCall>
{
internal InternalRequiredFunctionToolCall()
{
Expand All @@ -23,13 +23,14 @@ void IJsonModel<InternalRequiredFunctionToolCall>.Write(Utf8JsonWriter writer, M
writer.WriteEndObject();
}

protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<InternalRequiredFunctionToolCall>)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
throw new FormatException($"The model {nameof(InternalRequiredFunctionToolCall)} does not support writing '{format}' format.");
}
base.JsonModelWriteCore(writer, options);
if (_additionalBinaryDataProperties?.ContainsKey("id") != true)
{
writer.WritePropertyName("id"u8);
Expand Down Expand Up @@ -67,9 +68,9 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
}
}

InternalRequiredFunctionToolCall IJsonModel<InternalRequiredFunctionToolCall>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options);
InternalRequiredFunctionToolCall IJsonModel<InternalRequiredFunctionToolCall>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalRequiredFunctionToolCall)JsonModelCreateCore(ref reader, options);

protected virtual InternalRequiredFunctionToolCall JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
protected override object JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<InternalRequiredFunctionToolCall>)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
Expand Down Expand Up @@ -115,7 +116,7 @@ internal static InternalRequiredFunctionToolCall DeserializeInternalRequiredFunc

BinaryData IPersistableModel<InternalRequiredFunctionToolCall>.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options);

protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options)
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<InternalRequiredFunctionToolCall>)this).GetFormatFromOptions(options) : options.Format;
switch (format)
Expand All @@ -127,9 +128,9 @@ protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions
}
}

InternalRequiredFunctionToolCall IPersistableModel<InternalRequiredFunctionToolCall>.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options);
InternalRequiredFunctionToolCall IPersistableModel<InternalRequiredFunctionToolCall>.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalRequiredFunctionToolCall)PersistableModelCreateCore(data, options);

protected virtual InternalRequiredFunctionToolCall PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options)
protected override object PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<InternalRequiredFunctionToolCall>)this).GetFormatFromOptions(options) : options.Format;
switch (format)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace OpenAI.Assistants
{
internal partial class InternalRequiredFunctionToolCall
internal partial class InternalRequiredFunctionToolCall : InternalRequiredToolCall
{
private protected IDictionary<string, BinaryData> _additionalBinaryDataProperties;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OpenAI.Assistants
{
internal partial class InternalRunStepCodeInterpreterLogOutput : IJsonModel<InternalRunStepCodeInterpreterLogOutput>
internal partial class InternalRunStepCodeInterpreterLogOutput : RunStepCodeInterpreterOutput, IJsonModel<InternalRunStepCodeInterpreterLogOutput>
{
internal InternalRunStepCodeInterpreterLogOutput() : this(InternalRunStepDetailsCodeInterpreterOutputType.Logs, null, null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalRunStepDetailsCodeInterpreterOutputType : IEquatable<InternalRunStepDetailsCodeInterpreterOutputType>
internal readonly partial struct InternalRunStepDetailsCodeInterpreterOutputType : ValueType, IEquatable<InternalRunStepDetailsCodeInterpreterOutputType>
{
private readonly string _value;
private const string LogsValue = "logs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OpenAI.Assistants
{
internal partial class InternalRunStepDetailsMessageCreationObject : IJsonModel<InternalRunStepDetailsMessageCreationObject>
internal partial class InternalRunStepDetailsMessageCreationObject : RunStepDetails, IJsonModel<InternalRunStepDetailsMessageCreationObject>
{
internal InternalRunStepDetailsMessageCreationObject() : this(InternalRunStepDetailsType.MessageCreation, null, null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalRunStepDetailsType : IEquatable<InternalRunStepDetailsType>
internal readonly partial struct InternalRunStepDetailsType : ValueType, IEquatable<InternalRunStepDetailsType>
{
private readonly string _value;
private const string MessageCreationValue = "message_creation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Assistants
{
internal readonly partial struct InternalTruncationObjectType : IEquatable<InternalTruncationObjectType>
internal readonly partial struct InternalTruncationObjectType : ValueType, IEquatable<InternalTruncationObjectType>
{
private readonly string _value;
private const string AutoValue = "auto";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/MessageCollectionOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct MessageCollectionOrder : IEquatable<MessageCollectionOrder>
public readonly partial struct MessageCollectionOrder : ValueType, IEquatable<MessageCollectionOrder>
{
private readonly string _value;
private const string AscendingValue = "asc";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/MessageFailureReason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct MessageFailureReason : IEquatable<MessageFailureReason>
public readonly partial struct MessageFailureReason : ValueType, IEquatable<MessageFailureReason>
{
private readonly string _value;
private const string ContentFilterValue = "content_filter";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/MessageStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct MessageStatus : IEquatable<MessageStatus>
public readonly partial struct MessageStatus : ValueType, IEquatable<MessageStatus>
{
private readonly string _value;
private const string InProgressValue = "in_progress";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunCollectionOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunCollectionOrder : IEquatable<RunCollectionOrder>
public readonly partial struct RunCollectionOrder : ValueType, IEquatable<RunCollectionOrder>
{
private readonly string _value;
private const string AscendingValue = "asc";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunErrorCode : IEquatable<RunErrorCode>
public readonly partial struct RunErrorCode : ValueType, IEquatable<RunErrorCode>
{
private readonly string _value;
private const string ServerErrorValue = "server_error";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunIncompleteReason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunIncompleteReason : IEquatable<RunIncompleteReason>
public readonly partial struct RunIncompleteReason : ValueType, IEquatable<RunIncompleteReason>
{
private readonly string _value;
private const string MaxCompletionTokensValue = "max_completion_tokens";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunStatus : IEquatable<RunStatus>
public readonly partial struct RunStatus : ValueType, IEquatable<RunStatus>
{
private readonly string _value;
private const string QueuedValue = "queued";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunStepCollectionOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunStepCollectionOrder : IEquatable<RunStepCollectionOrder>
public readonly partial struct RunStepCollectionOrder : ValueType, IEquatable<RunStepCollectionOrder>
{
private readonly string _value;
private const string AscendingValue = "asc";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunStepErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunStepErrorCode : IEquatable<RunStepErrorCode>
public readonly partial struct RunStepErrorCode : ValueType, IEquatable<RunStepErrorCode>
{
private readonly string _value;
private const string ServerErrorValue = "server_error";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Assistants/RunStepStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OpenAI.Assistants
{
[Experimental("OPENAI001")]
public readonly partial struct RunStepStatus : IEquatable<RunStepStatus>
public readonly partial struct RunStepStatus : ValueType, IEquatable<RunStepStatus>
{
private readonly string _value;
private const string InProgressValue = "in_progress";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Audio/AudioTranscriptionFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Audio
{
public readonly partial struct AudioTranscriptionFormat : IEquatable<AudioTranscriptionFormat>
public readonly partial struct AudioTranscriptionFormat : ValueType, IEquatable<AudioTranscriptionFormat>
{
private readonly string _value;
private const string JsonValue = "json";
Expand Down
2 changes: 1 addition & 1 deletion src/Generated/Models/Audio/AudioTranslationFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenAI.Audio
{
public readonly partial struct AudioTranslationFormat : IEquatable<AudioTranslationFormat>
public readonly partial struct AudioTranslationFormat : ValueType, IEquatable<AudioTranslationFormat>
{
private readonly string _value;
private const string JsonValue = "json";
Expand Down
Loading