mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-26 02:11:24 +00:00

* update * add vertex gemini test * remove DTO * add test for vertexGeminiAgent * update test name * update IGeminiClient interface * add test for streaming * add message connector * add gemini message extension * add tests * update * add gemnini sample * update examples * add test for iamge * fix test * add more tests * add streaming message test * add comment * remove unused json * implement google gemini client * update * fix comment
29 lines
782 B
C#
29 lines
782 B
C#
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Functions.cs
|
|
|
|
using AutoGen.Core;
|
|
|
|
namespace AutoGen.Gemini.Tests;
|
|
|
|
public partial class Functions
|
|
{
|
|
/// <summary>
|
|
/// Get weather for a city.
|
|
/// </summary>
|
|
/// <param name="city">city</param>
|
|
/// <returns>weather</returns>
|
|
[Function]
|
|
public async Task<string> GetWeatherAsync(string city)
|
|
{
|
|
return await Task.FromResult($"The weather in {city} is sunny.");
|
|
}
|
|
|
|
[Function]
|
|
public async Task<string> GetMovies(string location, string description)
|
|
{
|
|
var movies = new List<string> { "Barbie", "Spiderman", "Batman" };
|
|
|
|
return await Task.FromResult($"Movies playing in {location} based on {description} are: {string.Join(", ", movies)}");
|
|
}
|
|
}
|