buildChatPrompt (lib/chatPrompt.ts)

Vibe-Trading · frontend/src/lib/chatPrompt.ts · typescript · MIT
ai, tag:knn-classified

Module exposing: buildChatPrompt, promptExceedsLimit, MAX_MESSAGE_CHARS, MAX_GOAL_CHARS, SWARM_PROMPT_PREFIX

// Source: https://github.com/HKUDS/Vibe-Trading | License: MIT | Copyright 2026 Vibe-Trading Contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { prependUploadedAttachments, type UploadedAttachment } from "@/lib/attachments";

// Match the interactive and goal request schemas in sessions_routes.py.
export const MAX_MESSAGE_CHARS = 100_000;
export const MAX_GOAL_CHARS = 5_000;
export const SWARM_PROMPT_PREFIX =
  "[Swarm Team Mode] Use the swarm tool to assemble the best specialist team for this task. Auto-select the most appropriate preset.\n\n";

export function buildChatPrompt(prompt: string, attachments: UploadedAttachment[], swarm: boolean): string {
  return prependUploadedAttachments(swarm ? `${SWARM_PROMPT_PREFIX}${prompt}` : prompt, attachments);


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key