Оно живое

This commit is contained in:
Mikhail Shahovalov
2025-05-09 15:16:06 +03:00
parent b6e05f8705
commit 0aa0e59710
5 changed files with 62 additions and 2 deletions

View File

@@ -1,3 +1,23 @@
// See https://aka.ms/new-console-template for more information
using OpenAI.Chat;
using OpenAI.RealtimeConversation;
using YandexGPT.CLI.Services;
Console.WriteLine("Let's start!");
var service = new YandexGptService();
var client = service.CreateClient();
var chat = client.GetChatClient("gpt://b1gg9b7e74q248tvan7f/yandexgpt/latest");
var query = Console.ReadLine();;
while (query is not ("exit" and "quit"))
{
var message = ChatMessage.CreateUserMessage(query);
var response = chat.CompleteChat(message);
foreach (var row in response.Value.Content)
{
Console.WriteLine(row.Text);
}
query = Console.ReadLine();
}
Console.WriteLine("Hello, World!");