mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-12 11:48:42 +00:00
big format
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
import { For, Show, onMount, Suspense, onCleanup, createMemo, createSignal, SuspenseList, createEffect } from "solid-js"
|
||||
import {
|
||||
For,
|
||||
Show,
|
||||
onMount,
|
||||
Suspense,
|
||||
onCleanup,
|
||||
createMemo,
|
||||
createSignal,
|
||||
SuspenseList,
|
||||
createEffect,
|
||||
} from "solid-js"
|
||||
import { DateTime } from "luxon"
|
||||
import { createStore, reconcile, unwrap } from "solid-js/store"
|
||||
import { IconArrowDown } from "./icons"
|
||||
@@ -66,8 +76,13 @@ export default function Share(props: { id: string; api: string; info: Session.In
|
||||
},
|
||||
messages: {},
|
||||
})
|
||||
const messages = createMemo(() => Object.values(store.messages).toSorted((a, b) => a.id?.localeCompare(b.id)))
|
||||
const [connectionStatus, setConnectionStatus] = createSignal<[Status, string?]>(["disconnected", "Disconnected"])
|
||||
const messages = createMemo(() =>
|
||||
Object.values(store.messages).toSorted((a, b) => a.id?.localeCompare(b.id)),
|
||||
)
|
||||
const [connectionStatus, setConnectionStatus] = createSignal<[Status, string?]>([
|
||||
"disconnected",
|
||||
"Disconnected",
|
||||
])
|
||||
createEffect(() => {
|
||||
console.log(unwrap(store))
|
||||
})
|
||||
@@ -330,7 +345,9 @@ export default function Share(props: { id: string; api: string; info: Session.In
|
||||
</ul>
|
||||
<div
|
||||
data-component="header-time"
|
||||
title={DateTime.fromMillis(data().created || 0).toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)}
|
||||
title={DateTime.fromMillis(data().created || 0).toLocaleString(
|
||||
DateTime.DATETIME_FULL_WITH_SECONDS,
|
||||
)}
|
||||
>
|
||||
{DateTime.fromMillis(data().created || 0).toLocaleString(DateTime.DATETIME_MED)}
|
||||
</div>
|
||||
@@ -352,7 +369,10 @@ export default function Share(props: { id: string; api: string; info: Session.In
|
||||
if (x.type === "text" && x.synthetic === true) return false
|
||||
if (x.type === "tool" && x.tool === "todoread") return false
|
||||
if (x.type === "text" && !x.text) return false
|
||||
if (x.type === "tool" && (x.state.status === "pending" || x.state.status === "running"))
|
||||
if (
|
||||
x.type === "tool" &&
|
||||
(x.state.status === "pending" || x.state.status === "running")
|
||||
)
|
||||
return false
|
||||
return true
|
||||
}),
|
||||
@@ -364,7 +384,8 @@ export default function Share(props: { id: string; api: string; info: Session.In
|
||||
{(part, partIndex) => {
|
||||
const last = createMemo(
|
||||
() =>
|
||||
data().messages.length === msgIndex() + 1 && filteredParts().length === partIndex() + 1,
|
||||
data().messages.length === msgIndex() + 1 &&
|
||||
filteredParts().length === partIndex() + 1,
|
||||
)
|
||||
|
||||
onMount(() => {
|
||||
@@ -381,7 +402,9 @@ export default function Share(props: { id: string; api: string; info: Session.In
|
||||
}
|
||||
})
|
||||
|
||||
return <Part last={last()} part={part} index={partIndex()} message={msg} />
|
||||
return (
|
||||
<Part last={last()} part={part} index={partIndex()} message={msg} />
|
||||
)
|
||||
}}
|
||||
</For>
|
||||
</Suspense>
|
||||
@@ -406,7 +429,11 @@ export default function Share(props: { id: string; api: string; info: Session.In
|
||||
</li>
|
||||
<li>
|
||||
<span data-element-label>Input Tokens</span>
|
||||
{data().tokens.input ? <span>{data().tokens.input}</span> : <span data-placeholder>—</span>}
|
||||
{data().tokens.input ? (
|
||||
<span>{data().tokens.input}</span>
|
||||
) : (
|
||||
<span data-placeholder>—</span>
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
<span data-element-label>Output Tokens</span>
|
||||
@@ -560,7 +587,8 @@ export function fromV1(v1: Message.Info): MessageWithParts {
|
||||
}
|
||||
}
|
||||
|
||||
const { title, time, ...metadata } = v1.metadata.tool[part.toolInvocation.toolCallId]
|
||||
const { title, time, ...metadata } =
|
||||
v1.metadata.tool[part.toolInvocation.toolCallId]
|
||||
if (part.toolInvocation.state === "call") {
|
||||
return {
|
||||
status: "running",
|
||||
|
||||
Reference in New Issue
Block a user