Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests to use AsIChatClient
  • Loading branch information
jozkee committed Apr 1, 2025
commit 1c0a8846e73a7541572c9be05a228233f9b82110
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public async Task GetResponseAsync_OpenAIClient_DataContent_AdditionalPropertyDe
string model = "amazingModel";

var client = new OpenAIClient(new ApiKeyCredential("key"), new OpenAIClientOptions { Endpoint = endpoint });
IChatClient chatClient = client.AsChatClient(model);
IChatClient chatClient = client.GetChatClient(model).AsIChatClient();

InvalidOperationException ex = await Assert.ThrowsAsync<InvalidOperationException>(() => chatClient.GetResponseAsync(
[
Expand Down Expand Up @@ -141,14 +141,14 @@ public async Task GetResponseAsync_OpenAIClient_UriContent_AdditionalPropertyDet
string model = "amazingModel";

var client = new OpenAIClient(new ApiKeyCredential("key"), new OpenAIClientOptions { Endpoint = endpoint });
IChatClient chatClient = client.AsChatClient(model);
IChatClient chatClient = client.GetChatClient(model).AsIChatClient();

InvalidOperationException ex = await Assert.ThrowsAsync<InvalidOperationException>(() => chatClient.GetResponseAsync(
[
new(ChatRole.User,
[
new TextContent("What does this logo say?"),
new UriContent("http://my-image.png", "image/png")
new UriContent("http://localhost/my-image.png", "image/png")
{
AdditionalProperties = new()
{
Expand Down
Loading