Когда он достигает «aiChatService.GetStreamingChatMessageContentsAsync(chatHistory)» -> 404.
Я пытался переустановить службу и соответствующий AI, но ничего не помогло. есть идеи??
Код: Выделить всё
`
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using var httpClient = new HttpClient()
{
BaseAddress = new Uri("http://localhost:11434"),
};
// Create a kernel with OpenAI chat completion
#pragma warning disable SKEXP0010
Kernel kernel = Kernel.CreateBuilder()
.AddOpenAIChatCompletion(
modelId: "phi3:3.8b",
httpClient: httpClient,
apiKey: "non required")
.Build();
var aiChatService = kernel.GetRequiredService();
var chatHistory = new ChatHistory([new ChatMessageContent(AuthorRole.System, "Sos un asistente de programación de C#")]); ;
while (true)
{
// Get user prompt and add to chat history
Console.WriteLine("Your prompt:");
var userPrompt = Console.ReadLine();
chatHistory.Add(new ChatMessageContent(AuthorRole.User, userPrompt));
// Stream the AI response and add to chat history
Console.WriteLine("AI Response:");
var response = "";
await foreach (var item in
aiChatService.GetStreamingChatMessageContentsAsync(chatHistory))
{
Console.Write(item.Content);
response += item.Content;
}
chatHistory.Add(new ChatMessageContent(AuthorRole.Assistant, response));
Console.WriteLine();
}`
System.ClientModel.ClientResultException: 'Ошибка запроса на обслуживание.
Статус: 404 (Не найден)
Подробнее здесь: https://stackoverflow.com/questions/791 ... llama-phi3