-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Description
Related to an existing integration?
Yes
Existing integration
CommunityToolkit.Aspire.OllamaSharp
Overview
When making calls to Ollama using extended thinking or larger prompts, the chance a single request will take longer than 10s which will trigger Aspire's default resilience handlers.
for example:
routes.MapGet("/", static ([FromKeyedServices("thinking")] IChatClient client) => Results.ServerSentEvents(
client
.GetStreamingResponseAsync([new ChatMessage(ChatRole.User, "Hello, world!")])
.Where(message => string.IsNullOrWhiteSpace(message.Text) is false)
.Select(message => message.Text),
eventType: "message"
));
Usage example
Ollama's AddKeyedOllamaApiClient internally registers a http client, but doesn't expose any way to configure it.
Similar to #1084 I'd like a way to access the HTTP client that's being configured internally.
Perhaps an optional argument can be added at the end of the signature?
Breaking change?
No
Alternatives
The http client is named internally as $"{connectionName}_httpClient" so I can get to it that way, but I don't like relying on internals of the integration.
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels