Learn how to connect your APIs to GenerativeAgent with API Connections
GenerativeAgent can call your APIs to get data or perform actions through API Connections. These connections allow GenerativeAgent to handle complex tasks like looking up account information or booking flights.
Our API Connection tooling lets you transform your existing APIs into LLM-friendly interfaces that GenerativeAgent can use effectively. Unlike other providers that require you to create new simplified APIs specifically for LLM use, ASAPP’s approach lets you leverage your current infrastructure without additional development work.
Our API Connection Tooling is low-code tooling designed to be used by developers and other technical users. We also have a code-based API Connection tool that allows you to create API Connections using javascript code for advanced use cases.
API Connections are the bridge between your GenerativeAgent and your external APIs. They allow your agent to interact with your existing systems and services, just like a human agent would.
GenerativeAgent uses a hierarchical structure to organize its capabilities:
Each API Connection consists of three main parts that work together:
API Source:
Request Interface:
Response Interface:
To create an API Connection, you need to:
We have a code-based API Connection tool that allows you to create API Connections using javascript code. This is for advanced use cases such as where you need to merge multiple APIs into a single API Connection.
Access the API Integration Hub
Select or Upload Your API Specification
Every API Connection requires an OpenAPI specification that defines your API endpoints and structure.
We support any API that uses JSON for requests and responses.
Configure Basic Details
Provide the essential information for your connection:
Only endpoints with JSON request and response bodies are supported.
Configure the API Source
After creation, you’ll be taken to the API Source configuration page. Here you’ll need to:
Set Up Request and Response Interfaces
Configure how GenerativeAgent interacts with your API:
Test and Validate
Before finalizing your API Connection:
Link to Functions
Once your API Connection is configured and tested, you can reference it in a Function to enable GenerativeAgent to use the API.
The Request Interface defines how GenerativeAgent interacts with your API. It consists of three key components that work together to enable effective API communication.
The Request Schema specifies the structure of data that GenerativeAgent can send to your API. This schema should be designed for optimal LLM interaction.
This schema is NOT the schema of the API. This is the schema of that is shown to GenerativeAgent.
Best Practices for Schema Design
Simplify Field Names
Flatten Complex Structures
Add Clear Descriptions
Remove Optional Fields
"additionalProperties": false
to prevent unexpected dataWhen first created, the Request Schema is a 1-1 mapping to the underlying API spec.
The Request Transformation converts GenerativeAgent’s request into the format your API expects. This is done using JSONata expressions.
When first created, the Request Transformation is a 1-1 mapping to the underlying API spec.
Common Transformation Patterns
Basic Field Mapping
Data Formatting
Conditional Logic
Thoroughly test your request transformations to ensure GenerativeAgent can send the correct data to your API.
The API Connection can not be saved until the request transformation has a successful test.
Testing Best Practices
Test Various Scenarios
Validate Error Cases
Use Sandbox Environment
By Default, the API Connection testing is local. You can test against actual API endpoints by setting “Run test in” to Sandbox.
The Response Interface determines how API responses are processed and presented to GenerativeAgent. A well-designed response interface makes it easier for GenerativeAgent to understand and use the API’s data effectively.
There are three main components to the response interface:
The Response Schema defines the structure of data that GenerativeAgent will receive. Focus on creating clear, simple schemas that are optimized for LLM processing.
The Response Schema is NOT the schema of the underlying API. This is the schema of what is returned to GenerativeAgent.
Schema Design Principles
Focus on Essential Data
Use Clear Data Types
Standardize Formats
When first created, the Response Schema is a 1-1 mapping to the underlying API spec.
Transform complex API responses into GenerativeAgent-friendly formats using JSONata. The goal is to simplify and standardize the data.
The Transformation’s input is the raw API response. The output is the data that GenerativeAgent will receive and must match the Response Schema.
When first created, the Response Transformation is a 1-1 mapping to the underlying API spec.
Transformation Examples
Basic Data Mapping
Date and Time Formatting
Complex Data Processing
Thoroughly test your response transformations to ensure GenerativeAgent receives well-formatted, useful data.
The API Connection can not be saved until the response transformation has a successful test.
Use API Mock Users to save response from your server to use them in the response testing.
Testing Strategies
Test Different Response Types
Make sure to test with different response types your server may respond with.
This should include happy paths, varied response types, and error paths.
Validate Data Formatting
Edge Cases
You have the option to redact fields in the request or response from API Connection Logs or Conversation Explorer.
You can redact fields the internal request and response, by adding x-redact
to a field in the Request Schema or Response Schema. You will need to save the API connection to apply the changes. This will redact the fields in the Conversation Explorer as well.
You can redact fields in the raw API request and response, by flagging the fields in the relevant API Spec:
Redacting the Spec will redact the fields within the API Connection Log.
Every update to an API Connection requires a version change. This is to ensure that no change can be made to an API connection that impacts a live function.
If you make a change to an API connection, the Function that references that API connection will need to be explicitly updated to point to the new version.
We log all requests and responses for API connections. This allows you to see the raw requests and responses, and the transformations that were applied.
Use the logs to debug and understand how API connections are working.
Logs are available in API Integration Hub > API Connection Logs.
You can set default information in an API spec. These default settings are used as a template for newly created API connections, copying those settings for all API connections created for that API spec.
You can set the following defaults:
You can make further changes to API connections as necessary.
You can also change the defaults and it will not change existing API connections, though the new defaults will be used on any new connections made with that Spec.
Here are some examples of how to configure API connections for different scenarios.
Update Passenger Name (Simple mapping)
This example demonstrates configuring an API connection for updating a passenger’s name on a flight booking.
Request Configuration
Response Configuration
Lookup Flight Status (Complex mapping)
This example shows how to simplify a complex flight status API response by removing unnecessary fields and flattening nested structures.
Request Configuration
Response Configuration
Appointment Lookup (Date Formatting)
This example demonstrates date formatting and complex object transformation for an appointment lookup API.
Request Configuration
Response Configuration
Now that you’ve configured your API connections, GenerativeAgent can interact with your APIs just like a live agent. Here are some helpful resources for next steps:
Learn how to connect your APIs to GenerativeAgent with API Connections
GenerativeAgent can call your APIs to get data or perform actions through API Connections. These connections allow GenerativeAgent to handle complex tasks like looking up account information or booking flights.
Our API Connection tooling lets you transform your existing APIs into LLM-friendly interfaces that GenerativeAgent can use effectively. Unlike other providers that require you to create new simplified APIs specifically for LLM use, ASAPP’s approach lets you leverage your current infrastructure without additional development work.
Our API Connection Tooling is low-code tooling designed to be used by developers and other technical users. We also have a code-based API Connection tool that allows you to create API Connections using javascript code for advanced use cases.
API Connections are the bridge between your GenerativeAgent and your external APIs. They allow your agent to interact with your existing systems and services, just like a human agent would.
GenerativeAgent uses a hierarchical structure to organize its capabilities:
Each API Connection consists of three main parts that work together:
API Source:
Request Interface:
Response Interface:
To create an API Connection, you need to:
We have a code-based API Connection tool that allows you to create API Connections using javascript code. This is for advanced use cases such as where you need to merge multiple APIs into a single API Connection.
Access the API Integration Hub
Select or Upload Your API Specification
Every API Connection requires an OpenAPI specification that defines your API endpoints and structure.
We support any API that uses JSON for requests and responses.
Configure Basic Details
Provide the essential information for your connection:
Only endpoints with JSON request and response bodies are supported.
Configure the API Source
After creation, you’ll be taken to the API Source configuration page. Here you’ll need to:
Set Up Request and Response Interfaces
Configure how GenerativeAgent interacts with your API:
Test and Validate
Before finalizing your API Connection:
Link to Functions
Once your API Connection is configured and tested, you can reference it in a Function to enable GenerativeAgent to use the API.
The Request Interface defines how GenerativeAgent interacts with your API. It consists of three key components that work together to enable effective API communication.
The Request Schema specifies the structure of data that GenerativeAgent can send to your API. This schema should be designed for optimal LLM interaction.
This schema is NOT the schema of the API. This is the schema of that is shown to GenerativeAgent.
Best Practices for Schema Design
Simplify Field Names
Flatten Complex Structures
Add Clear Descriptions
Remove Optional Fields
"additionalProperties": false
to prevent unexpected dataWhen first created, the Request Schema is a 1-1 mapping to the underlying API spec.
The Request Transformation converts GenerativeAgent’s request into the format your API expects. This is done using JSONata expressions.
When first created, the Request Transformation is a 1-1 mapping to the underlying API spec.
Common Transformation Patterns
Basic Field Mapping
Data Formatting
Conditional Logic
Thoroughly test your request transformations to ensure GenerativeAgent can send the correct data to your API.
The API Connection can not be saved until the request transformation has a successful test.
Testing Best Practices
Test Various Scenarios
Validate Error Cases
Use Sandbox Environment
By Default, the API Connection testing is local. You can test against actual API endpoints by setting “Run test in” to Sandbox.
The Response Interface determines how API responses are processed and presented to GenerativeAgent. A well-designed response interface makes it easier for GenerativeAgent to understand and use the API’s data effectively.
There are three main components to the response interface:
The Response Schema defines the structure of data that GenerativeAgent will receive. Focus on creating clear, simple schemas that are optimized for LLM processing.
The Response Schema is NOT the schema of the underlying API. This is the schema of what is returned to GenerativeAgent.
Schema Design Principles
Focus on Essential Data
Use Clear Data Types
Standardize Formats
When first created, the Response Schema is a 1-1 mapping to the underlying API spec.
Transform complex API responses into GenerativeAgent-friendly formats using JSONata. The goal is to simplify and standardize the data.
The Transformation’s input is the raw API response. The output is the data that GenerativeAgent will receive and must match the Response Schema.
When first created, the Response Transformation is a 1-1 mapping to the underlying API spec.
Transformation Examples
Basic Data Mapping
Date and Time Formatting
Complex Data Processing
Thoroughly test your response transformations to ensure GenerativeAgent receives well-formatted, useful data.
The API Connection can not be saved until the response transformation has a successful test.
Use API Mock Users to save response from your server to use them in the response testing.
Testing Strategies
Test Different Response Types
Make sure to test with different response types your server may respond with.
This should include happy paths, varied response types, and error paths.
Validate Data Formatting
Edge Cases
You have the option to redact fields in the request or response from API Connection Logs or Conversation Explorer.
You can redact fields the internal request and response, by adding x-redact
to a field in the Request Schema or Response Schema. You will need to save the API connection to apply the changes. This will redact the fields in the Conversation Explorer as well.
You can redact fields in the raw API request and response, by flagging the fields in the relevant API Spec:
Redacting the Spec will redact the fields within the API Connection Log.
Every update to an API Connection requires a version change. This is to ensure that no change can be made to an API connection that impacts a live function.
If you make a change to an API connection, the Function that references that API connection will need to be explicitly updated to point to the new version.
We log all requests and responses for API connections. This allows you to see the raw requests and responses, and the transformations that were applied.
Use the logs to debug and understand how API connections are working.
Logs are available in API Integration Hub > API Connection Logs.
You can set default information in an API spec. These default settings are used as a template for newly created API connections, copying those settings for all API connections created for that API spec.
You can set the following defaults:
You can make further changes to API connections as necessary.
You can also change the defaults and it will not change existing API connections, though the new defaults will be used on any new connections made with that Spec.
Here are some examples of how to configure API connections for different scenarios.
Update Passenger Name (Simple mapping)
This example demonstrates configuring an API connection for updating a passenger’s name on a flight booking.
Request Configuration
Response Configuration
Lookup Flight Status (Complex mapping)
This example shows how to simplify a complex flight status API response by removing unnecessary fields and flattening nested structures.
Request Configuration
Response Configuration
Appointment Lookup (Date Formatting)
This example demonstrates date formatting and complex object transformation for an appointment lookup API.
Request Configuration
Response Configuration
Now that you’ve configured your API connections, GenerativeAgent can interact with your APIs just like a live agent. Here are some helpful resources for next steps: