-
-
Notifications
You must be signed in to change notification settings - Fork 0
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:Update documentation comments and method signatures in Cohere API #55
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,8 @@ partial void ProcessEmbedResponseContent( | |
/// </summary> | ||
/// <param name="xClientName"></param> | ||
/// <param name="texts"> | ||
/// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality. | ||
/// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="model"> | ||
/// Defaults to embed-english-v2.0<br/> | ||
|
@@ -127,7 +128,8 @@ partial void ProcessEmbedResponseContent( | |
/// * `embed-multilingual-light-v3.0` 384<br/> | ||
/// * `embed-english-v2.0` 4096<br/> | ||
/// * `embed-english-light-v2.0` 1024<br/> | ||
/// * `embed-multilingual-v2.0` 768 | ||
/// * `embed-multilingual-v2.0` 768<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="inputType"> | ||
/// Specifies the type of input passed to the model. Required for embedding models v3 and higher.<br/> | ||
|
@@ -143,23 +145,25 @@ partial void ProcessEmbedResponseContent( | |
/// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.<br/> | ||
/// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.<br/> | ||
/// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.<br/> | ||
/// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models. | ||
/// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="truncate"> | ||
/// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.<br/> | ||
/// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.<br/> | ||
/// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.<br/> | ||
/// Default Value: END | ||
/// Default Value: END<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::Cohere.OneOf<global::Cohere.EmbedFloatsResponse, global::Cohere.EmbedByTypeResponse>> EmbedAsync( | ||
global::System.Collections.Generic.IList<string> texts, | ||
string model, | ||
global::System.Collections.Generic.IList<global::Cohere.EmbeddingType> embeddingTypes, | ||
global::Cohere.EmbedRequestTruncate truncate, | ||
Comment on lines
+161
to
+164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Method signature changes in The changes to the method signature of
Given the potential impact of these changes, it's crucial to ensure that they are well-documented and communicated to users of the API. Additionally, consider providing a migration path or default options for existing users to ease the transition. |
||
string? xClientName = default, | ||
global::System.Collections.Generic.IList<string>? texts = default, | ||
string? model = default, | ||
global::Cohere.EmbedInputType? inputType = default, | ||
global::System.Collections.Generic.IList<global::Cohere.EmbeddingType>? embeddingTypes = default, | ||
global::Cohere.EmbedRequestTruncate? truncate = global::Cohere.EmbedRequestTruncate.END, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
var request = new global::Cohere.EmbedRequest | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,8 @@ partial void ProcessEmbedv2ResponseContent( | |
/// </summary> | ||
/// <param name="xClientName"></param> | ||
/// <param name="texts"> | ||
/// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality. | ||
/// An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality.<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="model"> | ||
/// Defaults to embed-english-v2.0<br/> | ||
|
@@ -127,7 +128,8 @@ partial void ProcessEmbedv2ResponseContent( | |
/// * `embed-multilingual-light-v3.0` 384<br/> | ||
/// * `embed-english-v2.0` 4096<br/> | ||
/// * `embed-english-light-v2.0` 1024<br/> | ||
/// * `embed-multilingual-v2.0` 768 | ||
/// * `embed-multilingual-v2.0` 768<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="inputType"> | ||
/// Specifies the type of input passed to the model. Required for embedding models v3 and higher.<br/> | ||
|
@@ -143,23 +145,25 @@ partial void ProcessEmbedv2ResponseContent( | |
/// * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.<br/> | ||
/// * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.<br/> | ||
/// * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.<br/> | ||
/// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models. | ||
/// * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models.<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="truncate"> | ||
/// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.<br/> | ||
/// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.<br/> | ||
/// If `NONE` is selected, when the input exceeds the maximum input token length an error will be returned.<br/> | ||
/// Default Value: END | ||
/// Default Value: END<br/> | ||
/// Included only in requests | ||
/// </param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::Cohere.EmbedByTypeResponse> Embedv2Async( | ||
global::System.Collections.Generic.IList<string> texts, | ||
string model, | ||
global::System.Collections.Generic.IList<global::Cohere.EmbeddingType> embeddingTypes, | ||
global::Cohere.Embedv2RequestTruncate truncate, | ||
Comment on lines
+161
to
+164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure backward compatibility with method signature changes The parameters
|
||
string? xClientName = default, | ||
global::System.Collections.Generic.IList<string>? texts = default, | ||
global::Cohere.EmbedInputType? inputType = default, | ||
global::System.Collections.Generic.IList<global::Cohere.EmbeddingType>? embeddingTypes = default, | ||
global::Cohere.Embedv2RequestTruncate? truncate = global::Cohere.Embedv2RequestTruncate.END, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
var request = new global::Cohere.Embedv2Request | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Method Signature Changes Lack Proper Documentation
The changes to the
ClassifyAsync
method signature have not been documented in any of the project's documentation files. This omission may lead to existing clients encountering breaking changes without prior notice.Analysis chain
Verify the Impact of Method Signature Changes
The changes to the method signature, making
examples
,model
,preset
, andtruncate
required, are significant. While these changes enforce stricter API usage, which can improve error handling and predictability, they may also impact existing clients that previously relied on these being optional.It's crucial to ensure that all client implementations are updated to accommodate these changes. Consider providing a migration guide or versioning the API to prevent breaking changes for existing users.
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 39
Script:
Length of output: 797