Skip to content

Instantly share code, notes, and snippets.

View akdeb's full-sized avatar
🌶️
building AI in a tiny box

Akashdeep Deb akdeb

🌶️
building AI in a tiny box
View GitHub Profile

Keybase proof

I hereby claim:

  • I am akdeb on github.
  • I am akad3b (https://keybase.io/akad3b) on keybase.
  • I have a public key ASBoBG3ZfwTNia9apbCTjgry2qw2lDDHpHHwRzvniPnzZgo

To claim this, I am signing this object:

@akdeb
akdeb / nextjs_openai_stream_client.tsx
Last active February 21, 2024 16:12
Streaming JSON objects returned by LLM Stream (OpenAI, Anthropic, Mistral etc.) in NextJS / React
"use client";
// generated this with copilot
const YourClient: React.FC<{}> = (props) => {
function processBuffer(
buffer: string,
onObjectParsed: (object: any) => void,
isFinal: boolean = false