- 🔐 Centralized Credentials Management: Admin manages credentials, end users use without hassle.
- 🌐 Support for Multiple AI Providers: OpenAI, Anthropic, and many open-source models.
- 💬 Support for Various AI Capabilities: Chat, Image, Agents, and more.
Using the AI SDK
Activepieces integrates with the AI SDK to provide a unified interface for calling LLMs across multiple AI providers. Here’s an example on how to use the AI SDK’sgenerateText
function to call an LLM in your actions.
AI Properties Helper
UseaiProps
to create consistent AI-related properties:
Advanced Options
TheaiProps
helper includes an advancedOptions
property that provides provider-specific configuration options. These options are dynamically generated based on the selected provider and model.
To add advanced options for your new provider, update the advancedOptions
property in packages/pieces/community/common/src/lib/ai/index.ts
:
Adding a New AI Provider
To add support for a new AI provider, you need to update several files in the Activepieces codebase. Here’s a complete guide: Before starting, check the Vercel AI SDK Providers documentation to see all available providers and their capabilities.1. Install Required Dependencies
First, add the AI SDK for your provider to the project dependencies:2. Update SUPPORTED_AI_PROVIDERS Array
First, add your new provider to theSUPPORTED_AI_PROVIDERS
array in packages/ai-providers-shared/src/lib/supported-ai-providers.ts
:
3. Update createAIModel Function
Add a case for your provider in thecreateAIModel
function in packages/shared/src/lib/ai/ai-sdk.ts
:
4. Handle Provider-Specific Requirements
OpenAI supports both language and image models, but some providers may have specific requirements or limitations:5. Test Your Integration
After adding the provider, test it by:- Configure credentials in the Admin panel for your new provider
- Create a test action using
aiProps
to select your provider and models - Verify functionality by running a flow with your new provider
aiProps
dropdowns and can be used with generateText
and other AI SDK functions throughout Activepieces.