Skip to content

Commit

Permalink
Fix protocol method sample (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseharriaga authored Mar 15, 2024
1 parent 5da30e9 commit 21bd3c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ BinaryData input = BinaryData.FromString("""
}
""");

ClientResult result = client.CompleteChat(BinaryContent.Create(input));
using BinaryContent content = BinaryContent.Create(input);
ClientResult result = client.CompleteChat(content);
BinaryData output = result.GetRawResponse().Content;

using JsonDocument outputAsJson = JsonDocument.Parse(output.ToString());
Expand Down
3 changes: 2 additions & 1 deletion .dotnet/tests/Samples/Chat/Sample04_Protocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public void Sample04_Protocol()
}
""");

ClientResult result = client.CompleteChat(BinaryContent.Create(input));
using BinaryContent content = BinaryContent.Create(input);
ClientResult result = client.CompleteChat(content);
BinaryData output = result.GetRawResponse().Content;

using JsonDocument outputAsJson = JsonDocument.Parse(output.ToString());
Expand Down
3 changes: 2 additions & 1 deletion .dotnet/tests/Samples/Chat/Sample04_ProtocolAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public async Task Sample04_ProtocolAsync()
}
""");

ClientResult result = await client.CompleteChatAsync(BinaryContent.Create(input));
using BinaryContent content = BinaryContent.Create(input);
ClientResult result = await client.CompleteChatAsync(content);
BinaryData output = result.GetRawResponse().Content;

using JsonDocument outputAsJson = JsonDocument.Parse(output.ToString());
Expand Down

0 comments on commit 21bd3c9

Please sign in to comment.