chore: fix drive script type narrowing
This commit is contained in:
parent
6d043d9155
commit
088f0df47a
1 changed files with 2 additions and 2 deletions
|
|
@ -36,9 +36,9 @@ export default defineScript({
|
|||
(message) => message.type === "assistant",
|
||||
)
|
||||
if (assistant?.type !== "assistant") throw new Error("the assistant message was not projected")
|
||||
if (assistant.content.find((part) => part.type === "reasoning")?.text !== reasoning)
|
||||
if (!assistant.content.some((part) => part.type === "reasoning" && part.text === reasoning))
|
||||
throw new Error("the projected reasoning content did not match")
|
||||
if (assistant.content.find((part) => part.type === "text")?.text !== response)
|
||||
if (!assistant.content.some((part) => part.type === "text" && part.text === response))
|
||||
throw new Error("the projected text content did not match")
|
||||
if (assistant.finish !== "stop") throw new Error("the projected assistant message did not finish")
|
||||
yield* Effect.sync(() => console.log(`METRIC tui_timeline_drive_ms=${Date.now() - started}`))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue