Skip to content

Commit 7ba351a

Browse files
committed
regen
1 parent 80a21c4 commit 7ba351a

File tree

56 files changed

+168
-57
lines changed

Some content is hidden

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

56 files changed

+168
-57
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

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

1414
<!-- Copy output to package dist path for local execution and -->

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.61.0",
33-
"@typespec/http-client-csharp": "1.0.0-alpha.20251110.1",
33+
"@typespec/http-client-csharp": "1.0.0-alpha.20251111.2",
3434
"@typespec/http": "1.5.0",
3535
"@typespec/openapi": "1.5.0"
3636
},

package-lock.json

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

src/Generated/Internal/ClientUriBuilder.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public ClientUriBuilder()
1919
{
2020
}
2121

22-
private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder();
22+
private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder();
2323

24-
private StringBuilder PathAndQuery => _pathAndQuery ??= new StringBuilder();
24+
private StringBuilder PathAndQuery => _pathAndQuery ??= new StringBuilder();
2525

2626
public void Reset(Uri uri)
2727
{
@@ -37,13 +37,13 @@ public void AppendPath(string value, bool escape)
3737
{
3838
value = Uri.EscapeDataString(value);
3939
}
40-
if (_pathLength > 0 && PathAndQuery[_pathLength - 1] == '/' && value[0] == '/')
40+
if (_pathLength > 0 && PathAndQuery[_pathLength - 1] == '/' && value[0] == '/')
4141
{
42-
PathAndQuery.Remove(_pathLength - 1, 1);
43-
_pathLength = _pathLength - 1;
42+
PathAndQuery.Remove(_pathLength - 1, 1);
43+
_pathLength = _pathLength - 1;
4444
}
4545
PathAndQuery.Insert(_pathLength, value);
46-
_pathLength = _pathLength + value.Length;
46+
_pathLength = _pathLength + value.Length;
4747
}
4848

