Skip to content

Fix call id argument validation #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion src/Custom/Chat/ChatToolCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public partial class ChatToolCall
/// <exception cref="ArgumentException"> <paramref name="id"/> or <paramref name="functionName"/> is an empty string, and was expected to be non-empty. </exception>
public static ChatToolCall CreateFunctionToolCall(string id, string functionName, BinaryData functionArguments)
{
Argument.AssertNotNullOrEmpty(id, nameof(id));
Argument.AssertNotNull(id, nameof(id));
Argument.AssertNotNullOrEmpty(functionName, nameof(functionName));
Argument.AssertNotNull(functionArguments, nameof(functionArguments));

Expand Down
6 changes: 3 additions & 3 deletions src/Custom/Chat/Messages/ToolChatMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public partial class ToolChatMessage : ChatMessage
public ToolChatMessage(string toolCallId, IEnumerable<ChatMessageContentPart> contentParts)
: base(ChatMessageRole.Tool, contentParts)
{
Argument.AssertNotNullOrEmpty(toolCallId, nameof(toolCallId));
Argument.AssertNotNull(toolCallId, nameof(toolCallId));
Argument.AssertNotNullOrEmpty(contentParts, nameof(contentParts));

ToolCallId = toolCallId;
Expand All @@ -56,7 +56,7 @@ public ToolChatMessage(string toolCallId, IEnumerable<ChatMessageContentPart> co
public ToolChatMessage(string toolCallId, params ChatMessageContentPart[] contentParts)
: base(ChatMessageRole.Tool, contentParts)
{
Argument.AssertNotNullOrEmpty(toolCallId, nameof(toolCallId));
Argument.AssertNotNull(toolCallId, nameof(toolCallId));
Argument.AssertNotNullOrEmpty(contentParts, nameof(contentParts));

ToolCallId = toolCallId;
Expand All @@ -72,7 +72,7 @@ public ToolChatMessage(string toolCallId, params ChatMessageContentPart[] conten
public ToolChatMessage(string toolCallId, string content)
: base(ChatMessageRole.Tool, content)
{
Argument.AssertNotNullOrEmpty(toolCallId, nameof(toolCallId));
Argument.AssertNotNull(toolCallId, nameof(toolCallId));
Argument.AssertNotNull(content, nameof(content));

ToolCallId = toolCallId;
Expand Down