Skip to content

Allow passing JsonSerializerContext to Ollama #1084

@dealloc

Description

@dealloc

Related to an existing integration?

Yes

Existing integration

CommunityToolkit.Aspire.OllamaSharp

Overview

OllamaSharp's client is AOT compatible if you pass in a JsonSerializerContext with the type information.

However, Aspire's integration does not allow passing this field in making it impossible to use this package in an AOT environment.

Usage example

builder.AddKeyedOllamaApiClient("embedding", settings => settings.JsonSerializerContext = MySerializerContext.Default)
	.AddEmbeddingGenerator();

basically add in the option to pass the JsonSerializerContext

Breaking change?

No

Alternatives

currently no alternatives exist to make AOT possible

Additional context

OllamaSharp's documentation refers to this:
https://awaescher.github.io/OllamaSharp/docs/native-aot-support.html

Help us help you

Yes, I'd like to be assigned to work on this item

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions