2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-03-31 18:38:22 +00:00
This commit is contained in:
2026-03-23 06:51:59 +03:00
parent 6321e8f783
commit 4fae21deaf
2 changed files with 63 additions and 4 deletions

View File

@@ -73,7 +73,7 @@ public sealed class LlmRunner
var client = new OpenAIClient(
model.ApiKey,
new OpenAIClientOptions { Endpoint = new Uri(model.Endpoint) });
new OpenAIClientOptions { Endpoint = new Uri(model.Endpoint), });
var chat = client.GetChatClient(model.ModelName);
@@ -188,7 +188,14 @@ public sealed class LlmRunner
new UserChatMessage(prompt)
};
var result = await chat.CompleteChatAsync(messages);
var options = new ChatCompletionOptions
{
MaxOutputTokenCount = 800, // Sets the maximum number of tokens to generate in the response
Temperature = 0.8f,
// Other options like NucleusSamplingFactor (TopP), FrequencyPenalty, etc. can also be set here
};
var result = await chat.CompleteChatAsync(messages, options);
return result.Value.Content[0].Text;
}