autogen/dotnet/test/AutoGen.SourceGenerator.Tests/ApprovalTests/FunctionCallTemplateTests.TestFunctionCallTemplate.approved.txt
Xiaoyun Zhang e1afff20f6
[.Net] Fix #2687 by adding global:: keyword in generated code (#2689)
* add tests

* remove approved file

* update

* update approve file
2024-05-15 16:58:51 +00:00

72 lines
2.1 KiB
Plaintext

//----------------------
// <auto-generated>
// This code was generated by a tool.
// </auto-generated>
//----------------------
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using System;
using AutoGen.Core;
using AutoGen.OpenAI.Extension;
namespace AutoGen.SourceGenerator.Tests
{
public partial class FunctionExamples
{
private class AddAsyncSchema
{
[JsonPropertyName(@"a")]
public System.Int32 a {get; set;}
[JsonPropertyName(@"b")]
public System.Int32 b {get; set;}
}
public System.Threading.Tasks.Task`1[System.String] AddAsyncWrapper(string arguments)
{
var schema = JsonSerializer.Deserialize<AddAsyncSchema>(
arguments,
new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
});
return AddAsync(schema.a, schema.b);
}
public FunctionContract AddAsyncFunctionContract
{
get => new FunctionContract
{
Name = @"AddAsync",
Description = @"Add two numbers.",
ReturnType = typeof(System.Threading.Tasks.Task`1[System.String]),
Parameters = new []
{
new FunctionParameterContract
{
Name = @"a",
Description = @"The first number.",
ParameterType = typeof(System.Int32),
IsRequired = true,
},
new FunctionParameterContract
{
Name = @"b",
Description = @"The second number.",
ParameterType = typeof(System.Int32),
IsRequired = true,
},
},
};
}
public global::Azure.AI.OpenAI.FunctionDefinition AddAsyncFunction
{
get => this.AddAsyncFunctionContract.ToOpenAIFunctionDefinition();
}
}
}