fix(llm-replay): publish recorded model capacity

This commit is contained in:
Tianyi Cui
2026-07-21 18:57:25 +08:00
parent 1cee25fdea
commit 39c9bf3ef2
5 changed files with 24 additions and 5 deletions
+5 -1
View File
@@ -1,5 +1,5 @@
import type { Context } from 'cordis'
import type { GenerateOptions, LlmModelInfo, StreamChunk } from '@deepseek-ai/dsh-llm'
import type { GenerateOptions, LlmModelContext, LlmModelInfo, StreamChunk } from '@deepseek-ai/dsh-llm'
import { CallId, LlmAdapter } from '@deepseek-ai/dsh-llm'
const CONTROL_PROBE = '\u001b]2;MODEL_CONTROLLED\u0007\u001b[999CMODEL_CURSOR\u009b31mMODEL_C1'
@@ -25,6 +25,10 @@ class ScriptedTuiAdapter extends LlmAdapter {
])
}
override resolveModelContext(_provider: string, _model: string): Promise<LlmModelContext> {
return Promise.resolve({ contextWindow: 128_000 })
}
override async * stream(options: GenerateOptions): AsyncIterable<StreamChunk> {
if (options.model !== 'tui-scripted-model-pro' || !options.system?.includes('tui-scripted-model-pro')) {
throw new Error('the scripted TUI request did not apply the selected model to routing and prompt variables')