@micdrop/openai
v1.2.2
Published
OpenAI implementation for @micdrop/server
Maintainers
Readme
@micdrop/openai
Micdrop website | Documentation
OpenAI implementation for @micdrop/server.
Installation
npm install @micdrop/openaiOpenAI Agent
Usage
import { OpenaiAgent } from '@micdrop/openai'
import { MicdropServer } from '@micdrop/server'
const agent = new OpenaiAgent({
apiKey: process.env.OPENAI_API_KEY || '',
model: 'gpt-4o', // Default model
systemPrompt: 'You are a helpful assistant',
// Advanced features (optional)
autoEndCall: true, // Automatically end call when user requests
autoSemanticTurn: true, // Handle incomplete sentences
autoIgnoreUserNoise: true, // Filter out meaningless sounds
// Custom OpenAI settings (optional)
settings: {
temperature: 0.7,
max_output_tokens: 150,
},
})
// Use with MicdropServer
new MicdropServer(socket, {
agent,
// ... other options
})OpenAI STT (Speech-to-Text)
Usage
import { OpenaiSTT } from '@micdrop/openai'
import { MicdropServer } from '@micdrop/server'
const stt = new OpenaiSTT({
apiKey: process.env.OPENAI_API_KEY || '',
model: 'gpt-4o-transcribe',
language: 'en',
})
// Use with MicdropServer
new MicdropServer(socket, {
stt,
// ... other options
})Documentation
Read full documentation of the OpenAI integration for Micdrop on the website.
License
MIT
Author
Originally developed for Raconte.ai and open sourced by Lonestone (GitHub)
