Skip to content

Commit

Permalink
Disable warnings in tests due to deprecated types (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseharriaga authored Jun 13, 2024
1 parent 63e50ea commit b1fa082
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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

0 comments on commit b1fa082

Please sign in to comment.