4949
public void AppendPath(bool value, bool escape = false) => AppendPath(TypeFormatters.ConvertToString(value), escape);
@@ -77,7 +77,7 @@ public void AppendQuery(string name, string value, bool escape)
7777
{
7878
PathAndQuery.Append('?');
7979
}
80-
if (PathAndQuery.Length > _pathLength && PathAndQuery[PathAndQuery.Length - 1] != '?')
80+
if (PathAndQuery.Length > _pathLength && PathAndQuery[PathAndQuery.Length - 1] != '?')
8181
{
8282
PathAndQuery.Append('&');
8383
}
@@ -124,7 +124,7 @@ public Uri ToUri()
124124
UriBuilder.Path = PathAndQuery.ToString(0, _pathLength);
125125
if (PathAndQuery.Length > _pathLength)
126126
{
127-
UriBuilder.Query = PathAndQuery.ToString(_pathLength + 1, PathAndQuery.Length - _pathLength - 1);
127+
UriBuilder.Query = PathAndQuery.ToString(_pathLength + 1, PathAndQuery.Length - _pathLength - 1);
128128
}
129129
if (PathAndQuery.Length == _pathLength)
130130
{

src/Generated/Models/Chat/AssistantChatMessage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ internal AssistantChatMessage(ChatMessageRole role, ChatMessageContent content,
2323
OutputAudioReference = outputAudioReference;
2424
ToolCalls = toolCalls ?? new ChangeTrackingList<ChatToolCall>();
2525
FunctionCall = functionCall;
26+
Patch.SetPropagators(PropagateSet, PropagateGet);
2627
}
2728
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
2829

src/Generated/Models/Chat/InternalChatCompletionRequestMessageContentPartAudio.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal InternalChatCompletionRequestMessageContentPartAudio(InternalChatComple
2020
internal InternalChatCompletionRequestMessageContentPartAudio(in JsonPatch patch, InternalChatCompletionRequestMessageContentPartAudioInputAudio inputAudio) : base(patch)
2121
{
2222
InputAudio = inputAudio;
23+
Patch.SetPropagators(PropagateSet, PropagateGet);
2324
}
2425
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
2526

src/Generated/Models/Chat/InternalChatCompletionRequestMessageContentPartFile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal InternalChatCompletionRequestMessageContentPartFile(InternalChatComplet
2020
internal InternalChatCompletionRequestMessageContentPartFile(in JsonPatch patch, InternalChatCompletionRequestMessageContentPartFileFile @file) : base(patch)
2121
{
2222
File = @file;
23+
Patch.SetPropagators(PropagateSet, PropagateGet);
2324
}
2425
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
2526

src/Generated/Models/Chat/InternalChatCompletionRequestMessageContentPartImage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal InternalChatCompletionRequestMessageContentPartImage(InternalChatComple
2020
internal InternalChatCompletionRequestMessageContentPartImage(in JsonPatch patch, InternalChatCompletionRequestMessageContentPartImageImageUrl imageUrl) : base(patch)
2121
{
2222
ImageUrl = imageUrl;
23+
Patch.SetPropagators(PropagateSet, PropagateGet);
2324
}
2425
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
2526

src/Generated/Models/Chat/InternalDotNetChatResponseFormatJsonSchema.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ internal InternalDotNetChatResponseFormatJsonSchema(InternalDotNetChatResponseFo
2121
internal InternalDotNetChatResponseFormatJsonSchema(InternalResponseFormatType kind, in JsonPatch patch, InternalDotNetChatResponseFormatJsonSchemaJsonSchema jsonSchema) : base(kind, patch)
2222
{
2323
JsonSchema = jsonSchema;
24+
Patch.SetPropagators(PropagateSet, PropagateGet);
2425
}
2526
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
2627

src/Generated/Models/Internal/InternalResponseFormatJsonSchema.Serialization.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ internal static InternalResponseFormatJsonSchema DeserializeInternalResponseForm
8383
}
8484
if (prop.NameEquals("json_schema"u8))
8585
{
86-
jsonSchema = InternalResponseFormatJsonSchemaJsonSchema.DeserializeInternalResponseFormatJsonSchemaJsonSchema(prop.Value, options);
86+
jsonSchema = InternalResponseFormatJsonSchemaJsonSchema.DeserializeInternalResponseFormatJsonSchemaJsonSchema(prop.Value, prop.Value.GetUtf8Bytes(), options);
8787
continue;
8888
}
8989
patch.Set([.. "$."u8, .. Encoding.UTF8.GetBytes(prop.Name)], prop.Value.GetUtf8Bytes());
@@ -123,5 +123,33 @@ protected override InternalResponseFormat PersistableModelCreateCore(BinaryData
123123
}
124124

125125
string IPersistableModel<InternalResponseFormatJsonSchema>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
126+
127+
#pragma warning disable SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
128+
private bool PropagateGet(ReadOnlySpan<byte> jsonPath, out JsonPatch.EncodedValue value)
129+
{
130+
ReadOnlySpan<byte> local = jsonPath.SliceToStartOfPropertyName();
131+
value = default;
132+
133+
if (local.StartsWith("json_schema"u8))
134+
{
135+
return JsonSchema.Patch.TryGetEncodedValue([.. "$"u8, .. local.Slice("json_schema"u8.Length)], out value);
136+
}
137+
return false;
138+
}
139+
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
140+
141+
#pragma warning disable SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
142+
private bool PropagateSet(ReadOnlySpan<byte> jsonPath, JsonPatch.EncodedValue value)
143+
{
144+
ReadOnlySpan<byte> local = jsonPath.SliceToStartOfPropertyName();
145+
146+
if (local.StartsWith("json_schema"u8))
147+
{
148+
JsonSchema.Patch.Set([.. "$"u8, .. local.Slice("json_schema"u8.Length)], value);
149+
return true;
150+
}
151+
return false;
152+
}
153+
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
126154
}
127155
}

0 commit comments

Comments
 (0)