@hashbrownai/openai
v0.5.0
Published
OpenAI provider for Hashbrown AI
Readme
Getting Started
npm install @hashbrownai/openai --saveDeploy an express server with a single /chat endpoint to use Hashbrown with OpenAI.
import { HashbrownOpenAI } from '@hashbrownai/openai';
app.post('/chat', async (req, res) => {
const stream = HashbrownOpenAI.stream.text({
apiKey: process.env.OPENAI_API_KEY!,
request: req.body, // must be Chat.Api.CompletionCreateParams
});
res.header('Content-Type', 'application/octet-stream');
for await (const chunk of stream) {
res.write(chunk); // Pipe each encoded frame as it arrives
}
res.end();
});Docs
Read the docs for the Hashbrown OpenAI adapter.
Contributing
hashbrown is a community-driven project. Read our contributing guidelines on how to get involved.
Workshops and Consulting
Want to learn how to build web apps with AI? Learn more about our workshops.
LiveLoveApp provides hands-on engagement with our AI engineers for architecture reviews, custom integrations, proof-of-concept builds, performance tuning, and expert guidance on best practices. Learn more about LiveLoveApp.
License
MIT © LiveLoveApp, LLC
