Skip to content

Commit

Permalink
feat(assistant-v2): session_start_time and state properties added to …
Browse files Browse the repository at this point in the history
…MessageContextGlobalSystem
  • Loading branch information
nan2iz committed Sep 8, 2021
1 parent b805a7b commit fcecbd2
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 9 deletions.
25 changes: 22 additions & 3 deletions src/IBM.Watson.Assistant.v2/Model/MessageContextGlobalSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2021.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -136,13 +136,32 @@ public class LocaleEnumValue
/// `tomorrow`. This can be useful for simulating past or future times for testing purposes, or when analyzing
/// documents such as news articles.
///
/// This value must be a UTC time value formatted according to ISO 8601 (for example, `2019-06-26T12:00:00Z` for
/// noon on 26 June 2019.
/// This value must be a UTC time value formatted according to ISO 8601 (for example, `2021-06-26T12:00:00Z` for
/// noon UTC on 26 June 2021).
///
/// This property is included only if the new system entities are enabled for the skill.
/// </summary>
[JsonProperty("reference_time", NullValueHandling = NullValueHandling.Ignore)]
public string ReferenceTime { get; set; }
/// <summary>
/// The time at which the session started. With the stateful `message` method, the start time is always present,
/// and is set by the service based on the time the session was created. With the stateless `message` method,
/// the start time is set by the service in the response to the first message, and should be returned as part of
/// the context with each subsequent message in the session.
///
/// This value is a UTC time value formatted according to ISO 8601 (for example, `2021-06-26T12:00:00Z` for noon
/// UTC on 26 June 2021).
/// </summary>
[JsonProperty("session_start_time", NullValueHandling = NullValueHandling.Ignore)]
public string SessionStartTime { get; set; }
/// <summary>
/// An encoded string that represents the configuration state of the assistant at the beginning of the
/// conversation. If you are using the stateless `message` method, save this value and then send it in the
/// context of the subsequent message request to avoid disruptions if there are configuration changes during the
/// conversation (such as a change to a skill the assistant uses).
/// </summary>
[JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
public string State { get; set; }
}

}
20 changes: 17 additions & 3 deletions src/IBM.Watson.Assistant.v2/Model/MessageInput.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,19 +26,33 @@ namespace IBM.Watson.Assistant.v2.Model
public class MessageInput
{
/// <summary>
/// The type of user input. Currently, only text input is supported.
/// The type of the message:
///
/// - `text`: The user input is processed normally by the assistant.
/// - `search`: Only search results are returned. (Any dialog or actions skill is bypassed.)
///
/// **Note:** A `search` message results in an error if no search skill is configured for the assistant.
/// </summary>
public class MessageTypeEnumValue
{
/// <summary>
/// Constant TEXT for text
/// </summary>
public const string TEXT = "text";
/// <summary>
/// Constant SEARCH for search
/// </summary>
public const string SEARCH = "search";

}

/// <summary>
/// The type of user input. Currently, only text input is supported.
/// The type of the message:
///
/// - `text`: The user input is processed normally by the assistant.
/// - `search`: Only search results are returned. (Any dialog or actions skill is bypassed.)
///
/// **Note:** A `search` message results in an error if no search skill is configured for the assistant.
/// Constants for possible values can be found using MessageInput.MessageTypeEnumValue
/// </summary>
[JsonProperty("message_type", NullValueHandling = NullValueHandling.Ignore)]
Expand Down
20 changes: 17 additions & 3 deletions src/IBM.Watson.Assistant.v2/Model/MessageInputStateless.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,19 +26,33 @@ namespace IBM.Watson.Assistant.v2.Model
public class MessageInputStateless
{
/// <summary>
/// The type of user input. Currently, only text input is supported.
/// The type of the message:
///
/// - `text`: The user input is processed normally by the assistant.
/// - `search`: Only search results are returned. (Any dialog or actions skill is bypassed.)
///
/// **Note:** A `search` message results in an error if no search skill is configured for the assistant.
/// </summary>
public class MessageTypeEnumValue
{
/// <summary>
/// Constant TEXT for text
/// </summary>
public const string TEXT = "text";
/// <summary>
/// Constant SEARCH for search
/// </summary>
public const string SEARCH = "search";

}

/// <summary>
/// The type of user input. Currently, only text input is supported.
/// The type of the message:
///
/// - `text`: The user input is processed normally by the assistant.
/// - `search`: Only search results are returned. (Any dialog or actions skill is bypassed.)
///
/// **Note:** A `search` message results in an error if no search skill is configured for the assistant.
/// Constants for possible values can be found using MessageInputStateless.MessageTypeEnumValue
/// </summary>
[JsonProperty("message_type", NullValueHandling = NullValueHandling.Ignore)]
Expand Down

0 comments on commit fcecbd2

Please sign in to comment.