Skip to content

Commit 923eedf

Browse files
committed
refactor: rename stop token field
1 parent 2a3a15f commit 923eedf

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Cnblogs.DashScope.Sdk/TextGenerationStop.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ public class TextGenerationStop
3232
/// <summary>
3333
/// Generation will stop if token with this id is going to be generated.
3434
/// </summary>
35-
public int[]? StopTokenId { get; }
35+
public int[]? StopToken { get; }
3636

3737
/// <summary>
3838
/// Generation will stop if token in this ids is going to be generated.
3939
/// </summary>
40-
public IEnumerable<int[]>? StopTokenIds { get; }
40+
public IEnumerable<int[]>? StopTokens { get; }
4141

4242
/// <summary>
4343
/// Creates a <see cref="TextGenerationStop"/> with single string.
@@ -60,19 +60,19 @@ public TextGenerationStop(IEnumerable<string> stopStrings)
6060
/// <summary>
6161
/// Creates a <see cref="TextGenerationStop"/> with single token id.
6262
/// </summary>
63-
/// <param name="stopTokenId">The stop token id.</param>
64-
public TextGenerationStop(int[] stopTokenId)
63+
/// <param name="stopToken">The stop token id.</param>
64+
public TextGenerationStop(int[] stopToken)
6565
{
66-
StopTokenId = stopTokenId;
66+
StopToken = stopToken;
6767
}
6868

6969
/// <summary>
7070
/// Creates a <see cref="TextGenerationStop"/> with multiple token ids.
7171
/// </summary>
72-
/// <param name="stopTokenIds">The stop token ids.</param>
73-
public TextGenerationStop(IEnumerable<int[]> stopTokenIds)
72+
/// <param name="stopTokens">The stop token ids.</param>
73+
public TextGenerationStop(IEnumerable<int[]> stopTokens)
7474
{
75-
StopTokenIds = stopTokenIds;
75+
StopTokens = stopTokens;
7676
}
7777

7878
/// <summary>
@@ -94,7 +94,7 @@ public TextGenerationStop(IEnumerable<int[]> stopTokenIds)
9494
public static implicit operator TextGenerationStop(List<string> stops) => new(stops);
9595

9696
/// <summary>
97-
/// Creates a <see cref="TextGenerationStop"/> with single token id.
97+
/// Creates a <see cref="TextGenerationStop"/> with token ids.
9898
/// </summary>
9999
/// <param name="stop">The stop token id.</param>
100100
public static implicit operator TextGenerationStop(int[] stop) => new(stop);

src/Cnblogs.DashScope.Sdk/TextGenerationStopConvertor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public override void Write(Utf8JsonWriter writer, TextGenerationStop value, Json
3939
return;
4040
}
4141

42-
if (value.StopTokenId != null)
42+
if (value.StopToken != null)
4343
{
44-
JsonSerializer.Serialize(writer, value.StopTokenId, options);
44+
JsonSerializer.Serialize(writer, value.StopToken, options);
4545
return;
4646
}
4747

48-
if (value.StopTokenIds != null)
48+
if (value.StopTokens != null)
4949
{
50-
JsonSerializer.Serialize(writer, value.StopTokenIds, options);
50+
JsonSerializer.Serialize(writer, value.StopTokens, options);
5151
return;
5252
}
5353

0 commit comments

Comments
 (0)