Skip to content

Commit b3def90

Browse files
Copilotdavidfowlaaronpowell
authored
Fix OllamaSharp README documentation errors (#805)
* Initial plan * Fix OllamaSharp README documentation errors Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Aaron Powell <me@aaron-powell.com>
1 parent dec3143 commit b3def90

File tree

1 file changed

+6
-6
lines changed
  • src/CommunityToolkit.Aspire.OllamaSharp

1 file changed

+6
-6
lines changed

src/CommunityToolkit.Aspire.OllamaSharp/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CommunityToolkit.Aspire.OllamaSharp library
22

3-
Registers `IOllamaClientApi` in the DI container to interact with the [Ollama](https://ollama.com) API and optionally supports registering an `IChatClient` or `IEmbeddingGenerator` from [Microsoft.Extensions.AI](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/).
3+
Registers `IOllamaApiClient` in the DI container to interact with the [Ollama](https://ollama.com) API and optionally supports registering an `IChatClient` or `IEmbeddingGenerator` from [Microsoft.Extensions.AI](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/).
44

55
## Getting Started
66

@@ -18,24 +18,24 @@ dotnet add package CommunityToolkit.Aspire.OllamaSharp
1818

1919
### Example usage
2020

21-
In the _Program.cs_ file of your project, call the `AddOllamaClientApi` extension method to register the `IOllamaClientApi` in the DI container. This method takes the connection name as a parameter:
21+
In the _Program.cs_ file of your project, call the `AddOllamaApiClient` extension method to register the `IOllamaApiClient` in the DI container. This method takes the connection name as a parameter:
2222

2323
```csharp
24-
builder.AddOllamaClientApi("ollama");
24+
builder.AddOllamaApiClient("ollama");
2525
```
2626

27-
Then, in your service, inject `IOllamaClientApi` and use it to interact with the Ollama API:
27+
Then, in your service, inject `IOllamaApiClient` and use it to interact with the Ollama API:
2828

2929
```csharp
30-
public class MyService(IOllamaClientApi ollamaClientApi)
30+
public class MyService(IOllamaApiClient ollamaApiClient)
3131
{
3232
// ...
3333
}
3434
```
3535

3636
#### Integration with Microsoft.Extensions.AI
3737

38-
To use the integration with Microsoft.Extensions.AI, call the `AddOllamaSharpChatClient` or `AddOllamaSharpEmbeddingGenerator` extension method in the _Program.cs_ file of your project. These methods take the connection name as a parameter, just as `AddOllamaClientApi` does, and will register the `IOllamaApiClient`, as well as the `IChatClient` or `IEmbeddingGenerator` in the DI container. The `IEmbeddingsGenerator` is registered with the generic arguments of `<string, Embedding<float>>`.
38+
To use the integration with Microsoft.Extensions.AI, call the `AddOllamaSharpChatClient` or `AddOllamaSharpEmbeddingGenerator` extension method in the _Program.cs_ file of your project. These methods take the connection name as a parameter, just as `AddOllamaApiClient` does, and will register the `IOllamaApiClient`, as well as the `IChatClient` or `IEmbeddingGenerator` in the DI container. The `IEmbeddingsGenerator` is registered with the generic arguments of `<string, Embedding<float>>`.
3939

4040
## Additional documentation
4141

0 commit comments

Comments
 (0)