chore: run dotnet format

This commit is contained in:
Stevan Freeborn
2024-08-18 14:59:47 -05:00
parent c2fa796bd0
commit afe70a9012
9 changed files with 28 additions and 28 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ public class AnthropicApiClient : IAnthropicApiClient
}
private async Task<HttpResponseMessage> SendRequestAsync(BaseMessageRequest request)
{
{
var requestJson = Serialize(request);
var requestContent = new StringContent(requestJson, Encoding.UTF8, JsonContentType);
return await _httpClient.PostAsync(MessagesEndpoint, requestContent);
@@ -109,7 +109,7 @@ public abstract class BaseMessageRequest
[JsonConstructor]
internal BaseMessageRequest() { }
/// <summary>
/// Initializes a new instance of the <see cref="BaseMessageRequest"/> class.
/// </summary>
+1 -1
View File
@@ -6,7 +6,7 @@ namespace AnthropicClient.Models;
/// Represents the cache control to be used for content.
/// </summary>
public abstract class CacheControl
{
{
/// <summary>
/// Gets the type of the cache control.
/// </summary>
+1 -1
View File
@@ -11,7 +11,7 @@ public abstract class Content
/// Gets the type of the content.
/// </summary>
public string Type { get; init; } = string.Empty;
/// <summary>
/// Gets the cache control to be used for the content.
/// </summary>
+1 -1
View File
@@ -47,7 +47,7 @@ public class TextContent : Content
public TextContent(string text, CacheControl cacheControl) : base(ContentType.Text, cacheControl)
{
Validate(text);
Text = text;
}
}
+12 -12
View File
@@ -131,9 +131,9 @@ public class Tool
/// <returns>The created tool as instance of <see cref="Tool"/>.</returns>
/// <remarks>The name of the tool will be sanitized to conform to the Anthropic tool naming rules.</remarks>
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
/// <returns>The created tool as instance of <see cref="Tool"/>.</returns>
/// <remarks>The name of the tool will be sanitized to conform to the Anthropic tool naming rules.</remarks>
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
/// <returns>The created tool as instance of <see cref="Tool"/>.</returns>
/// <remarks>The name of the tool will be sanitized to conform to the Anthropic tool naming rules.</remarks>
public static Tool CreateFromFunction<TResult>(
string name,
string description,
string name,
string description,
Func<TResult> func,
CacheControl? cacheControl = null
)
@@ -221,8 +221,8 @@ public class Tool
/// <returns>The created tool as instance of <see cref="Tool"/>.</returns>
/// <remarks>The name of the tool will be sanitized to conform to the Anthropic tool naming rules.</remarks>
public static Tool CreateFromFunction<T1, TResult>(
string name,
string description,
string name,
string description,
Func<T1, TResult> func,
CacheControl? cacheControl = null
)
@@ -246,8 +246,8 @@ public class Tool
/// <returns>The created tool as instance of <see cref="Tool"/>.</returns>
/// <remarks>The name of the tool will be sanitized to conform to the Anthropic tool naming rules.</remarks>
public static Tool CreateFromFunction<T1, T2, TResult>(
string name,
string description,
string name,
string description,
Func<T1, T2, TResult> func,
CacheControl? cacheControl = null
)
@@ -44,7 +44,7 @@ public class ToolResultContent : Content
Content = content;
}
/// <summary>
/// <summary>
/// Initializes a new instance of the <see cref="ToolResultContent"/> class.
/// </summary>
/// <param name="toolUseId">The tool use ID of the content.</param>
@@ -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,
@@ -408,7 +408,7 @@ public class MessageRequestTests : SerializationTest
JsonAssert.Equal(expected, actual);
}
[Fact]
[Fact]
public void JsonSerialization_WhenSerializedAndSystemMessageIsProvided_ItShouldUseSystemMessageForHaveSystemProperty()
{
var messageRequest = new MessageRequest(