Skip to content

.NET client for protocol#85

Open
brandonh-msft wants to merge 5 commits intomicrosoft:mainfrom
brandonh-msft:brandonh/dotnet-client
Open

.NET client for protocol#85
brandonh-msft wants to merge 5 commits intomicrosoft:mainfrom
brandonh-msft:brandonh/dotnet-client

Conversation

@brandonh-msft
Copy link

@brandonh-msft brandonh-msft commented Nov 1, 2024

Addresses #62

This pull request introduces a .NET Client library, tests, and sample along with dependency update for those with known vulnerabilities.

Dependency Updates:

  • Updated package references in samples/backend/csharp/ChatProtocolBackend.csproj to newer versions due to vulnerabilities in older ones.
  • Added centralized package version management in sdk/dotnet/Directory.Packages.props.

Client Implementation:

  • Implemented AiChatProtocolClient class in sdk/dotnet/Client/AIChatClient.cs to handle chat completions and file uploads.
  • Created IAiChatProtocolClient interface in sdk/dotnet/Client/Interfaces/IAiChatProtocolClient.cs to define the contract for the chat client.
  • Added AIChatClientOptions record in sdk/dotnet/Client/AIChatClientOptions.cs to configure the chat client.
  • Client implementation directly references the models, protocol, etc. from the backend area of the project. Ideally, this would be refactored into a Protocol library, but I did not do that with this PR to avoid a large change.

Sample

  • Added a sample Console App that shows how to configure & use AiChatProtocolClient object via Dependency Injection standards.

Test Coverage:

  • Added unit tests for AiChatProtocolClient in sdk/dotnet/Tests/Client.Tests/AiChatProtocolClientTests.cs to verify functionality.
  • Created test project configuration in sdk/dotnet/Tests/Client.Tests/Client.Tests.csproj and sdk/dotnet/Tests/Directory.Build.props. [1] [2]

Solution Configuration:

  • Added solution file sdk/dotnet/dotnet.sln to include the client and test projects.

@brandonh-msft brandonh-msft marked this pull request as draft November 1, 2024 18:07
@brandonh-msft brandonh-msft force-pushed the brandonh/dotnet-client branch from d0e013e to 8376fd7 Compare November 1, 2024 21:13
@brandonh-msft brandonh-msft marked this pull request as ready for review November 1, 2024 21:13
@brandonh-msft brandonh-msft force-pushed the brandonh/dotnet-client branch from 8376fd7 to 9c24c46 Compare November 1, 2024 21:16
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.

1 participant