diff --git a/src/AnthropicClient/Utils/ArgumentValidator.cs b/src/AnthropicClient/Utils/ArgumentValidator.cs
index fc494d9..375d6f8 100644
--- a/src/AnthropicClient/Utils/ArgumentValidator.cs
+++ b/src/AnthropicClient/Utils/ArgumentValidator.cs
@@ -20,4 +20,19 @@ public static class ArgumentValidator
throw new ArgumentNullException(name);
}
}
+
+ ///
+ /// Throws an if the value is null or empty.
+ ///
+ /// The value to check.
+ /// The name of the value.
+ /// Thrown when the value is null or empty.
+ /// Nothing.
+ public static void ThrowIfNullOrWhitespace(string value, string name)
+ {
+ if (string.IsNullOrWhiteSpace(value))
+ {
+ throw new ArgumentException("Value cannot be null or empty.", name);
+ }
+ }
}
\ No newline at end of file