1.0.72 • Published 12 months ago

@llmstudios/ctx-store v1.0.72

Weekly downloads
-
License
-
Repository
github
Last release
12 months ago

Context Store API

A lightweight service for managing threads and messages for AI SDK driven LLM applications.

Quick Start

  1. Start the server
npx ctx-store
  1. Initialize the client
import { createClient } from "@ctx-store/client";

const ctxStore = createClient();
  1. Create a thread and add a message
const thread = await ctxStore.createThread();

await ctxStore.createMessages(thread.id, [
	{
		role: "user",
		content: "Hello, world!",
	},
]);
  1. Use together with AI SDK
const { text } = await generateText({
	model: "gpt-4o",
	messages: [{ role: "user", content: "Hello, world!" }],
	onFinish: async ({ response }) => {
		await ctxStore.createMessages(thread.id, response.messages);
	},
});
1.0.72

12 months ago

1.0.71

12 months ago

1.0.69

12 months ago

1.0.67

12 months ago

1.0.66

12 months ago

1.0.65

12 months ago

1.0.64

12 months ago

1.0.62

12 months ago

1.0.61

12 months ago

1.0.58

12 months ago

1.0.57

12 months ago

1.0.56

12 months ago

1.0.55

12 months ago

1.0.50

12 months ago