Skip to main content
TypeScript agent using OpenAI SDK with Bindu.

Code

Skill Configuration

Create skills/typescript-openai-skill/skill.yaml:

How It Works

TypeScript SDK Integration
  • @bindu/sdk: TypeScript Bindu SDK for agent development
  • Automatic microservice generation with DID and auth
  • gRPC communication with Bindu Python core
  • A2A protocol compliance handled by SDK
OpenAI SDK Integration
  • OpenAI: Direct OpenAI SDK integration
  • GPT-4o model for question answering
  • Chat completions API with message history
  • Configurable model via environment variable
Message Processing
  • ChatMessage[]: Bindu message format with role and content
  • Role mapping (user/assistant/system) for OpenAI compatibility
  • Direct API calls to OpenAI chat completions
  • Response extraction and content return
Configuration
  • Environment-based API key management
  • Standard Bindu deployment configuration
  • Skills declaration for capabilities
  • Model configuration flexibility

Dependencies

Environment Setup

Create .env file:

Run

Example API Calls

Frontend Setup

Open http://localhost:5173 and try to chat with the TypeScript OpenAI agent