Vercel AI SDK
Connect Pica with the Vercel AI SDK for enhanced AI capabilities
@picahq/ai
Install the Pica AI package to unlock powerful tools for the Vercel AI SDK
The Pica AI SDK is a powerful tool that allows you connect Pica with Vercel’s AI SDK for enhanced AI capabilities.
Configuration
The Pica SDK can be configured with the following options:
Option | Type | Required | Default | Description |
---|---|---|---|---|
serverUrl | String | No | https://api.picaos.com | URL for self-hosted Pica server. |
connectors | String[] | No | List of connector keys to filter by. Pass [”*”] to initialize all available connectors, or specific connector keys to filter. If empty, no connections will be initialized | |
identity | String | No | None | Filter connections by specific identifier. |
identityType | "user", "team", "project", "organization" | No | None | Filter connections by identity type. |
authkit | Boolean | No | false | If true, the SDK will use Authkit to connect to prompt the user to connect to a platform that they do not currently have access to |
knowledgeAgent | Boolean | No | false | If true, the SDK will never execute actions, but will use Pica’s knowledge to generate code. If true, use pica.intelligenceTool instead of pica.oneTool |
knowledgeAgentConfig | Object | No | { includeEnvironmentVariables: true } | Configuration for the Knowledge Agent. If includeEnvironmentVariables is true, the SDK will return a reminder to include environment variables in the output |
Installation
Install the Pica AI package:
Examples
Install the required packages:
Here’s an example of using Pica with OpenAI in a Next.js API route:
Install the required packages:
Here’s an example of using Pica with OpenAI in a Next.js API route:
- Install dependencies
- Create the server
- Test the server
AuthKit
The authkit configuration option initiates Pica’s AuthKit. When enabled, the SDK will prompt the user to connect to a platform that they do not currently have access to.
Knowledge Agent
The knowledge agent is a configuration optional that initiates Pica’s knowledge agent. When enabled, the knowledge agent will be used to generate code instead of executing actions.
Demo
You can now use the chat interface directly in the Pica Dashboard.
@picahq/onetool-demo
View on GitHub