| 269 | return s.mainLoopModel; |
| 270 | } |
| 271 | export const call: LocalJSXCommandCall = async (onDone, _context, args) => { |
| 272 | args = args?.trim() || ''; |
| 273 | if (COMMON_INFO_ARGS.includes(args)) { |
| 274 | logEvent('tengu_model_command_inline_help', { |
| 275 | args: args as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS |
| 276 | }); |
| 277 | return <ShowModelAndClose onDone={onDone} />; |
| 278 | } |
| 279 | if (COMMON_HELP_ARGS.includes(args)) { |
| 280 | onDone('Run /model to open the model selection menu, or /model [modelName] to set the model.', { |
| 281 | display: 'system' |
| 282 | }); |
| 283 | return; |
| 284 | } |
| 285 | if (args) { |
| 286 | logEvent('tengu_model_command_inline', { |
| 287 | args: args as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS |
| 288 | }); |
| 289 | return <SetModelAndClose args={args} onDone={onDone} />; |
| 290 | } |
| 291 | return <ModelPickerWrapper onDone={onDone} />; |
| 292 | }; |
| 293 | function renderModelLabel(model: string | null): string { |
| 294 | const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting()); |
| 295 | return model === null ? `${rendered} (default)` : rendered; |