File: Mistral_7B_Instruct_9f94620e-aef2-4025-bb54-c9bfc2a5fe1e.generated.cs
Project: src\docs\samples\Microsoft.ML.GenAI.Samples\Microsoft.ML.GenAI.Samples.csproj (Microsoft.ML.GenAI.Samples)
//----------------------
// <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;
 
namespace Microsoft.ML.GenAI.Samples.Mistral
{
    public partial class Mistral_7B_Instruct
    {
 
        private class GetWeatherSchema
        {
            [JsonPropertyName(@"city")]
			public string city {get; set;}
        }
 
        public Task<string> GetWeatherWrapper(string arguments)
        {
            var schema = JsonSerializer.Deserialize<GetWeatherSchema>(
                arguments, 
                new JsonSerializerOptions
                {
                    PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
                });
 
            return GetWeather(schema.city);
        }
 
        public FunctionContract GetWeatherFunctionContract
        {
            get => new FunctionContract
            {
                Namespace = @"Microsoft.ML.GenAI.Samples.Mistral",
                ClassName = @"Mistral_7B_Instruct",
                Name = @"GetWeather",
                Description = @"get weather from city",
                ReturnType = typeof(Task<string>),
                Parameters = new global::AutoGen.Core.FunctionParameterContract[]
                {
                    new FunctionParameterContract
                    {
                        Name = @"city",
                        Description = @"city. type is string",
                        ParameterType = typeof(string),
                        IsRequired = true,
                    },
                },
            };
        }
    }
}