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
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.20250926.1" />
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250929.2" />
</ItemGroup>

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




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.20250926.1",
"@typespec/http-client-csharp": "1.0.0-alpha.20250929.2",
"@typespec/http": "1.4.0",
"@typespec/openapi": "1.4.0"
},
Expand Down
196 changes: 98 additions & 98 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down Expand Up @@ -193,5 +194,13 @@ protected virtual AudioTranslation PersistableModelCreateCore(BinaryData data, M
}

string IPersistableModel<AudioTranslation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

[Experimental("OPENAI001")]
public static explicit operator AudioTranslation(ClientResult result)
{
using PipelineResponse response = result.GetRawResponse();
using JsonDocument document = JsonDocument.Parse(response.Content);
return DeserializeAudioTranslation(document.RootElement, ModelSerializationExtensions.WireOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;
Expand Down Expand Up @@ -148,5 +149,12 @@ protected virtual InternalCreateTranscriptionResponseJson PersistableModelCreate
}

string IPersistableModel<InternalCreateTranscriptionResponseJson>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

public static explicit operator InternalCreateTranscriptionResponseJson(ClientResult result)
{
using PipelineResponse response = result.GetRawResponse();
using JsonDocument document = JsonDocument.Parse(response.Content);
return DeserializeInternalCreateTranscriptionResponseJson(document.RootElement, ModelSerializationExtensions.WireOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;
Expand Down Expand Up @@ -215,5 +216,12 @@ protected virtual InternalCreateTranscriptionResponseVerboseJson PersistableMode
}

string IPersistableModel<InternalCreateTranscriptionResponseVerboseJson>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

public static explicit operator InternalCreateTranscriptionResponseVerboseJson(ClientResult result)
{
using PipelineResponse response = result.GetRawResponse();
using JsonDocument document = JsonDocument.Parse(response.Content);
return DeserializeInternalCreateTranscriptionResponseVerboseJson(document.RootElement, ModelSerializationExtensions.WireOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Text.Json;
Expand Down Expand Up @@ -123,5 +124,12 @@ protected virtual InternalCreateTranslationResponseJson PersistableModelCreateCo
}

string IPersistableModel<InternalCreateTranslationResponseJson>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

public static explicit operator InternalCreateTranslationResponseJson(ClientResult result)
{
using PipelineResponse response = result.GetRawResponse();
using JsonDocument document = JsonDocument.Parse(response.Content);
return DeserializeInternalCreateTranslationResponseJson(document.RootElement, ModelSerializationExtensions.WireOptions);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Text.Json;
using OpenAI;
Expand Down Expand Up @@ -121,5 +122,12 @@ protected virtual StreamingAudioTranscriptionUpdate PersistableModelCreateCore(B
}

string IPersistableModel<StreamingAudioTranscriptionUpdate>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

public static explicit operator StreamingAudioTranscriptionUpdate(ClientResult result)
{
using PipelineResponse response = result.GetRawResponse();
using JsonDocument document = JsonDocument.Parse(response.Content);
return DeserializeStreamingAudioTranscriptionUpdate(document.RootElement, ModelSerializationExtensions.WireOptions);
}
}
}
Loading