Skip to content

Releases: LangbaseInc/langbase-sdk

1.0.0

27 Aug 19:19
a2e1171
Compare
Choose a tag to compare

All changes documented in the changelog here.

Major Changes

  • 📦 NEW: Chat support in both both generateText() and streamText()

  • 👌 IMPROVE: Example updates for Node, browser, Next.js, React, etc.

  • 👌 IMPROVE: ⌘ Langbase SDK Docs and API reference for both generateText() and streamText()

  • ‼️ BREAKING: ChoiceNonStream type is now renamed to ChoiceGenerate.

  • ‼️ BREAKING: generateText() now doesn't return raw instead all properties are included in the main response.

    BEFORE

    interface GenerateNonStreamResponse {
    	completion: string;
    	raw: {
    		id: string;
    		object: string;
    		created: number;
    		model: string;
    		choices: ChoiceNonStream[];
    		usage: Usage;
    		system_fingerprint: string | null;
    	};
    }

    NOW

    interface GenerateResponse {
    	completion: string;
    	threadId?: string;
    	id: string;
    	object: string;
    	created: number;
    	model: string;
    	system_fingerprint: string | null;
    	choices: ChoiceGenerate[];
    	usage: Usage;
    }
  • ‼️ BREAKING: streamText() now returns a threadId and stream as an object instead of returning stream alone.

    BEFORE

    const stream = await pipe.streamText({
    	messages: [{role: 'user', content: 'Who is an AI Engineer?'}],
    });

    NOW

    const {threadId, stream} = await pipe.streamText({
    	messages: [{role: 'user', content: 'Who is an AI Engineer?'}],
    });

What's Changed

New Contributors