Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 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.20250722.1" />
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250827.2" />
</ItemGroup>

<!-- Copy output to package dist path for local execution and -->
Expand Down
2 changes: 1 addition & 1 deletion codegen/generator/src/OpenAILibraryGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace OpenAILibraryPlugin
public class OpenAILibraryGenerator : ScmCodeModelGenerator
{
private static OpenAILibraryGenerator? s_instance;
internal static OpenAILibraryGenerator Instance => s_instance ?? throw new InvalidOperationException("OpenAILibraryGenerator was not initialized.");
internal static new OpenAILibraryGenerator Instance => s_instance ?? throw new InvalidOperationException("OpenAILibraryGenerator was not initialized.");

[ImportingConstructor]
public OpenAILibraryGenerator(GeneratorContext context) : base(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ContentInnerCollectionDefinedVisitor : ScmLibraryVisitor
{
private const string Comment = "Plugin customization: add Content.IsInnerCollectionDefined() check";

protected override MethodProvider VisitMethod(MethodProvider method)
protected override MethodProvider? VisitMethod(MethodProvider method)
{
if (method.Signature.Name != "JsonModelWriteCore"
|| method.BodyStatements is not MethodBodyStatements methodBodyStatements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace OpenAILibraryPlugin.Visitors;
/// </summary>
public class ImplicitConversionToBinaryContentVisitor : ScmLibraryVisitor
{
protected override MethodProvider VisitMethod(MethodProvider method)
protected override MethodProvider? VisitMethod(MethodProvider method)
{
if (method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Implicit) &&
method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Operator) &&
Expand Down
19 changes: 8 additions & 11 deletions codegen/generator/src/Visitors/PageOrderRemovalVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,20 @@ private static InputParameter CreateSyntheticPageOrderInputParameter()
additionalProperties: null,
modelAsStruct: true,
serializationOptions: new());
return new InputParameter(
return new InputQueryParameter(
name: "order",
nameInRequest: "order",
serializedName: "order",
summary: "",
doc: "",
inputModelType,
InputRequestLocation.Query,
type: inputModelType,
defaultValue: null,
InputParameterKind.Spread,
scope: InputParameterScope.Spread,
isRequired: false,
isReadOnly: false,
isApiVersion: false,
isContentType: false,
isEndpoint: false,
skipUrlEncoding: false,
explode: true,
arraySerializationDelimiter: null,
headerCollectionPrefix: null,
serverUrlTemplate: null);
access: null,
collectionFormat: null,
arraySerializationDelimiter: null);
}
}
3 changes: 2 additions & 1 deletion codegen/generator/src/Visitors/PaginationVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ private bool TryHandleGetRawPagesAsyncMethod(MethodProvider method)
if (binaryExpr.Left is VariableExpression leftVar &&
leftVar.Declaration.RequestedName == "nextToken" &&
binaryExpr.Right is KeywordExpression rightKeyword &&
rightKeyword.Keyword == "null")
rightKeyword.Keyword == "null"
&& hasMoreVariable != null)
{
// Create "!hasMore" condition. Note the hasMoreVariable gets assigned earlier in the method statements
// in the WhileStatement handler below.
Expand Down
10 changes: 5 additions & 5 deletions codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
],
"dependencies": {
"@open-ai/plugin": "file:",
"@azure-tools/typespec-client-generator-core": "0.57.2",
"@azure-tools/typespec-azure-core": "0.57.0",
"@typespec/http-client-csharp": "1.0.0-alpha.20250722.1",
"@typespec/http": "1.1.0",
"@typespec/openapi": "1.1.0"
"@azure-tools/typespec-client-generator-core": "0.59.0",
"@azure-tools/typespec-azure-core": "0.59.0",
"@typespec/http-client-csharp": "1.0.0-alpha.20250827.2",
"@typespec/http": "1.3.0",
"@typespec/openapi": "1.3.0"
},
"devDependencies": {
"@types/node": "^22.8.1",
Expand Down
Loading