Keep Fields
Learn how to keep fields from API responses so GenerativeAgent can use them for more calls
The history of responses in conversations is part of the data that GenerativeAgent continuallly uses as context to reply, analaze, and respond to your customers.
As Generative Agent makes constant calls to APIs via Functions, response history can be extended. This can result in a lot of data in the conversation history and can make it more difficult for GenerativeAgent to identify the most relevant fields or data to use in subsequent calls.
While you can control this by specifying the data to return within the underlying API Connection, you can also use a slightly different set of fields for multiple Tasks using the same Function.
With the Keep Fields functionality you can configure Keep Fields to change the data kept in the context for that Task.
Most users will not need to configure Keep Fields and instead rely on specifying the fields to keep in the underlying API Connection.
Configure a Keep Field
Keep Fields are part of the Function page.
To configure a Keep Field:
- Identify the Function within a Task
- Determine the function that you want to configure fields to keep.
- Go to the Keep Field Configuration
- In the Function settings, see the Keep Configuration table.
- Specify Keep Fields
- List all the fields that this function should retain. Use a nested list format to specify the paths of the fields you want to keep.
Each path should be an array of strings representing the keys to traverse in the JSON structure.
Inside of the Function options, you can add Keep Fields.
Specify fields within objects
JSON responses on API Connections often contain arrays of objects.
To specify fields within these objects, you need to indicate that you are traversing an array.
Use the []
notation to denote array elements in the path when specifying which fields to keep.
This is necessary because JSON structures can include arrays, and you need to indicate that you are referring to elements within those arrays.
Example Keep Field Configuration
See this example of a configuration to keep all fields except for scheduledDepartureTime
under origin
within segments
of originalSlice
::
Was this page helpful?