Skip to content

Commit 30b8047

Browse files
authored
Merge pull request #39 from cnblogs/support-new-qwen-model
feat: support new qwen model
2 parents efd8298 + 441d2d4 commit 30b8047

File tree

7 files changed

+43
-3
lines changed

7 files changed

+43
-3
lines changed

src/Cnblogs.DashScope.Core/BatchGetEmbeddingsParameters.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
public class BatchGetEmbeddingsParameters : IBatchGetEmbeddingsParameters
77
{
88
/// <summary>
9-
/// Text type of input. Use <see cref="TextTypes"/> to get available options. Defaults to 'document'.
9+
/// Text type of input(ignored by v3). Use <see cref="TextTypes"/> to get available options. Defaults to 'document'.
1010
/// </summary>
1111
public string? TextType { get; set; }
12+
13+
/// <inheritdoc />
14+
public int? Dimension { get; set; }
15+
16+
/// <inheritdoc />
17+
public string? OutputType { get; set; }
1218
}

src/Cnblogs.DashScope.Core/ITextEmbeddingParameters.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,14 @@ public interface ITextEmbeddingParameters
99
/// The text type("query" or "document"). Defaults to "document".
1010
/// </summary>
1111
public string? TextType { get; }
12+
13+
/// <summary>
14+
/// The dimension of output vector(v3 only), possible values: 1024, 768, 512.
15+
/// </summary>
16+
public int? Dimension { get; set; }
17+
18+
/// <summary>
19+
/// Dense or sparse of output vector(v3 only), possible values are: sparse, dense, dense&amp;sparse.
20+
/// </summary>
21+
public string? OutputType { get; set; }
1222
}

src/Cnblogs.DashScope.Core/TextEmbeddingParameters.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ public class TextEmbeddingParameters : ITextEmbeddingParameters
77
{
88
/// <inheritdoc />
99
public string? TextType { get; set; }
10+
11+
/// <inheritdoc />
12+
public int? Dimension { get; set; }
13+
14+
/// <inheritdoc />
15+
public string? OutputType { get; set; }
1016
}

src/Cnblogs.DashScope.Sdk/QWen/QWenLlm.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,15 @@ public enum QWenLlm
7878
/// <summary>
7979
/// qwen-long, input limit 10,000,000 token
8080
/// </summary>
81-
QWenLong = 14
81+
QWenLong = 14,
82+
83+
/// <summary>
84+
/// qwen-coder-turbo
85+
/// </summary>
86+
QWenCoder = 15,
87+
88+
/// <summary>
89+
/// qwen-math-plus
90+
/// </summary>
91+
QWenMath = 16
8292
}

src/Cnblogs.DashScope.Sdk/QWen/QWenLlmNames.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public static string GetModelName(this QWenLlm llm)
2020
QWenLlm.QWen1_8BLongContextChat => "qwen-1.8b-longcontext-chat",
2121
QWenLlm.QWen1_8Chat => "qwen-1.8b-chat",
2222
QWenLlm.QWenLong => "qwen-long",
23+
QWenLlm.QWenCoder => "qwen-coder-turbo",
24+
QWenLlm.QWenMath => "qwen-math-plus",
2325
_ => ThrowHelper.UnknownModelName(nameof(llm), llm)
2426
};
2527
}

src/Cnblogs.DashScope.Sdk/TextEmbedding/TextEmbeddingModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ public enum TextEmbeddingModel
1313
/// <summary>
1414
/// text-embedding-v2
1515
/// </summary>
16-
TextEmbeddingV2 = 2
16+
TextEmbeddingV2 = 2,
17+
18+
/// <summary>
19+
/// text-embedding-v3
20+
/// </summary>
21+
TextEmbeddingV3 = 3,
1722
}

src/Cnblogs.DashScope.Sdk/TextEmbedding/TextEmbeddingModelNames.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public static string GetModelName(this TextEmbeddingModel model)
88
{
99
TextEmbeddingModel.TextEmbeddingV1 => "text-embedding-v1",
1010
TextEmbeddingModel.TextEmbeddingV2 => "text-embedding-v2",
11+
TextEmbeddingModel.TextEmbeddingV3 => "text-embedding-v3",
1112
_ => ThrowHelper.UnknownModelName(nameof(model), model)
1213
};
1314
}

0 commit comments

Comments
 (0)