Test Users
You can test various return scenarios with GenerativeAgent by using Test Users in the Previewer.
Additionally, by using Test Users you ensure that GenerativeAgent handles tasks and functions correctly when calling your APIs.
Test Users allow you to define a scenario and how your API would respond to an API Connection for that scenario. This allows you to try out different Tasks and iterate on tasks definitions or on Functions.
Test Users allow you to define replies for different API calling scenarios (e.g. the return for an API Call named getAddress but having different user IDs).
Use Test Users to test:
- Key happy-flows
- Edge cases
- Common problems or issues
Test User Configuration
Default User Options
Whenever you choose a Test User, you are given the following options:
- Add API: Add the Mock Response for the API Call.
- Once you add an API, add the return scenarios by specifying different request parameter / response pairs.
- Advance settings: Add timestamps to the mock call so GenerativeAgent can make better use of connections.
- This works only if your mocked data includes dates. If this is the case, set this field so the date the bot believes it is aligns with the data returned in the mock responses
If your mock data does not involve or include dates, leave it blank.
Default User
After choosing “Add API”, fill out the following information:
- API to mock: Be explicit about the API you can to use.
Remember to use the correct syntax.
For example, add entity.
in the jinja syntax to an accountinfo
API Call.
- Request Params: Enter the Params that should be mocked
- Response params: Enter the Request Params you want to mock in a response. You can specify multiple Request and Response pairs for a single API.
Create a Test User
To create a Test User:
- Navigate to the Test User page in GenerativeAgent and click “Create User”.
- This takes you to the Test User detail page which shows each endpoint currently being used by an API Connection.
- Provide the following information:
- Name of the test user (editable)
- Description of the scenario this mock user represents (eg. Basic returns for the API Call and Functions)
For each endpoint, provide the API response your server would respond to enable the scenario you want to simulate.
- Click “Create” and create the Test User.
- Deploy the changes to Sandbox or Draft environments
Delete a Test User
To delete a test user, simply click on the ellipsis and then on Delete. You are given a confirmation pop-up to delete the user
Use Test Users in the Previewer
Once you create the Test User and reference an API call to the Test User, you are ready to test a function using Mock API Functions.
To use the Test User:
- Check that the Tasks and Functions correctly reference the Test User and the API Call to Mock
- Initiate a conversation with GenerativeAgent
- Ask GenerativeAgent for information related to the Mock Call
- Review the response given by GenerativeAgent. It should return the same mock response that you set up in the Test User
Was this page helpful?