Skip to content

Instantly share code, notes, and snippets.

View akdeb's full-sized avatar

Akashdeep Deb akdeb

View GitHub Profile
@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

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: