Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions console/web/src/components/chat/Composer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@ import { $createParagraphNode, $createTextNode, $getRoot } from 'lexical'
import { useState } from 'react'
import { fn } from 'storybook/test'
import { STATIC_FUNCTIONS } from '@/lib/functions'
import type { Attachment, Mode, ModelId, ModelOption } from '@/types/chat'
import type {
Attachment,
Mode,
ModelId,
ModelOption,
ThinkingLevel,
} from '@/types/chat'

const STORY_MODEL_OPTIONS: ModelOption[] = [
{
id: 'openai::gpt-5',
label: 'gpt-5',
contextWindow: 400_000,
supportsThinking: true,
reasoningEfforts: [
{ effort: 'none', description: 'fastest responses without reasoning' },
{ effort: 'minimal', description: 'minimal reasoning overhead' },
{ effort: 'low', description: 'quick reasoning for routine tasks' },
{ effort: 'medium', description: 'balanced reasoning and latency' },
{ effort: 'high', description: 'deeper reasoning for complex tasks' },
{ effort: 'xhigh', description: 'extended reasoning for hard tasks' },
{ effort: 'ultra', description: 'maximum model-native reasoning' },
],
},
{
id: 'anthropic::claude-opus-4-7',
Expand All @@ -24,6 +39,12 @@ const STORY_MODEL_OPTIONS: ModelOption[] = [
contextWindow: 400_000,
supportsThinking: true,
},
{
id: 'openai::gpt-4.1',
label: 'gpt-4.1',
contextWindow: 1_000_000,
supportsThinking: false,
},
]

import { Composer } from './Composer'
Expand Down Expand Up @@ -73,15 +94,16 @@ function ComposerHarness({
}) {
const [mode, setMode] = useState<Mode>(initialMode)
const [model, setModel] = useState<ModelId>(initialModel)
const [thinkingLevel, setThinkingLevel] = useState<ThinkingLevel>('default')
return (
<Composer
mode={mode}
model={model}
modelOptions={STORY_MODEL_OPTIONS}
functionEntries={STATIC_FUNCTIONS}
permissionMode="manual"
thinkingLevel="off"
onThinkingLevelChange={fn()}
thinkingLevel={thinkingLevel}
onThinkingLevelChange={setThinkingLevel}
onModeChange={setMode}
onModelChange={setModel}
onPermissionModeChange={fn()}
Expand Down
Loading
Loading