feat: snip a region into chat, and make links clickable (#14)
This commit was merged in pull request #14.
This commit is contained in:
+8
-2
@@ -1,7 +1,7 @@
|
||||
import { LocalStorage } from "@vicinae/api";
|
||||
import { MAX_SESSIONS, MAX_STORED_CHARS_PER_TURN, MAX_TURNS_PER_SESSION, STORAGE_INDEX_KEY, STORAGE_SESSION_PREFIX, TITLE_MAX_LENGTH } from "./constants";
|
||||
import { SessionIndexSchema, SessionSchema } from "./schemas";
|
||||
import type { ChatTurn, Session, SessionSummary } from "./types";
|
||||
import type { Attachment, ChatTurn, Session, SessionSummary } from "./types";
|
||||
import { titleFromPrompt, truncate } from "./utils";
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,12 @@ export function createSession(model: string, now: number = Date.now()): Session
|
||||
}
|
||||
|
||||
/** Creates the turn record for a prompt that is about to be sent. */
|
||||
export function createTurn(prompt: string, model: string, now: number = Date.now()): ChatTurn {
|
||||
export function createTurn(
|
||||
prompt: string,
|
||||
model: string,
|
||||
now: number = Date.now(),
|
||||
attachments: Attachment[] = [],
|
||||
): ChatTurn {
|
||||
return {
|
||||
id: newId(),
|
||||
prompt,
|
||||
@@ -65,6 +70,7 @@ export function createTurn(prompt: string, model: string, now: number = Date.now
|
||||
model,
|
||||
createdAt: now,
|
||||
toolCalls: [],
|
||||
attachments,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user