Add request options bag to high level requests and include Meta (#970)
Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
627de76ca6
commit
c447973972
2 changed files with 882 additions and 164 deletions
|
|
@ -75,7 +75,7 @@ builder.Services
|
|||
new ChatMessage(ChatRole.System, "You are a helpful test server"),
|
||||
new ChatMessage(ChatRole.User, $"Resource {uri}, context: A new subscription was started"),
|
||||
],
|
||||
options: new ChatOptions
|
||||
chatOptions: new ChatOptions
|
||||
{
|
||||
MaxOutputTokens = 100,
|
||||
Temperature = 0.7f,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class SampleLlmTool
|
|||
CancellationToken cancellationToken)
|
||||
{
|
||||
var samplingParams = CreateRequestSamplingParams(prompt ?? string.Empty, "sampleLLM", maxTokens);
|
||||
var sampleResult = await server.SampleAsync(samplingParams, cancellationToken);
|
||||
var sampleResult = await server.SampleAsync(samplingParams, cancellationToken: cancellationToken);
|
||||
|
||||
return $"LLM sampling result: {sampleResult.Content.OfType<TextContentBlock>().FirstOrDefault()?.Text}";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue