1.0.72 • Published 1 year ago

@llmstudios/ctx-store v1.0.72

Weekly downloads
-
License
-
Repository
github
Last release
1 year 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

1 year ago

1.0.71

1 year ago

1.0.69

1 year ago

1.0.67

1 year ago

1.0.66

1 year ago

1.0.65

1 year ago

1.0.64

1 year ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.55

1 year ago

1.0.50

1 year ago