autogen/dotnet/test/AutoGen.Gemini.Tests/FunctionContractExtensionTests.cs
Xiaoyun Zhang a16b307dc0
[.Net] Add Goolge gemini (#2868)
* 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
2024-06-10 17:31:45 +00:00

28 lines
840 B
C#

// Copyright (c) Microsoft Corporation. All rights reserved.
// FunctionContractExtensionTests.cs
using ApprovalTests;
using ApprovalTests.Namers;
using ApprovalTests.Reporters;
using AutoGen.Gemini.Extension;
using Google.Protobuf;
using Xunit;
namespace AutoGen.Gemini.Tests;
public class FunctionContractExtensionTests
{
private readonly Functions functions = new Functions();
[Fact]
[UseReporter(typeof(DiffReporter))]
[UseApprovalSubdirectory("ApprovalTests")]
public void ItGenerateGetWeatherToolTest()
{
var contract = functions.GetWeatherAsyncFunctionContract;
var tool = contract.ToFunctionDeclaration();
var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithIndentation(" "));
var json = formatter.Format(tool);
Approvals.Verify(json);
}
}