@onioneko/kiki-types
v0.1.3
Published
Shared conversation types for the Kiki middleware ecosystem
Maintainers
Readme
@onioneko/kiki-types
Kiki · Middleware framework for LLM agents
Shared conversation types for the Kiki middleware ecosystem.
npm install @onioneko/kiki-typesCore's Context is an open map. This package defines the conversation structure that LLM middleware operates on.
Exports
Message—{ role: "user" | "assistant", content: string | ContentBlock[] }ConversationContext— ExtendsContextwithmessages: Message[]and optionalsystem: stringContentBlock—TextBlock | ImageBlockfor multi-modal messagesTextBlock—{ type: "text", text: string }ImageBlock—{ type: "image", source: { type, media_type, data } }
Usage
import type { ConversationContext, Message } from "@onioneko/kiki-types";
const ctx: ConversationContext = {
messages: [{ role: "user", content: "hello" }],
system: "You are helpful.",
};
// Multi-modal message with image
const imageMsg: Message = {
role: "user",
content: [
{ type: "text", text: "What is in this image?" },
{ type: "image", source: { type: "base64", media_type: "image/png", data: "..." } },
],
};Design
- Zero runtime dependencies (beyond
@onioneko/kiki-corefor theContexttype) - System prompt is
ctx.system, not in the messages array content: stringis the common case;ContentBlock[]enables multi-modal
