Skip to content

Commit 7e5ea7c

Browse files
committed
feat(AssistantV1): add support for spelling suggestions
1 parent 61123a2 commit 7e5ea7c

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

Scripts/Services/Assistant/V1/Model/DialogNodeOutputGeneric.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ public class QueryTypeValue
198198
/// The text of the search query. This can be either a natural-language query or a query that uses the Discovery
199199
/// query language syntax, depending on the value of the **query_type** property. For more information, see the
200200
/// [Discovery service
201-
/// documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-operators#query-operators). Required when
202-
/// **response_type**=`search_skill`.
201+
/// documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-operators#query-operators).
202+
/// Required when **response_type**=`search_skill`.
203203
/// </summary>
204204
[JsonProperty("query", NullValueHandling = NullValueHandling.Ignore)]
205205
public string Query { get; set; }
206206
/// <summary>
207207
/// An optional filter that narrows the set of documents to be searched. For more information, see the
208208
/// [Discovery service documentation]([Discovery service
209-
/// documentation](`https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameters#filter).
209+
/// documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameters#filter).
210210
/// </summary>
211211
[JsonProperty("filter", NullValueHandling = NullValueHandling.Ignore)]
212212
public string Filter { get; set; }

Scripts/Services/Assistant/V1/Model/MessageInput.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,32 @@ public class MessageInput: DynamicModel<object>
3030
/// </summary>
3131
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
3232
public string Text { get; set; }
33+
/// <summary>
34+
/// Whether to use spelling correction when processing the input. This property overrides the value of the
35+
/// **spelling_suggestions** property in the workspace settings.
36+
/// </summary>
37+
[JsonProperty("spelling_suggestions", NullValueHandling = NullValueHandling.Ignore)]
38+
public bool? SpellingSuggestions { get; set; }
39+
/// <summary>
40+
/// Whether to use autocorrection when processing the input. If spelling correction is used and this property is
41+
/// `false`, any suggested corrections are returned in the **suggested_text** property of the message response.
42+
/// If this property is `true`, any corrections are automatically applied to the user input, and the original
43+
/// text is returned in the **original_text** property of the message response. This property overrides the
44+
/// value of the **spelling_auto_correct** property in the workspace settings.
45+
/// </summary>
46+
[JsonProperty("spelling_auto_correct", NullValueHandling = NullValueHandling.Ignore)]
47+
public bool? SpellingAutoCorrect { get; set; }
48+
/// <summary>
49+
/// Any suggested corrections of the input text. This property is returned only if spelling correction is
50+
/// enabled and autocorrection is disabled.
51+
/// </summary>
52+
[JsonProperty("suggested_text", NullValueHandling = NullValueHandling.Ignore)]
53+
public virtual string SuggestedText { get; private set; }
54+
/// <summary>
55+
/// The original user input text. This property is returned only if autocorrection is enabled and the user input
56+
/// was corrected.
57+
/// </summary>
58+
[JsonProperty("original_text", NullValueHandling = NullValueHandling.Ignore)]
59+
public virtual string OriginalText { get; private set; }
3360
}
3461
}

Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettings.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ public class WorkspaceSystemSettings
4343
[JsonProperty("human_agent_assist", NullValueHandling = NullValueHandling.Ignore)]
4444
public Dictionary<string, object> HumanAgentAssist { get; set; }
4545
/// <summary>
46+
/// Whether spelling correction is enabled for the workspace.
47+
/// </summary>
48+
[JsonProperty("spelling_suggestions", NullValueHandling = NullValueHandling.Ignore)]
49+
public bool? SpellingSuggestions { get; set; }
50+
/// <summary>
51+
/// Whether autocorrection is enabled for the workspace. If spelling correction is enabled and this property is
52+
/// `false`, any suggested corrections are returned in the **suggested_text** property of the message response.
53+
/// If this property is `true`, any corrections are automatically applied to the user input, and the original
54+
/// text is returned in the **original_text** property of the message response.
55+
/// </summary>
56+
[JsonProperty("spelling_auto_correct", NullValueHandling = NullValueHandling.Ignore)]
57+
public bool? SpellingAutoCorrect { get; set; }
58+
/// <summary>
4659
/// Workspace settings related to the behavior of system entities.
4760
/// </summary>
4861
[JsonProperty("system_entities", NullValueHandling = NullValueHandling.Ignore)]

0 commit comments

Comments
 (0)