Overview

Mock API Functions allow users to configure Functions within GenerativeAgent without pointing to a real API.

By providing a JSON schema, you can quickly define how a Function should behave, test its parameters, and preview conversation flows before integrating any live endpoints. This shortens the setup process drastically and enables immediate prototyping of how GenerativeAgent will call your Function.

Once you are ready to go live, you can simply replace your mocked schema with a real API connection, maintaining the same Function definitions and conversation logic.

Mocking API Connections is seamless way to:

  • Validate conversation flows
  • Confirm that parameters work as intended
  • Ensure that your team can deliver results with or without fully integrated APIs

Use and Impact

ASAPP aims to reduce friction and speed up time-to-deployment by removing the need for a working API during the initial setup and creation of Functions.

By Mocking API Connections, users can define and test Functions quickly, iterate on conversation flows, and confirm parameter requirements.

This helps ensure a more robust final integration, saving both time and resources for customers and developers.

Its main benefits are:

  • Rapid prototyping of new Functions without a fully built API.
  • Testing how GenerativeAgent processes or populates request parameters before real integration.
  • Simplifying configuration for teams that want to get interacting with GenerativeAgent quickly before building or exposing internal APIs.

Mock API

Go to the Mock API page to learn more about this feature.

How it works

  1. User selects “Create Function” from the Functions page.
  2. User clicks “Integrate later,” indicating a Mock API setup.
  3. User enters a valid JSON schema for the request parameters (or picks an example schema).
  4. Upon saving, the Function detail page displays a preview of the schema.
  5. During a conversation, GenerativeAgent can “call” the mocked Function, letting users confirm how parameters would be handled.
  6. When ready, user can click “Replace” to connect to a real API, transferring any saved schema and Function definitions seamlessly into production.

Mock API works with JSON Schema for Mock Functions

FAQs

  1. Can I leave a Mock API Function in place indefinitely?
    • Yes.
    • Mock API Functions do not need a live API unless you decide you need real data or third-party functionality. You can replace the mock with a real API at any time.
  2. Will I lose my Function definitions if I switch to a real API?
    • Not at all.
    • You can preserve your Function’s core settings and simply hit “Replace” to attach a real API for production.
  3. Can I deploy Mock API Functions to production?
    • Currently, Mock API Functions can be deployed to sandbox, but not to production environments.
    • If you need a Function to run in production, you must replace the mock schema with a real API connection.