Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ const client = new HumanloopClient({

export async function POST(req: Request) {
if (!HUMANLOOP_API_KEY) {
throw new Error('HUMANLOOP_API_KEY is not set')
return new Response('Missing HUMANLOOP_API_KEY environment variable', {
status: 500,
statusText: 'Missing Humanloop API key'
})
}

const { messages } = await req.json()


const chatResponse = await client.prompts.callStream({
path: 'sdk-example',
messages
Expand Down