Xiaoyun Zhang 9ba14ee15b
Fix dotnet test and reformat dotnet code (#3603)
* fix test

* install aspire workload

* format

* fix build error

* fix format

* format
2024-10-02 14:42:27 -04:00

33 lines
897 B
C#

// Copyright (c) Microsoft Corporation. All rights reserved.
// Chat_With_LLaMA.cs
#region Using
using AutoGen.Core;
using AutoGen.Ollama.Extension;
#endregion Using
namespace AutoGen.Ollama.Sample;
public class Chat_With_LLaMA
{
public static async Task RunAsync()
{
#region Create_Ollama_Agent
using var httpClient = new HttpClient()
{
BaseAddress = new Uri("http://localhost:11434"),
};
var ollamaAgent = new OllamaAgent(
httpClient: httpClient,
name: "ollama",
modelName: "llama3:latest",
systemMessage: "You are a helpful AI assistant")
.RegisterMessageConnector()
.RegisterPrintMessage();
var reply = await ollamaAgent.SendAsync("Can you write a piece of C# code to calculate 100th of fibonacci?");
#endregion Create_Ollama_Agent
}
}