Skip to content

Commit 82f6312

Browse files
authored
Add todo-list to index.md (commontoolsinc#2148)
1 parent ca7ee11 commit 82f6312

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

packages/patterns/index.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,29 @@ interface CounterOutput {
2525
}
2626
```
2727

28-
## `chatbot.tsx`
28+
## `todo-list.tsx`
2929

30-
A chatbot demo.
30+
A todo list with AI suggestions.
3131

3232
### Input Schema
3333

3434
```ts
35-
type ChatInput = {
36-
/** The system prompt */
37-
system: string;
38-
};
35+
interface TodoItem {
36+
title: string;
37+
done: Default<boolean, false>;
38+
}
39+
40+
interface Input {
41+
items: Cell<TodoItem[]>;
42+
}
3943
```
4044

4145
### Result Schema
4246

4347
```ts
44-
type ChatOutput = {
45-
messages: Array<BuiltInLLMMessage>;
46-
pending: boolean | undefined;
47-
addMessage: Stream<BuiltInLLMMessage>;
48-
clearChat: Stream<void>;
49-
cancelGeneration: Stream<void>;
50-
title: string;
51-
attachments: Array<PromptAttachment>;
52-
tools: any;
53-
};
48+
interface Output {
49+
items: Cell<TodoItem[]>;
50+
}
5451
```
5552

5653
## `note.tsx`

packages/patterns/todo-with-suggestion.tsx renamed to packages/patterns/todo-list.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ interface Output {
1818
export default pattern<Input, Output>(({ items }) => {
1919
// AI suggestion based on current todos
2020
const suggestion = Suggestion({
21-
situation: "Based on my todo list, use a pattern to help me.",
21+
situation:
22+
"Based on my todo list, use a pattern to help me. For sub-tasks and additional tasks, use a todo list.",
2223
context: { items },
2324
});
2425

0 commit comments

Comments
 (0)