Skip to content

Commit b02b864

Browse files
authored
Fix call id argument validation (#429)
Fixes #428
1 parent 64d30f1 commit b02b864

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Custom/Chat/ChatToolCall.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public partial class ChatToolCall
5050
/// <exception cref="ArgumentException"> <paramref name="id"/> or <paramref name="functionName"/> is an empty string, and was expected to be non-empty. </exception>
5151
public static ChatToolCall CreateFunctionToolCall(string id, string functionName, BinaryData functionArguments)
5252
{
53-
Argument.AssertNotNullOrEmpty(id, nameof(id));
53+
Argument.AssertNotNull(id, nameof(id));
5454
Argument.AssertNotNullOrEmpty(functionName, nameof(functionName));
5555
Argument.AssertNotNull(functionArguments, nameof(functionArguments));
5656

src/Custom/Chat/Messages/ToolChatMessage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public partial class ToolChatMessage : ChatMessage
3737
public ToolChatMessage(string toolCallId, IEnumerable<ChatMessageContentPart> contentParts)
3838
: base(ChatMessageRole.Tool, contentParts)
3939
{
40-
Argument.AssertNotNullOrEmpty(toolCallId, nameof(toolCallId));
40+
Argument.AssertNotNull(toolCallId, nameof(toolCallId));
4141
Argument.AssertNotNullOrEmpty(contentParts, nameof(contentParts));
4242

4343
ToolCallId = toolCallId;
@@ -56,7 +56,7 @@ public ToolChatMessage(string toolCallId, IEnumerable<ChatMessageContentPart> co
5656
public ToolChatMessage(string toolCallId, params ChatMessageContentPart[] contentParts)
5757
: base(ChatMessageRole.Tool, contentParts)
5858
{
59-
Argument.AssertNotNullOrEmpty(toolCallId, nameof(toolCallId));
59+
Argument.AssertNotNull(toolCallId, nameof(toolCallId));
6060
Argument.AssertNotNullOrEmpty(contentParts, nameof(contentParts));
6161

6262
ToolCallId = toolCallId;
@@ -72,7 +72,7 @@ public ToolChatMessage(string toolCallId, params ChatMessageContentPart[] conten
7272
public ToolChatMessage(string toolCallId, string content)
7373
: base(ChatMessageRole.Tool, content)
7474
{
75-
Argument.AssertNotNullOrEmpty(toolCallId, nameof(toolCallId));
75+
Argument.AssertNotNull(toolCallId, nameof(toolCallId));
7676
Argument.AssertNotNull(content, nameof(content));
7777

7878
ToolCallId = toolCallId;

0 commit comments

Comments
 (0)