Skip to content
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

feat:Title: Update documentation for API endpoints and usage examples #59

Merged
merged 1 commit into from
Sep 25, 2024
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
2 changes: 1 addition & 1 deletion src/libs/Cohere/Generated/Cohere.CohereApi.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ partial void ProcessChatv2ResponseContent(
/// </param>
/// <param name="safetyMode">
/// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.<br/>
/// When `NONE` is specified, the safety instruction will be omitted.<br/>
/// When `OFF` is specified, the safety instruction will be omitted.<br/>
/// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.<br/>
/// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.<br/>
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Cohere/Generated/Cohere.ICohereApi.Chatv2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public partial interface ICohereApi
/// </param>
/// <param name="safetyMode">
/// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.<br/>
/// When `NONE` is specified, the safety instruction will be omitted.<br/>
/// When `OFF` is specified, the safety instruction will be omitted.<br/>
/// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.<br/>
/// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.<br/>
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public sealed partial class Chatv2Request

/// <summary>
/// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.<br/>
/// When `NONE` is specified, the safety instruction will be omitted.<br/>
/// When `OFF` is specified, the safety instruction will be omitted.<br/>
/// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.<br/>
/// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.<br/>
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Cohere
{
/// <summary>
/// Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.<br/>
/// When `NONE` is specified, the safety instruction will be omitted.<br/>
/// When `OFF` is specified, the safety instruction will be omitted.<br/>
/// Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.<br/>
/// **Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.<br/>
/// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
Expand All @@ -23,7 +23,7 @@ public enum Chatv2RequestSafetyMode
/// <summary>
///
/// </summary>
NONE,
OFF,
}

/// <summary>
Expand All @@ -40,7 +40,7 @@ public static string ToValueString(this Chatv2RequestSafetyMode value)
{
Chatv2RequestSafetyMode.CONTEXTUAL => "CONTEXTUAL",
Chatv2RequestSafetyMode.STRICT => "STRICT",
Chatv2RequestSafetyMode.NONE => "NONE",
Chatv2RequestSafetyMode.OFF => "OFF",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -53,7 +53,7 @@ public static string ToValueString(this Chatv2RequestSafetyMode value)
{
"CONTEXTUAL" => Chatv2RequestSafetyMode.CONTEXTUAL,
"STRICT" => Chatv2RequestSafetyMode.STRICT,
"NONE" => Chatv2RequestSafetyMode.NONE,
"OFF" => Chatv2RequestSafetyMode.OFF,
_ => null,
};
}
Expand Down
5 changes: 2 additions & 3 deletions src/libs/Cohere/Generated/Cohere.Models.ToolMessageV2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ public sealed partial class ToolMessageV2
/// <summary>
/// A single or list of outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("tool_content")]
[global::System.Text.Json.Serialization.JsonPropertyName("content")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Cohere.OneOf<string, global::System.Collections.Generic.IList<global::Cohere.ToolContent>> ToolContent { get; set; }
public global::Cohere.OneOf<string, global::System.Collections.Generic.IList<global::Cohere.ToolContent>>? Content { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
Expand Down
6 changes: 3 additions & 3 deletions src/libs/Cohere/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ paths:
enum:
- CONTEXTUAL
- STRICT
- NONE
description: "Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.\nWhen `NONE` is specified, the safety instruction will be omitted.\n\nSafety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.\n\n**Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"
- OFF
description: "Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.\nWhen `OFF` is specified, the safety instruction will be omitted.\n\nSafety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.\n\n**Note**: This parameter is only compatible with models [Command R 08-2024](/docs/command-r#august-2024-release), [Command R+ 08-2024](/docs/command-r-plus#august-2024-release) and newer.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"
max_tokens:
type: integer
description: "The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations.\n"
Expand Down Expand Up @@ -9957,7 +9957,7 @@ components:
tool_call_id:
type: string
description: The id of the associated tool call that has provided the given content
tool_content:
content:
oneOf:
- type: string
- type: array
Comment on lines +9960 to 9963
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Action Required: Address Remaining 'tool_content' References

The search found instances of 'tool_content' in src/libs/Cohere/openapi.yaml. Please ensure that all occurrences of 'tool_content' are renamed to 'content' to maintain consistency and prevent potential issues.

  • Update src/libs/Cohere/openapi.yaml to replace 'tool_content' with 'content'.
🔗 Analysis chain

LGTM! Verify impact of property renaming and type changes.

The renaming of 'tool_content' to 'content' and the change in type definition improve flexibility and versatility of the API. However, these changes may impact existing implementations.

Please run the following script to check for any occurrences of 'tool_content' in the codebase that might need updating:

Also, ensure that all consumers of this API are updated to handle both string and array types for the 'content' property.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for occurrences of 'tool_content' in the codebase

# Test: Search for 'tool_content' in all files. Expect: No occurrences outside of git history.
rg 'tool_content' --type-add 'yaml:*.{yaml,yml}' --type yaml

Length of output: 112

Expand Down
Loading