Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions tests/Chat/ChatClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,9 @@ public void SerializeChatFunctionChoiceAsObject(bool fromRawJson)
else
{
// We construct a new instance. Later, we serialize it and confirm it was constructed correctly.
#pragma warning disable CS0618
choice = new ChatFunctionChoice(new ChatFunction(functionName));
#pragma warning restore CS0618
}

BinaryData serializedChoice = ModelReaderWriter.Write(choice);
Expand Down
4 changes: 4 additions & 0 deletions tests/Chat/ChatToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public ChatToolTests(bool isAsync)

private const string GetFavoriteColorForMonthFunctionName = "get_favorite_color_for_month";

#pragma warning disable CS0618
private static ChatFunction s_getFavoriteColorForMonthFunction = new ChatFunction(
GetFavoriteColorForMonthToolFunctionName,
"gets the caller's favorite color for a given month",
Expand All @@ -80,6 +81,7 @@ public ChatToolTests(bool isAsync)
}
""")
);
#pragma warning restore CS0618

private const string GetWeatherForCityToolName = "get_weather_for_city";

Expand Down Expand Up @@ -232,7 +234,9 @@ public async Task FunctionsWork()
Assert.That(argumentsJson.ContainsKey("month_name"));
Assert.That(argumentsJson["month_name"].ToString().ToLowerInvariant(), Is.EqualTo("february"));
messages.Add(new AssistantChatMessage(result.Value));
#pragma warning disable CS0618
messages.Add(new FunctionChatMessage(GetFavoriteColorForMonthFunctionName, "chartreuse"));
#pragma warning restore CS0618
result = IsAsync
? await client.CompleteChatAsync(messages, options)
: client.CompleteChat(messages, options);
Expand Down