Skip to content

Commit 621f598

Browse files
committed
WIP
1 parent 58f28a2 commit 621f598

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

packages/host/app/components/ai-assistant/message/index.gts

+18-9
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ class ScrollPosition extends Modifier<ScrollPositionSignature> {
182182

183183
export default class AiAssistantMessage extends Component<Signature> {
184184
@service private declare cardService: CardService;
185+
get isReasoningExpandedByDefault() {
186+
return (
187+
this.args.formattedReasoningContent &&
188+
this.args.formattedReasoningContent.toString().trim() !== 'Thinking...' &&
189+
this.args.isStreaming &&
190+
!this.args.formattedMessage
191+
);
192+
}
185193

186194
<template>
187195
<div
@@ -230,13 +238,15 @@ export default class AiAssistantMessage extends Component<Signature> {
230238
</div>
231239
{{/if}}
232240

233-
{{#if @formattedReasoningContent}}
234-
<div class='reasoning-content'>
235-
{{@formattedReasoningContent}}
236-
</div>
237-
{{/if}}
238-
239241
<div class='content' data-test-ai-message-content>
242+
{{#if @formattedReasoningContent}}
243+
<div class='reasoning-content'>
244+
<details open={{this.isReasoningExpandedByDefault}}>
245+
<summary>Thinking...</summary>
246+
{{@formattedReasoningContent}}
247+
</details>
248+
</div>
249+
{{/if}}
240250
{{#if (and @isFromAssistant @isStreaming)}}
241251
<FormattedMessage
242252
@renderCodeBlocks={{false}}
@@ -415,9 +425,8 @@ export default class AiAssistantMessage extends Component<Signature> {
415425
}
416426
417427
.reasoning-content {
418-
font-size: var(--boxel-font-xs);
419-
letter-spacing: var(--boxel-lsp-xs);
420-
color: var(--boxel-450);
428+
color: var(--boxel-300);
429+
font-style: italic;
421430
}
422431
423432
.error-container {

packages/runtime-common/matrix-constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const DEFAULT_LLM = 'openai/gpt-4o';
2121
export const DEFAULT_LLM_LIST = [
2222
'anthropic/claude-3.5-sonnet',
2323
'anthropic/claude-3.7-sonnet',
24+
'anthropic/claude-3.7-sonnet:thinking',
2425
'google/gemini-pro-1.5',
2526
'openai/gpt-4o',
2627
'openai/gpt-4o-mini',

0 commit comments

Comments
 (0)