You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

FunctionCallTemplateTests.TestFunctionCallTemplate.approved.txt 2.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //----------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // </auto-generated>
  5. //----------------------
  6. using System.Text.Json;
  7. using System.Text.Json.Serialization;
  8. using System.Threading.Tasks;
  9. using System;
  10. using AutoGen.Core;
  11. using AutoGen.OpenAI.Extension;
  12. namespace AutoGen.SourceGenerator.Tests
  13. {
  14. public partial class FunctionExamples
  15. {
  16. private class AddAsyncSchema
  17. {
  18. [JsonPropertyName(@"a")]
  19. public System.Int32 a {get; set;}
  20. [JsonPropertyName(@"b")]
  21. public System.Int32 b {get; set;}
  22. }
  23. public System.Threading.Tasks.Task`1[System.String] AddAsyncWrapper(string arguments)
  24. {
  25. var schema = JsonSerializer.Deserialize<AddAsyncSchema>(
  26. arguments,
  27. new JsonSerializerOptions
  28. {
  29. PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
  30. });
  31. return AddAsync(schema.a, schema.b);
  32. }
  33. public FunctionContract AddAsyncFunctionContract
  34. {
  35. get => new FunctionContract
  36. {
  37. Name = @"AddAsync",
  38. Description = @"Add two numbers.",
  39. ReturnType = typeof(System.Threading.Tasks.Task`1[System.String]),
  40. Parameters = new global::AutoGen.Core.FunctionParameterContract[]
  41. {
  42. new FunctionParameterContract
  43. {
  44. Name = @"a",
  45. Description = @"The first number.",
  46. ParameterType = typeof(System.Int32),
  47. IsRequired = true,
  48. },
  49. new FunctionParameterContract
  50. {
  51. Name = @"b",
  52. Description = @"The second number.",
  53. ParameterType = typeof(System.Int32),
  54. IsRequired = true,
  55. },
  56. },
  57. };
  58. }
  59. public global::Azure.AI.OpenAI.FunctionDefinition AddAsyncFunction
  60. {
  61. get => this.AddAsyncFunctionContract.ToOpenAIFunctionDefinition();
  62. }
  63. }
  64. }