chat.svelte.ts

Declarations
#

6 declarations

view source

Chat
#

chat.svelte.ts view source

inheritance

extends:
  • Cell<typeof ChatJson>

name

type string

thread_ids

type Array<Uuid>

main_input

type string

view_mode

type ChatViewMode

selected_thread_id

type Uuid | null

main_input_length

type number

readonly

main_input_token_count

type number

readonly

threads

type Array<Thread>

readonly

enabled_threads

readonly

selected_thread

type Thread | undefined

readonly

current_thread

type Thread | undefined

readonly

init_name_status

type AsyncStatus

constructor

type new (options: ChatOptions): Chat

options

add_thread

type (model: Model, select?: boolean | undefined): void

model
type Model
select?
type boolean | undefined
optional
returns void

add_threads_by_model_tag

type (tag: string): void

tag
type string
returns void

remove_thread

type (id: string & $brand<"Uuid">): void

id
type string & $brand<"Uuid">
returns void

remove_threads

type (ids: (string & $brand<"Uuid">)[]): void

ids
type (string & $brand<"Uuid">)[]
returns void

remove_threads_by_model_tag

type (tag: string): void

tag
type string
returns void

remove_all_threads

type (): void

returns void

send_to_all

type (content: string): Promise<void>

content
type string
returns Promise<void>

send_to_thread

type (thread_id: string & $brand<"Uuid">, content: string): Promise<void>

thread_id
type string & $brand<"Uuid">
content
type string
returns Promise<void>

init_name_from_turns

Uses an LLM to name the chat based on the user input and AI response. Ignores failures and retries on next intention.

type (user_content: string, assistant_content: string): Promise<void>

user_content
type string
assistant_content
type string
returns Promise<void>

select_thread

Reorder threads by moving from one index to another

type (thread_id: (string & $brand<"Uuid">) | null): void

thread_id
type (string & $brand<"Uuid">) | null
returns void

reorder_threads

type (from_index: number, to_index: number): void

from_index
type number
to_index
type number
returns void

ChatJson
#

chat.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; ... 5 more ...; selected_thread_id: ZodDefault<...>; }, $strict>

ChatJsonInput
#

chat.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; }

ChatOptions
#

ChatSchema
#

ChatViewMode
#

Depends on
#

Imported by
#