Explicit thinking (#183)
This commit is contained in:
@@ -9,6 +9,7 @@ import { DyadExecuteSql } from "./DyadExecuteSql";
|
||||
import { DyadAddIntegration } from "./DyadAddIntegration";
|
||||
import { DyadEdit } from "./DyadEdit";
|
||||
import { DyadCodebaseContext } from "./DyadCodebaseContext";
|
||||
import { DyadThink } from "./DyadThink";
|
||||
import { CodeHighlight } from "./CodeHighlight";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { isStreamingAtom } from "@/atoms/chatAtoms";
|
||||
@@ -119,6 +120,7 @@ function preprocessUnclosedTags(content: string): {
|
||||
"dyad-chat-summary",
|
||||
"dyad-edit",
|
||||
"dyad-codebase-context",
|
||||
"think",
|
||||
];
|
||||
|
||||
let processedContent = content;
|
||||
@@ -183,6 +185,7 @@ function parseCustomTags(content: string): ContentPiece[] {
|
||||
"dyad-chat-summary",
|
||||
"dyad-edit",
|
||||
"dyad-codebase-context",
|
||||
"think",
|
||||
];
|
||||
|
||||
const tagPattern = new RegExp(
|
||||
@@ -268,6 +271,18 @@ function renderCustomTag(
|
||||
const { tag, attributes, content, inProgress } = tagInfo;
|
||||
|
||||
switch (tag) {
|
||||
case "think":
|
||||
return (
|
||||
<DyadThink
|
||||
node={{
|
||||
properties: {
|
||||
state: getState({ isStreaming, inProgress }),
|
||||
},
|
||||
}}
|
||||
>
|
||||
{content}
|
||||
</DyadThink>
|
||||
);
|
||||
case "dyad-write":
|
||||
return (
|
||||
<DyadWrite
|
||||
|
||||
Reference in New Issue
Block a user