|
49 | 49 | "Let's consider the user's question step by step:\\n\\n1. Identify the core problem\\n2. Evaluate relevant information\\n3. Formulate a clear answer\\n\\nFollowing this process ensures the final response stays focused and accurate.", |
50 | 50 | children: [] |
51 | 51 | }; |
| 52 | + const rawOutputMessage: DatabaseMessage = { |
| 53 | + id: '6', |
| 54 | + convId: 'conv-1', |
| 55 | + type: 'message', |
| 56 | + timestamp: Date.now() - 1000 * 60, |
| 57 | + role: 'assistant', |
| 58 | + content: |
| 59 | + '<|channel|>analysis<|message|>User greeted me. Initiating overcomplicated analysis: Is this a trap? No, just a normal hello. Respond calmly, act like a helpful assistant, and do not start explaining quantum physics again. Confidence 0.73. Engaging socially acceptable greeting protocol...<|end|>Hello there! How can I help you today?', |
| 60 | + parent: '1', |
| 61 | + thinking: '', |
| 62 | + children: [] |
| 63 | + }; |
| 64 | +
|
52 | 65 |
|
53 | 66 | let processingMessage = $state({ |
54 | 67 | id: '4', |
|
80 | 93 | args={{ |
81 | 94 | message: userMessage |
82 | 95 | }} |
| 96 | + play={async () => { |
| 97 | + const { updateConfig } = await import('$lib/stores/settings.svelte'); |
| 98 | + updateConfig('disableReasoningFormat', false); |
| 99 | + }} |
83 | 100 | /> |
84 | 101 |
|
85 | 102 | <Story |
|
88 | 105 | class: 'max-w-[56rem] w-[calc(100vw-2rem)]', |
89 | 106 | message: assistantMessage |
90 | 107 | }} |
| 108 | + play={async () => { |
| 109 | + const { updateConfig } = await import('$lib/stores/settings.svelte'); |
| 110 | + updateConfig('disableReasoningFormat', false); |
| 111 | + }} |
91 | 112 | /> |
92 | 113 |
|
93 | 114 | <Story |
|
96 | 117 | class: 'max-w-[56rem] w-[calc(100vw-2rem)]', |
97 | 118 | message: assistantWithReasoning |
98 | 119 | }} |
| 120 | + play={async () => { |
| 121 | + const { updateConfig } = await import('$lib/stores/settings.svelte'); |
| 122 | + updateConfig('disableReasoningFormat', false); |
| 123 | + }} |
| 124 | +/> |
| 125 | + |
| 126 | +<Story |
| 127 | + name="RawLlmOutput" |
| 128 | + args={{ |
| 129 | + class: 'max-w-[56rem] w-[calc(100vw-2rem)]', |
| 130 | + message: rawOutputMessage |
| 131 | + }} |
| 132 | + play={async () => { |
| 133 | + const { updateConfig } = await import('$lib/stores/settings.svelte'); |
| 134 | + updateConfig('disableReasoningFormat', true); |
| 135 | + }} |
99 | 136 | /> |
100 | 137 |
|
101 | 138 | <Story |
|
105 | 142 | }} |
106 | 143 | asChild |
107 | 144 | play={async () => { |
| 145 | + const { updateConfig } = await import('$lib/stores/settings.svelte'); |
| 146 | + updateConfig('disableReasoningFormat', false); |
108 | 147 | // Phase 1: Stream reasoning content in chunks |
109 | 148 | let reasoningText = |
110 | 149 | 'I need to think about this carefully. Let me break down the problem:\n\n1. The user is asking for help with something complex\n2. I should provide a thorough and helpful response\n3. I need to consider multiple approaches\n4. The best solution would be to explain step by step\n\nThis approach will ensure clarity and understanding.'; |
@@ -156,6 +195,8 @@ asChild |
156 | 195 | message: processingMessage |
157 | 196 | }} |
158 | 197 | play={async () => { |
| 198 | + const { updateConfig } = await import('$lib/stores/settings.svelte'); |
| 199 | + updateConfig('disableReasoningFormat', false); |
159 | 200 | // Import the chat store to simulate loading state |
160 | 201 | const { chatStore } = await import('$lib/stores/chat.svelte'); |
161 | 202 |
|
|
0 commit comments