diff --git a/src/AnthropicClient/AnthropicApiClient.cs b/src/AnthropicClient/AnthropicApiClient.cs index 7ec3b10..15736f1 100644 --- a/src/AnthropicClient/AnthropicApiClient.cs +++ b/src/AnthropicClient/AnthropicApiClient.cs @@ -275,7 +275,7 @@ public class AnthropicApiClient : IAnthropicApiClient } private async Task SendRequestAsync(BaseMessageRequest request) - { + { var requestJson = Serialize(request); var requestContent = new StringContent(requestJson, Encoding.UTF8, JsonContentType); return await _httpClient.PostAsync(MessagesEndpoint, requestContent); diff --git a/src/AnthropicClient/Models/BaseMessageRequest.cs b/src/AnthropicClient/Models/BaseMessageRequest.cs index 040f743..04ac289 100644 --- a/src/AnthropicClient/Models/BaseMessageRequest.cs +++ b/src/AnthropicClient/Models/BaseMessageRequest.cs @@ -109,7 +109,7 @@ public abstract class BaseMessageRequest [JsonConstructor] internal BaseMessageRequest() { } - + /// /// Initializes a new instance of the class. /// diff --git a/src/AnthropicClient/Models/CacheControl.cs b/src/AnthropicClient/Models/CacheControl.cs index b39e487..28f0898 100644 --- a/src/AnthropicClient/Models/CacheControl.cs +++ b/src/AnthropicClient/Models/CacheControl.cs @@ -6,7 +6,7 @@ namespace AnthropicClient.Models; /// Represents the cache control to be used for content. /// public abstract class CacheControl -{ +{ /// /// Gets the type of the cache control. /// diff --git a/src/AnthropicClient/Models/Content.cs b/src/AnthropicClient/Models/Content.cs index a8aa0dd..efe3bac 100644 --- a/src/AnthropicClient/Models/Content.cs +++ b/src/AnthropicClient/Models/Content.cs @@ -11,7 +11,7 @@ public abstract class Content /// Gets the type of the content. /// public string Type { get; init; } = string.Empty; - + /// /// Gets the cache control to be used for the content. /// diff --git a/src/AnthropicClient/Models/TextContent.cs b/src/AnthropicClient/Models/TextContent.cs index b9827bc..a6751cf 100644 --- a/src/AnthropicClient/Models/TextContent.cs +++ b/src/AnthropicClient/Models/TextContent.cs @@ -47,7 +47,7 @@ public class TextContent : Content public TextContent(string text, CacheControl cacheControl) : base(ContentType.Text, cacheControl) { Validate(text); - + Text = text; } } \ No newline at end of file diff --git a/src/AnthropicClient/Models/Tool.cs b/src/AnthropicClient/Models/Tool.cs index 66243fc..ab527ab 100644 --- a/src/AnthropicClient/Models/Tool.cs +++ b/src/AnthropicClient/Models/Tool.cs @@ -131,9 +131,9 @@ public class Tool /// The created tool as instance of . /// The name of the tool will be sanitized to conform to the Anthropic tool naming rules. public static Tool CreateFromStaticMethod( - string name, - string description, - Type type, + string name, + string description, + Type type, string methodName, CacheControl? cacheControl = null ) @@ -165,9 +165,9 @@ public class Tool /// The created tool as instance of . /// The name of the tool will be sanitized to conform to the Anthropic tool naming rules. public static Tool CreateFromInstanceMethod( - string name, - string description, - object instance, + string name, + string description, + object instance, string methodName, CacheControl? cacheControl = null ) @@ -197,8 +197,8 @@ public class Tool /// The created tool as instance of . /// The name of the tool will be sanitized to conform to the Anthropic tool naming rules. public static Tool CreateFromFunction( - string name, - string description, + string name, + string description, Func func, CacheControl? cacheControl = null ) @@ -221,8 +221,8 @@ public class Tool /// The created tool as instance of . /// The name of the tool will be sanitized to conform to the Anthropic tool naming rules. public static Tool CreateFromFunction( - string name, - string description, + string name, + string description, Func func, CacheControl? cacheControl = null ) @@ -246,8 +246,8 @@ public class Tool /// The created tool as instance of . /// The name of the tool will be sanitized to conform to the Anthropic tool naming rules. public static Tool CreateFromFunction( - string name, - string description, + string name, + string description, Func func, CacheControl? cacheControl = null ) diff --git a/src/AnthropicClient/Models/ToolResultContent.cs b/src/AnthropicClient/Models/ToolResultContent.cs index 634ac87..01312a7 100644 --- a/src/AnthropicClient/Models/ToolResultContent.cs +++ b/src/AnthropicClient/Models/ToolResultContent.cs @@ -44,7 +44,7 @@ public class ToolResultContent : Content Content = content; } - /// + /// /// Initializes a new instance of the class. /// /// The tool use ID of the content. diff --git a/tests/AnthropicClient.Tests/Unit/Models/MessageDeltaEventDataTests.cs b/tests/AnthropicClient.Tests/Unit/Models/MessageDeltaEventDataTests.cs index b164915..b17db66 100644 --- a/tests/AnthropicClient.Tests/Unit/Models/MessageDeltaEventDataTests.cs +++ b/tests/AnthropicClient.Tests/Unit/Models/MessageDeltaEventDataTests.cs @@ -20,9 +20,9 @@ public class MessageDeltaEventDataTests : SerializationTest public void Constructor_WhenCalled_ItShouldInitializeProperties() { var expectedDelta = new MessageDelta("max_tokens", "max_tokens"); - var expectedUsage = new Usage - { - InputTokens = 1, + var expectedUsage = new Usage + { + InputTokens = 1, OutputTokens = 1, CacheCreationInputTokens = 1, CacheReadInputTokens = 1, @@ -38,9 +38,9 @@ public class MessageDeltaEventDataTests : SerializationTest public void JsonSerialization_WhenSerialized_ItShouldHaveExpectedShape() { var expectedDelta = new MessageDelta("max_tokens", "max_tokens"); - var expectedUsage = new Usage - { - InputTokens = 1, + var expectedUsage = new Usage + { + InputTokens = 1, OutputTokens = 1, CacheCreationInputTokens = 1, CacheReadInputTokens = 1, @@ -57,9 +57,9 @@ public class MessageDeltaEventDataTests : SerializationTest public void JsonDeserialization_WhenDeserialized_ItShouldHaveExpectedValues() { var expectedDelta = new MessageDelta("max_tokens", "max_tokens"); - var expectedUsage = new Usage - { - InputTokens = 1, + var expectedUsage = new Usage + { + InputTokens = 1, OutputTokens = 1, CacheCreationInputTokens = 1, CacheReadInputTokens = 1, diff --git a/tests/AnthropicClient.Tests/Unit/Models/MessageRequestTests.cs b/tests/AnthropicClient.Tests/Unit/Models/MessageRequestTests.cs index 6f96c54..2efd402 100644 --- a/tests/AnthropicClient.Tests/Unit/Models/MessageRequestTests.cs +++ b/tests/AnthropicClient.Tests/Unit/Models/MessageRequestTests.cs @@ -408,7 +408,7 @@ public class MessageRequestTests : SerializationTest JsonAssert.Equal(expected, actual); } - [Fact] + [Fact] public void JsonSerialization_WhenSerializedAndSystemMessageIsProvided_ItShouldUseSystemMessageForHaveSystemProperty() { var messageRequest = new MessageRequest(