Skip to content

Update to use Microsoft.Extensions.AI.Abstractions#42

Closed
jongalloway wants to merge 1 commit intodotnet:mainfrom
jongalloway:update-ai-abstractions
Closed

Update to use Microsoft.Extensions.AI.Abstractions#42
jongalloway wants to merge 1 commit intodotnet:mainfrom
jongalloway:update-ai-abstractions

Conversation

@jongalloway
Copy link

@jongalloway jongalloway commented Feb 26, 2025

Fixes #38

Replace IInferenceBackend with IChatClient and remove SmartComponents.Inference.OpenAI.

  • Project Files:

    • Add a package reference to Microsoft.Extensions.AI.Abstractions in samples/ExampleBlazorApp/ExampleBlazorApp.csproj and samples/ExampleMvcRazorPagesApp/ExampleMvcRazorPagesApp.csproj.
    • Remove the SmartComponents.Inference.OpenAI project reference from both project files.
  • Program Files:

    • Replace the usage of IInferenceBackend with IChatClient in samples/ExampleBlazorApp/Program.cs and samples/ExampleMvcRazorPagesApp/Program.cs.
    • Remove the WithInferenceBackend<OpenAIInferenceBackend> method call from both program files.
  • ASP.NET Core Files:

    • Replace the usage of IInferenceBackend with IChatClient in src/SmartComponents.AspNetCore/DefaultSmartComponentsBuilder.cs, src/SmartComponents.AspNetCore/ISmartComponentsBuilder.cs, and src/SmartComponents.AspNetCore/SmartComponentsServiceCollectionExtensions.cs.
  • Remove Files:

    • Delete src/SmartComponents.Inference/IInferenceBackend.cs.
    • Delete src/SmartComponents.Inference.OpenAI/ApiConfig.cs, src/SmartComponents.Inference.OpenAI/OpenAIInferenceBackend.cs, src/SmartComponents.Inference.OpenAI/ResponseCache.cs, src/SmartComponents.Inference.OpenAI/SelfHostedLlmTransport.cs, and src/SmartComponents.Inference.OpenAI/SmartComponents.Inference.OpenAI.csproj.

For more details, open the Copilot Workspace session.

Fixes dotnet#38

Replace `IInferenceBackend` with `IChatClient` and remove `SmartComponents.Inference.OpenAI`.

* **Project Files:**
  - Add a package reference to `Microsoft.Extensions.AI.Abstractions` in `samples/ExampleBlazorApp/ExampleBlazorApp.csproj` and `samples/ExampleMvcRazorPagesApp/ExampleMvcRazorPagesApp.csproj`.
  - Remove the `SmartComponents.Inference.OpenAI` project reference from both project files.

* **Program Files:**
  - Replace the usage of `IInferenceBackend` with `IChatClient` in `samples/ExampleBlazorApp/Program.cs` and `samples/ExampleMvcRazorPagesApp/Program.cs`.
  - Remove the `WithInferenceBackend<OpenAIInferenceBackend>` method call from both program files.

* **ASP.NET Core Files:**
  - Replace the usage of `IInferenceBackend` with `IChatClient` in `src/SmartComponents.AspNetCore/DefaultSmartComponentsBuilder.cs`, `src/SmartComponents.AspNetCore/ISmartComponentsBuilder.cs`, and `src/SmartComponents.AspNetCore/SmartComponentsServiceCollectionExtensions.cs`.

* **Remove Files:**
  - Delete `src/SmartComponents.Inference/IInferenceBackend.cs`.
  - Delete `src/SmartComponents.Inference.OpenAI/ApiConfig.cs`, `src/SmartComponents.Inference.OpenAI/OpenAIInferenceBackend.cs`, `src/SmartComponents.Inference.OpenAI/ResponseCache.cs`, `src/SmartComponents.Inference.OpenAI/SelfHostedLlmTransport.cs`, and `src/SmartComponents.Inference.OpenAI/SmartComponents.Inference.OpenAI.csproj`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/dotnet/smartcomponents/issues/38?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to use Microsoft.Extensions.AI.Abstractions

1 participant