TypeScript Library
Seamlessly integrate AgentBridge-defined APIs with AI agents through AI SDK
Installation
Usage
This library is currently tailored to work with the AI SDK, providing a simple interface for interacting with AgentBridge-defined APIs.
Support beyond AI SDK is on the roadmap. While technically it can be used in other contexts, DX may be worse.
Loading a Schema
You can load an AgentBridge schema from either a local file or a remote URL:
Creating a Client
Usage with Vercel AI SDK
Logging
The client includes a configurable logging system:
Available log levels: NONE
, ERROR
, WARN
, INFO
, DEBUG
, TRACE
Methods
executeAction
A method that executes a single API action. Returns a promise that resolves to the action result.
executeFlow
A method that executes a multi-step flow. Returns a promise that resolves to the flow result.
getTools
A method that returns a list of tools in ToolSet
type from ai-sdk
library.
listFlows
A method that returns a list of flows that can be executed.
listActions
A method that returns a list of actions that can be executed.
setLogLevel
A method that sets the log level, controlling the verbosity of the client's logging output.
Helpers
readSchemaFromFile
A helper function that reads a AgentBridge schema from a local file.
fetchSchemaFromUrl
A helper function that fetches a AgentBridge schema from a remote URL.