Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ partial void ProcessChatv2ResponseContent(
/// Defaults to `0.0`, min value of `0.0`, max value of `1.0`.<br/>
/// Used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.
/// </param>
/// <param name="reasoningEffort">
/// The reasoning effort level of the model. This affects the model's performance and the time it takes to generate a response.
/// </param>
/// <param name="responseFormat">
/// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models.<br/>
/// The model can be forced into outputting JSON objects by setting `{ "type": "json_object" }`.<br/>
Expand Down Expand Up @@ -623,6 +626,7 @@ partial void ProcessChatv2ResponseContent(
int? maxTokens = default,
float? p = default,
float? presencePenalty = default,
global::Cohere.ReasoningEffort? reasoningEffort = default,
global::Cohere.ResponseFormatV2? responseFormat = default,
global::Cohere.Chatv2RequestSafetyMode? safetyMode = default,
int? seed = default,
Expand All @@ -646,6 +650,7 @@ partial void ProcessChatv2ResponseContent(
Model = model,
P = p,
PresencePenalty = presencePenalty,
ReasoningEffort = reasoningEffort,
ResponseFormat = responseFormat,
SafetyMode = safetyMode,
Seed = seed,
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public partial interface ICohereClient
/// Defaults to `0.0`, min value of `0.0`, max value of `1.0`.<br/>
/// Used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.
/// </param>
/// <param name="reasoningEffort">
/// The reasoning effort level of the model. This affects the model's performance and the time it takes to generate a response.
/// </param>
/// <param name="responseFormat">
/// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models.<br/>
/// The model can be forced into outputting JSON objects by setting `{ "type": "json_object" }`.<br/>
Expand Down Expand Up @@ -126,6 +129,7 @@ public partial interface ICohereClient
int? maxTokens = default,
float? p = default,
float? presencePenalty = default,
global::Cohere.ReasoningEffort? reasoningEffort = default,
global::Cohere.ResponseFormatV2? responseFormat = default,
global::Cohere.Chatv2RequestSafetyMode? safetyMode = default,
int? seed = default,
Expand Down
12 changes: 12 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ public sealed partial class Chatv2Request
[global::System.Text.Json.Serialization.JsonPropertyName("presence_penalty")]
public float? PresencePenalty { get; set; }

/// <summary>
/// The reasoning effort level of the model. This affects the model's performance and the time it takes to generate a response.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("reasoning_effort")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.ReasoningEffortJsonConverter))]
public global::Cohere.ReasoningEffort? ReasoningEffort { get; set; }

/// <summary>
/// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models.<br/>
/// The model can be forced into outputting JSON objects by setting `{ "type": "json_object" }`.<br/>
Expand Down Expand Up @@ -207,6 +214,9 @@ public sealed partial class Chatv2Request
/// Defaults to `0.0`, min value of `0.0`, max value of `1.0`.<br/>
/// Used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.
/// </param>
/// <param name="reasoningEffort">
/// The reasoning effort level of the model. This affects the model's performance and the time it takes to generate a response.
/// </param>
/// <param name="responseFormat">
/// Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models.<br/>
/// The model can be forced into outputting JSON objects by setting `{ "type": "json_object" }`.<br/>
Expand Down Expand Up @@ -271,6 +281,7 @@ public Chatv2Request(
int? maxTokens,
float? p,
float? presencePenalty,
global::Cohere.ReasoningEffort? reasoningEffort,
global::Cohere.ResponseFormatV2? responseFormat,
global::Cohere.Chatv2RequestSafetyMode? safetyMode,
int? seed,
Expand All @@ -291,6 +302,7 @@ public Chatv2Request(
this.MaxTokens = maxTokens;
this.P = p;
this.PresencePenalty = presencePenalty;
this.ReasoningEffort = reasoningEffort;
this.ResponseFormat = responseFormat;
this.SafetyMode = safetyMode;
this.Seed = seed;
Expand Down
57 changes: 57 additions & 0 deletions src/libs/Cohere/Generated/Cohere.Models.ReasoningEffort.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

#nullable enable

namespace Cohere
{
/// <summary>
/// The reasoning effort level of the model. This affects the model's performance and the time it takes to generate a response.
/// </summary>
public enum ReasoningEffort
{
/// <summary>
///
/// </summary>
Low,
/// <summary>
///
/// </summary>
Medium,
/// <summary>
///
/// </summary>
High,
}

/// <summary>
/// Enum extensions to do fast conversions without the reflection.
/// </summary>
public static class ReasoningEffortExtensions
{
/// <summary>
/// Converts an enum to a string.
/// </summary>
public static string ToValueString(this ReasoningEffort value)
{
return value switch
{
ReasoningEffort.Low => "low",
ReasoningEffort.Medium => "medium",
ReasoningEffort.High => "high",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
/// <summary>
/// Converts an string to a enum.
/// </summary>
public static ReasoningEffort? ToEnum(string value)
{
return value switch
{
"low" => ReasoningEffort.Low,
"medium" => ReasoningEffort.Medium,
"high" => ReasoningEffort.High,
_ => null,
};
}
}
}
49 changes: 49 additions & 0 deletions src/libs/Cohere/Generated/JsonConverters.ReasoningEffort.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

namespace Cohere.JsonConverters
{
/// <inheritdoc />
public sealed class ReasoningEffortJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.ReasoningEffort>
{
/// <inheritdoc />
public override global::Cohere.ReasoningEffort Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Cohere.ReasoningEffortExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Cohere.ReasoningEffort)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Cohere.ReasoningEffort value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Cohere.ReasoningEffortExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#nullable enable

namespace Cohere.JsonConverters
{
/// <inheritdoc />
public sealed class ReasoningEffortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Cohere.ReasoningEffort?>
{
/// <inheritdoc />
public override global::Cohere.ReasoningEffort? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Cohere.ReasoningEffortExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Cohere.ReasoningEffort)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Cohere.ReasoningEffort? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Cohere.ReasoningEffortExtensions.ToValueString(value.Value));
}
}
}
}
2 changes: 2 additions & 0 deletions src/libs/Cohere/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ namespace Cohere
typeof(global::Cohere.JsonConverters.ResponseFormatTypeNullableJsonConverter),
typeof(global::Cohere.JsonConverters.ResponseFormatTypeV2JsonConverter),
typeof(global::Cohere.JsonConverters.ResponseFormatTypeV2NullableJsonConverter),
typeof(global::Cohere.JsonConverters.ReasoningEffortJsonConverter),
typeof(global::Cohere.JsonConverters.ReasoningEffortNullableJsonConverter),
typeof(global::Cohere.JsonConverters.ResponseFormatDiscriminatorTypeJsonConverter),
typeof(global::Cohere.JsonConverters.ResponseFormatDiscriminatorTypeNullableJsonConverter),
typeof(global::Cohere.JsonConverters.ResponseFormatV2DiscriminatorTypeJsonConverter),
Expand Down
Loading