agent-vercel-ai
v1.0.0
Published
Agent using Vercel AI SDK
Readme
Blaxel Vercel AI SDK Agent
A template implementation of a conversational agent using Vercel AI SDK and GPT-4. This agent demonstrates the power of Vercel AI SDK for building interactive AI agents with tool integration capabilities.
Features
- Interactive conversational interface
- Tool integration support (including weather and search capabilities)
- Streaming responses for real-time interaction
- Built on Vercel AI SDK for efficient agent orchestration
- Easy deployment and integration with Blaxel platform
Prerequisites
- Node.js: v18 or later.
- Blaxel CLI: Ensure you have the Blaxel CLI installed. If not, install it globally:
curl -fsSL https://raw.githubusercontent.com/beamlit/toolkit/main/install.sh | BINDIR=$HOME/.local/bin sh - Blaxel login: Login to Blaxel platform
bl login YOUR-WORKSPACE
Installation
Clone the repository and install dependencies:
git clone https://github.com/beamlit/template-vercel-ai-ts.git
cd template-vercel-ai-ts
uv syncRunning the Server Locally
Start the development server with hot reloading:
bl serve --hotreloadNote: This command starts the server and enables hot reload so that changes to the source code are automatically reflected.
Testing your agent
You can test your agent using the chat interface:
bl chat --local blaxel-agentOr run it directly with specific input:
bl run agent blaxel-agent --local --data '{"input": "What is the weather in Paris?"}'Deploying to Blaxel
When you are ready to deploy your application:
bl deployThis command uses your code and the configuration files under the .blaxel directory to deploy your application.
Project Structure
- src/index.ts - Application entry point
- src/agent.ts - Core agent implementation with Vercel AI SDK integration
- blaxel.toml - Blaxel deployment configuration
Run command
curl -X POST "https://run.blaxel.ai/humanbehavior/agents/worker?debug=true" \
-H 'Content-Type: application/json' \
-H 'X-Blaxel-Workspace: humanbehavior' \
-H "X-Blaxel-Authorization: Bearer <YOUR_API_KEY>"License
This project is licensed under the MIT License. See the LICENSE file for more details.
