Data Types
What are data types?
Data types define the structure and format of values that variables can hold. They ensure type-aware behavior, enabling the AI agents to handle data consistently, such as collecting inputs in conversational slots, passing values between actions, or rendering them in citations.
Available Data Types
Data types vary by context:
- Actions: Currently limited to a fixed set of primitive and built-in types.
- Slots: Include the same types as Actions, plus support for custom data types.
Data Types for Actions
Actions currently support the following built-in data types.
Type | Description | Example Value |
---|---|---|
string | Text or identifiers | "[email protected]" |
integer | Whole numbers | 42 |
number | Decimals or floats | 3.14 |
boolean | True/false flags | true |
object | Key-value pair structures | { "role": "admin" } |
User | Moveworks user object | { "id": "123", "email_addr": "[email protected]" } |
List[T] | List of the selected type | List[string] -> ["[email protected]", "[email protected]"] |
Usage Notes:
- Use these types when defining inputs for actions.
- For lists, specify the inner type (e.g.,
List[string]
for a list of strings).
Data Types for Slots
Slots, used in conversational processes, support all the data types available in Actions, plus custom data types. Custom types allow integration with business systems, enabling slots to handle complex, system-specific objects.
- Built-in Types: Identical to those in Actions (see table above).
- Custom Data Types: User-defined types representing objects from external systems, such as
SalesforceAccount
orJiraIssue
.
Key Differences
- Custom types are exclusive to slots for advanced data collection in conversations.
- They enable natural language resolution (e.g., converting "my latest ticket" to a
JiraIssue
object). - Do not merge custom types across systems—create separate types for similar objects in different systems (e.g.,
SalesforceAccount
andNetsuiteAccount
).
How do I configure Custom Data Types?
Custom data types are configured exclusively for use in slots. Follow these steps to create and set them up in the Agent Studio.
Prerequisities
- A JSON example of the data object from your business system (e.g., a sample API response).
Step-by-Step Configuration
-
Navigate to Data Types
-
Create a New Custom Data Type
- Click Create
-
Set Name and Description:
- Name: Must follow the convention
u_<DataTypeName>
(e.g.,u_SalesforceAccount
). This serves as a unique identifier. - Description: Provide a detailed explanation of the type, including its purpose and key fields.
- Name: Must follow the convention
-
Define the Data Type Schema
- Use the Import JSON button in the top-right to paste a sample JSON object from your system.
- A schema will be auto-generated based on the JSON structure.
- Review and edit fields as needed (e.g., mark required fields or add validations).
-
Add Resolver Strategies
- Resolver strategies convert natural language inputs to custom data type objects.
- These are only applicable to custom data types in slots.
- Define a default strategy here to avoid repetition in individual plugins or slots.
- For details on setup, see Resolver Strategies.
Example Use Case: For a
JiraIssue
type, a resolver might map "this week's most important bug" to a specific issue object.
Updated 7 days ago