Skip to content

Commit 475ef3b

Browse files
committed
merge
2 parents 197400a + 6bb8493 commit 475ef3b

File tree

440 files changed

+14449
-14116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

440 files changed

+14449
-14116
lines changed

api/OpenAI.net8.0.cs

Lines changed: 186 additions & 0 deletions
Large diffs are not rendered by default.

api/OpenAI.netstandard2.0.cs

Lines changed: 172 additions & 0 deletions
Large diffs are not rendered by default.

codegen/generator/src/OpenAI.Library.Plugin.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<RootNamespace>OpenAI.Microsoft.Generator.CSharp.ClientModel.Plugin</RootNamespace>
77
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250915.1" />
11+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250926.1" />
1212
</ItemGroup>
1313

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

2626

27+

codegen/generator/src/OpenAILibraryVisitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public class OpenAILibraryVisitor : ScmLibraryVisitor
4949

5050
protected override TypeProvider VisitType(TypeProvider type)
5151
{
52-
if (type is ModelProvider { BaseModelProvider: null } && type.Fields.Count > 0)
52+
var additionalPropertiesField = type.Fields.FirstOrDefault(f => f.Name == AdditionalPropertiesFieldName);
53+
if (type is ModelProvider { BaseModelProvider: null } && additionalPropertiesField != null)
5354
{
5455
// Add an internal AdditionalProperties property to all base models
55-
var additionalPropertiesField = type.Fields.Single(f => f.Name == AdditionalPropertiesFieldName);
5656
var properties = new List<PropertyProvider>(type.Properties)
5757
{
5858
new PropertyProvider($"", MethodSignatureModifiers.Internal,

codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,12 @@ public class ExperimentalAttributeVisitor : ScmLibraryVisitor
618618

619619
protected override PropertyProvider? VisitProperty(PropertyProvider property)
620620
{
621+
// Skip properties that are already marked as experimental
622+
if (property.Attributes.Any(attr => attr.Type.Equals(typeof(ExperimentalAttribute))))
623+
{
624+
return base.VisitProperty(property);
625+
}
626+
621627
// Skip properties that are not public or are in non-stable classes
622628
if ((!property.Modifiers.HasFlag(MethodSignatureModifiers.Public) &&
623629
!property.Modifiers.HasFlag(MethodSignatureModifiers.Protected)) ||

codegen/generator/src/Visitors/PageOrderRemovalVisitor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ private static InputParameter CreateSyntheticPageOrderInputParameter()
9898
discriminatedSubtypes: new Dictionary<string, InputModelType>(),
9999
additionalProperties: null,
100100
modelAsStruct: true,
101-
serializationOptions: new());
101+
serializationOptions: new(),
102+
isDynamicModel: false);
102103
return new InputQueryParameter(
103104
name: "order",
104105
serializedName: "order",

codegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@open-ai/plugin": "file:",
3232
"@azure-tools/typespec-client-generator-core": "0.60.0",
33-
"@typespec/http-client-csharp": "1.0.0-alpha.20250915.1",
33+
"@typespec/http-client-csharp": "1.0.0-alpha.20250926.1",
3434
"@typespec/http": "1.4.0",
3535
"@typespec/openapi": "1.4.0"
3636
},

package-lock.json

Lines changed: 116 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/base/typespec/responses/models.tsp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,13 @@ model ImageGenTool extends Tool {
19151915
""")
19161916
background?: "transparent" | "opaque" | "auto" = "auto";
19171917

1918+
@doc("""
1919+
Control how much effort the model will exert to match the style and features,
1920+
especially facial features, of input images. This parameter is only supported
1921+
for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`.
1922+
""")
1923+
input_fidelity?: "low" | "high" = "low";
1924+
19181925
@doc("""
19191926
Optional mask for inpainting. Contains `image_url`
19201927
(string, optional) and `file_id` (string, optional).
@@ -1937,7 +1944,8 @@ model ImageGenTool extends Tool {
19371944
/** An image generation request made by the model. */
19381945
alias ImageGenToolCallItemBase = {
19391946
/** The generated image encoded in base64. */
1940-
result: string | null;
1947+
@encode("base64", string)
1948+
result: bytes | null;
19411949
};
19421950

19431951
@@doc(ImageGenToolCallItemResource,
@@ -2285,7 +2293,8 @@ model ResponseImageGenCallPartialImageEvent extends ResponseStreamEvent {
22852293
partial_image_index: int32;
22862294

22872295
/** Base64-encoded partial image data, suitable for rendering as an image. */
2288-
partial_image_b64: string;
2296+
@encode("base64", string)
2297+
partial_image_b64: bytes;
22892298
}
22902299

22912300
// Tool customization: Remove shared sequence_number property that was moved to the common parent

specification/client/responses.client.tsp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ using Azure.ClientGenerator.Core;
5050
@@alternateType(MCPListToolsItemResource.error, unknown | null);
5151
@@clientName(MCPListToolsItemResource.tools, "ToolDefinitions");
5252

53+
@@visibility(ImageGenToolCallItemResource.status, Lifecycle.Read);
54+
@@clientName(ImageGenToolCallItemResource.result, "GeneratedImageBytes");
55+
5356
// ------------ Tools ------------
5457

5558
@@clientName(FileSearchTool.max_num_results, "MaxResultCount");
@@ -76,4 +79,6 @@ using Azure.ClientGenerator.Core;
7679
@@alternateType(ResponseMCPCallArgumentsDoneEvent.arguments, unknown);
7780
// @@clientName(ResponseMCPCallArgumentsDoneEvent.arguments, "ToolArguments");
7881

79-
@@alternateType(ResponseMCPCallArgumentsDeltaEvent.delta, unknown);
82+
@@alternateType(ResponseMCPCallArgumentsDeltaEvent.delta, unknown);
83+
84+
@@clientName(ResponseImageGenCallPartialImageEvent.partial_image_b64, "PartialImageBytes");

0 commit comments

Comments
 (0)