fix: Fixed generator for enum type parameters #19
pull-request.yml
on: pull_request
Build abd test
/
Build, test and publish
3m 4s
Annotations
5 errors and 11 warnings
GeneratesCorrectly
Test method H.Generators.IntegrationTests.IpcGeneratorSnapshotTests.GeneratesCorrectly threw exception:
VerifyException: Directory: /home/runner/work/OpenAI/OpenAI/src/tests/OpenAI.Generators.SnapshotTests/Snapshots
NotEqual:
- Received: IpcGeneratorSnapshotTests.GeneratesCorrectly#IWeatherFunctions.Functions.generated.received.cs
Verified: IpcGeneratorSnapshotTests.GeneratesCorrectly#IWeatherFunctions.Functions.generated.verified.cs
FileContent:
NotEqual:
Received: IpcGeneratorSnapshotTests.GeneratesCorrectly#IWeatherFunctions.Functions.generated.received.cs
//HintName: IWeatherFunctions.Functions.generated.cs
using System.Collections.Generic;
#nullable enable
namespace H.Ipc.Generator.IntegrationTests
{
public static class WeatherFunctionsExtensions
{
public class GetCurrentWeatherArgs
{
public string Location { get; set; } = string.Empty;
public global::H.Ipc.Generator.IntegrationTests.Unit Unit { get; set; }
}
public class GetCurrentWeatherAsyncArgs
{
public string Location { get; set; } = string.Empty;
public global::H.Ipc.Generator.IntegrationTests.Unit Unit { get; set; }
}
public static (string Name, string Description, object Obj) GetCurrentWeatherAsParametersObject(this IWeatherFunctions functions)
{
return ("GetCurrentWeather", "Get the current weather in a given location", new
{
type = "object",
properties = new Dictionary<string, object>
{
["location"] = new
{
type = "string",
description = "The city and state, e.g. San Francisco, CA",
},
["unit"] = new
{
type = "string",
description = "",
@enum = new string[] { "celsius", "fahrenheit" },
}
},
required = new string[] { "location" },
});
}
public static (string Name, string Description, object Obj) GetCurrentWeatherAsyncAsParametersObject(this IWeatherFunctions functions)
{
return ("GetCurrentWeatherAsync", "Get the current weather in a given location", new
{
type = "object",
properties = new Dictionary<string, object>
{
["location"] = new
{
type = "string",
description = "The city and state, e.g. San Francisco, CA",
},
["unit"] = new
{
type = "string",
description = "",
@enum = new string[] { "celsius", "fahrenheit" },
}
},
required = new string[] { "location" },
});
}
public static (string Name, string Description, Dictionary<string, object> Dictionary) GetCurrentWeatherAsDictionary(this IWeatherFunctions functions)
{
return ("GetCurrentWeather", "Get the current weather in a given location", new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>
{
["location"] = new
{
type = "string",
description = "The city and state, e.g. San Francisco, CA",
},
["unit"] = new
{
type = "string",
description = "",
@enum = new string[] { "celsius", "fahrenheit" },
}
},
["required"] = new string[] { "location" },
});
}
public static (string Name, string Description, Dictionary<string
|
GeneratesUpdateCodeCorrectly
Test method H.Generators.IntegrationTests.IpcGeneratorSnapshotTests.GeneratesUpdateCodeCorrectly threw exception:
VerifyException: Directory: /home/runner/work/OpenAI/OpenAI/src/tests/OpenAI.Generators.SnapshotTests/Snapshots
NotEqual:
- Received: IpcGeneratorSnapshotTests.GeneratesUpdateCodeCorrectly#IUpdateCodeFunctions.Functions.generated.received.cs
Verified: IpcGeneratorSnapshotTests.GeneratesUpdateCodeCorrectly#IUpdateCodeFunctions.Functions.generated.verified.cs
FileContent:
NotEqual:
Received: IpcGeneratorSnapshotTests.GeneratesUpdateCodeCorrectly#IUpdateCodeFunctions.Functions.generated.received.cs
//HintName: IUpdateCodeFunctions.Functions.generated.cs
using System.Collections.Generic;
#nullable enable
namespace H.Ipc.Generator.IntegrationTests
{
public static class UpdateCodeFunctionsExtensions
{
public class UpdateCodeArgs
{
public global::System.Collections.Generic.IReadOnlyCollection<global::H.Ipc.Generator.IntegrationTests.Change>? Changes { get; set; }
}
public static (string Name, string Description, object Obj) UpdateCodeAsParametersObject(this IUpdateCodeFunctions functions)
{
return ("UpdateCode", "Allows to change the project code", new
{
type = "object",
properties = new Dictionary<string, object>
{
["changes"] = new
{
type = "array",
description = "A series of code changes that must end with END change type",
items = new
{
type = "object",
description = "",
properties = new Dictionary<string, object>
{
["Type"] = new
{
type = "string",
description = "Describes the type of change to be made",
@enum = new string[] { "createfile", "replacefragment", "deletefragment", "renamefile", "deletefile", "end" },
},
["Path"] = new
{
type = "string",
description = "Specifies the path to a file",
},
["RemoveCode"] = new
{
type = "string",
description = "Specifies the code to be removed. Used when deleting or replacing code.",
},
["AddCode"] = new
{
type = "string",
description = "Specifies the code to add. Used when creating a file or replacing code.",
},
["NewPath"] = new
{
type = "string",
description = "Specifies the new path for the file. Used when renaming a file.",
}
},
required = new string[] { "Type", "Path", "RemoveCode", "AddCode", "NewPath" },
},
}
},
required = new string[] { "changes" },
});
}
public static (string Name, string Description, Dictionary<string, object> Dictionary) UpdateCodeAsDictionary(this IUpdateCodeFunctions functions)
{
return ("UpdateCode", "Allows to change the project code", new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>
{
|
VariousTypes
Test method H.Generators.IntegrationTests.IpcGeneratorSnapshotTests.VariousTypes threw exception:
VerifyException: Directory: /home/runner/work/OpenAI/OpenAI/src/tests/OpenAI.Generators.SnapshotTests/Snapshots
NotEqual:
- Received: IpcGeneratorSnapshotTests.VariousTypes#IVariousTypesFunctions.Functions.generated.received.cs
Verified: IpcGeneratorSnapshotTests.VariousTypes#IVariousTypesFunctions.Functions.generated.verified.cs
FileContent:
NotEqual:
Received: IpcGeneratorSnapshotTests.VariousTypes#IVariousTypesFunctions.Functions.generated.received.cs
//HintName: IVariousTypesFunctions.Functions.generated.cs
using System.Collections.Generic;
#nullable enable
namespace H.Ipc.Generator.IntegrationTests
{
public static class VariousTypesFunctionsExtensions
{
public class GetCurrentWeatherArgs
{
public long Parameter1 { get; set; }
public int Parameter2 { get; set; }
public double Parameter3 { get; set; }
public float Parameter4 { get; set; }
public bool Parameter5 { get; set; }
public global::System.DateTime DateTime { get; set; }
public global::System.DateOnly Date { get; set; }
}
public static (string Name, string Description, object Obj) GetCurrentWeatherAsParametersObject(this IVariousTypesFunctions functions)
{
return ("GetCurrentWeather", "Get the current weather in a given location", new
{
type = "object",
properties = new Dictionary<string, object>
{
["parameter1"] = new
{
type = "integer",
format = "int64",
description = "",
},
["parameter2"] = new
{
type = "integer",
format = "int32",
description = "",
},
["parameter3"] = new
{
type = "number",
format = "float",
description = "",
},
["parameter4"] = new
{
type = "number",
format = "double",
description = "",
},
["parameter5"] = new
{
type = "boolean",
description = "",
},
["dateTime"] = new
{
type = "string",
format = "date-time",
description = "",
},
["date"] = new
{
type = "string",
format = "date",
description = "",
}
},
required = new string[] { "parameter1", "parameter2", "parameter3", "parameter4", "parameter5", "dateTime", "date" },
});
}
public static (string Name, string Description, Dictionary<string, object> Dictionary) GetCurrentWeatherAsDictionary(this IVariousTypesFunctions functions)
{
return ("GetCurrentWeather", "Get the current weather in a given location", new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>
{
["parameter1"] = new
{
type = "integer",
format = "int64",
description = "",
},
["parameter2"] = new
{
type = "integer",
format = "int32",
description = "",
},
["parameter3"] =
|
MaintenanceFunctionsTypes
Test method H.Generators.IntegrationTests.IpcGeneratorSnapshotTests.MaintenanceFunctionsTypes threw exception:
VerifyException: Directory: /home/runner/work/OpenAI/OpenAI/src/tests/OpenAI.Generators.SnapshotTests/Snapshots
NotEqual:
- Received: IpcGeneratorSnapshotTests.MaintenanceFunctionsTypes#IMaintenanceFunctions.Functions.generated.received.cs
Verified: IpcGeneratorSnapshotTests.MaintenanceFunctionsTypes#IMaintenanceFunctions.Functions.generated.verified.cs
FileContent:
NotEqual:
Received: IpcGeneratorSnapshotTests.MaintenanceFunctionsTypes#IMaintenanceFunctions.Functions.generated.received.cs
//HintName: IMaintenanceFunctions.Functions.generated.cs
using System.Collections.Generic;
#nullable enable
namespace H.Ipc.Generator.IntegrationTests
{
public static class MaintenanceFunctionsExtensions
{
public class GetContractTasksAsyncArgs
{
public global::H.Ipc.Generator.IntegrationTests.ExtractTasksRequest? Tasks { get; set; }
}
public static (string Name, string Description, object Obj) GetContractTasksAsyncAsParametersObject(this IMaintenanceFunctions functions)
{
return ("GetContractTasksAsync", "Get the tasks to extract from a contract", new
{
type = "object",
properties = new Dictionary<string, object>
{
["tasks"] = new
{
type = "object",
description = "The tasks extracted from the contract",
properties = new Dictionary<string, object>
{
["Tasks"] = new
{
type = "array",
description = "",
items = new
{
type = "string",
description = "",
},
}
},
required = new string[] { "Tasks" },
}
},
required = new string[] { "tasks" },
});
}
public static (string Name, string Description, Dictionary<string, object> Dictionary) GetContractTasksAsyncAsDictionary(this IMaintenanceFunctions functions)
{
return ("GetContractTasksAsync", "Get the tasks to extract from a contract", new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>
{
["tasks"] = new
{
type = "object",
description = "The tasks extracted from the contract",
properties = new Dictionary<string, object>
{
["Tasks"] = new
{
type = "array",
description = "",
items = new
{
type = "string",
description = "",
},
}
},
required = new string[] { "Tasks" },
}
},
["required"] = new string[] { "tasks" },
});
}
public static global::System.Collections.Generic.ICollection<global::OpenAI.Function> AsFunctions(this IMaintenanceFunctions functions)
{
var (name0, description0, jsonNode0) = functions.GetContractTasksAsyncAsParametersJsonNode();
return new global::System.Collections.Generic.List<global::OpenAI.Function>
{
new global::OpenAI.Function(
name: name0,
description: descr
|
Build abd test / Build, test and publish
Process completed with exit code 1.
|
Build abd test / Build, test and publish
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-dotnet@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Common/ListQuery.cs#L30
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Common/ListQuery.cs#L30
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Audio/AudioEndpoint.cs#L44
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Common/Function.cs#L33
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Common/Function.cs#L33
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Common/Function.cs#L33
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Audio/AudioTranslationRequest.cs#L35
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Audio/AudioTranslationRequest.cs#L36
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Audio/AudioTranslationRequest.cs#L72
Cannot convert null literal to non-nullable reference type.
|
Build abd test / Build, test and publish:
src/libs/OpenAI/Client/Audio/AudioTranslationRequest.cs#L73
Cannot convert null literal to non-nullable reference type.
|