forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

postRagMessage.ts18 lines, 579 bytesHistoryRawDownload
1import { client } from "../client";
2
3/** The receipt for an accepted turn — the answer is not here yet. */
4export type AcceptedRagMessage = {
5 message_id: string;
6 status: "pending";
7};
8
9/**
10 * 202. The live message-length cap is the school's `max_chatbot_message_len`
11 * (`GET /settings`), the same knob the chatbot nest uses.
12 */
13export function postRagMessage(threadId: string, content: string): Promise<AcceptedRagMessage> {
14 return client<AcceptedRagMessage>(`/rag/threads/${encodeURIComponent(threadId)}/messages`, {
15 method: "POST",
16 body: { content },
17 });
18}