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
8 changes: 7 additions & 1 deletion src/Cnblogs.DashScope.Core/BatchGetEmbeddingsParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
public class BatchGetEmbeddingsParameters : IBatchGetEmbeddingsParameters
{
/// <summary>
/// Text type of input. Use <see cref="TextTypes"/> to get available options. Defaults to 'document'.
/// Text type of input(ignored by v3). Use <see cref="TextTypes"/> to get available options. Defaults to 'document'.
/// </summary>
public string? TextType { get; set; }

/// <inheritdoc />
public int? Dimension { get; set; }

/// <inheritdoc />
public string? OutputType { get; set; }
}
10 changes: 10 additions & 0 deletions src/Cnblogs.DashScope.Core/ITextEmbeddingParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ public interface ITextEmbeddingParameters
/// The text type("query" or "document"). Defaults to "document".
/// </summary>
public string? TextType { get; }

/// <summary>
/// The dimension of output vector(v3 only), possible values: 1024, 768, 512.
/// </summary>
public int? Dimension { get; set; }

/// <summary>
/// Dense or sparse of output vector(v3 only), possible values are: sparse, dense, dense&amp;sparse.
/// </summary>
public string? OutputType { get; set; }
}
6 changes: 6 additions & 0 deletions src/Cnblogs.DashScope.Core/TextEmbeddingParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ public class TextEmbeddingParameters : ITextEmbeddingParameters
{
/// <inheritdoc />
public string? TextType { get; set; }

/// <inheritdoc />
public int? Dimension { get; set; }

/// <inheritdoc />
public string? OutputType { get; set; }
}
12 changes: 11 additions & 1 deletion src/Cnblogs.DashScope.Sdk/QWen/QWenLlm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,15 @@ public enum QWenLlm
/// <summary>
/// qwen-long, input limit 10,000,000 token
/// </summary>
QWenLong = 14
QWenLong = 14,

/// <summary>
/// qwen-coder-turbo
/// </summary>
QWenCoder = 15,

/// <summary>
/// qwen-math-plus
/// </summary>
QWenMath = 16
}
2 changes: 2 additions & 0 deletions src/Cnblogs.DashScope.Sdk/QWen/QWenLlmNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public static string GetModelName(this QWenLlm llm)
QWenLlm.QWen1_8BLongContextChat => "qwen-1.8b-longcontext-chat",
QWenLlm.QWen1_8Chat => "qwen-1.8b-chat",
QWenLlm.QWenLong => "qwen-long",
QWenLlm.QWenCoder => "qwen-coder-turbo",
QWenLlm.QWenMath => "qwen-math-plus",
_ => ThrowHelper.UnknownModelName(nameof(llm), llm)
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ public enum TextEmbeddingModel
/// <summary>
/// text-embedding-v2
/// </summary>
TextEmbeddingV2 = 2
TextEmbeddingV2 = 2,

/// <summary>
/// text-embedding-v3
/// </summary>
TextEmbeddingV3 = 3,
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public static string GetModelName(this TextEmbeddingModel model)
{
TextEmbeddingModel.TextEmbeddingV1 => "text-embedding-v1",
TextEmbeddingModel.TextEmbeddingV2 => "text-embedding-v2",
TextEmbeddingModel.TextEmbeddingV3 => "text-embedding-v3",
_ => ThrowHelper.UnknownModelName(nameof(model), model)
};
}
Expand Down