Skip to content

Commit a912773

Browse files
committed
fix not display
1 parent 90a55f3 commit a912773

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

templates/components/agents/python/blog/app/workflows/writer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def create_workflow(
4545
return WriterWorkflow(
4646
index=index,
4747
chat_history=chat_history,
48-
**kwargs,
48+
timeout=120.0,
4949
)
5050

5151

templates/types/streaming/nextjs/app/components/ui/chat/chat-message-content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function ChatMessageContent() {
2525
},
2626
// add the writer card
2727
{
28-
position: ContentPosition.AFTER_EVENTS,
28+
position: ContentPosition.CHAT_EVENTS,
2929
component: <WriterCard message={message} />,
3030
},
3131
{

templates/types/streaming/nextjs/app/components/ui/chat/custom/writer-card.tsx

+8-16
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ const updateState = (state: WriterState, event: WriterEvent): WriterState => {
100100
}
101101
};
102102

103+
const stateIcon: Record<EventState, React.ReactNode> = {
104+
pending: <Clock className="w-4 h-4 text-yellow-500" />,
105+
inprogress: <CircleDashed className="w-4 h-4 text-blue-500 animate-spin" />,
106+
done: <CheckCircle2 className="w-4 h-4 text-green-500" />,
107+
error: <AlertCircle className="w-4 h-4 text-red-500" />,
108+
};
109+
103110
export function WriterCard({ message }: { message: Message }) {
104111
const [state, setState] = useState<WriterState>({
105112
retrieve: { state: null },
@@ -116,21 +123,6 @@ export function WriterCard({ message }: { message: Message }) {
116123
}
117124
}, [writerEvents]);
118125

119-
const getStateIcon = (state: EventState | null) => {
120-
switch (state) {
121-
case "pending":
122-
return <Clock className="w-4 h-4 text-yellow-500" />;
123-
case "inprogress":
124-
return <CircleDashed className="w-4 h-4 text-blue-500 animate-spin" />;
125-
case "done":
126-
return <CheckCircle2 className="w-4 h-4 text-green-500" />;
127-
case "error":
128-
return <AlertCircle className="w-4 h-4 text-red-500" />;
129-
default:
130-
return null;
131-
}
132-
};
133-
134126
if (!writerEvents?.length) {
135127
return null;
136128
}
@@ -167,7 +159,7 @@ export function WriterCard({ message }: { message: Message }) {
167159
<CollapsibleTrigger className="w-full">
168160
<div className="flex items-center gap-2 p-3 hover:bg-gray-50 transition-colors rounded-lg border border-gray-200">
169161
<div className="flex-shrink-0">
170-
{getStateIcon(question.state)}
162+
{stateIcon[question.state]}
171163
</div>
172164
<span className="font-medium text-left flex-1">
173165
{question.question}

0 commit comments

Comments
 (0)