fix: 提示词链里的引导提问不算轮数,分类器固定结果、跳过过短输入
- 引导对话和 AI 对话存在同一个对话里,提示词链把它当成一轮“AI 对话”,显示“没有网页”。 现在标成“引导”,淡化显示,不计入轮数,也不能选中(↑↓ 跳过) - 分类器 temperature 设为 0:同一句提示词以前约两成会被打成不同层级 - 不到 4 个字的提问(“1”“,”等)不打层级,--force 重标时清掉旧标签 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bc9da688ba
commit
30630e8125
6 files changed
+73
-10
No files matched your search
@@ -63,6 +63,7 @@ interface CompletionOptions {
|
||||
model?: string
|
||||
stream: boolean
|
||||
maxTokens?: number
|
||||
temperature?: number
|
||||
signal?: AbortSignal
|
||||
timeoutMs?: number
|
||||
}
|
||||
@@ -82,6 +83,7 @@ function buildRequest(messages: ChatMessage[], opts: CompletionOptions) {
|
||||
stream: opts.stream,
|
||||
}
|
||||
if (opts.maxTokens) body.max_tokens = opts.maxTokens
|
||||
if (opts.temperature !== undefined) body.temperature = opts.temperature
|
||||
const apiKey = ark ? config.arkApiKey : config.llmApiKey
|
||||
if (!apiKey) throw new Error("未配置模型接口密钥")
|
||||
const baseUrl = (ark ? config.arkBaseUrl : config.llmBaseUrl).replace(/\/$/, "")
|
||||
@@ -203,12 +205,13 @@ export function streamGuidance(history: ChatMessage[], signal?: AbortSignal) {
|
||||
|
||||
export async function complete(
|
||||
messages: ChatMessage[],
|
||||
opts: { model?: string; maxTokens?: number; timeoutMs?: number } = {},
|
||||
opts: { model?: string; maxTokens?: number; temperature?: number; timeoutMs?: number } = {},
|
||||
): Promise<string> {
|
||||
const res = await buildRequest(messages, {
|
||||
model: opts.model ?? config.llmModel,
|
||||
stream: false,
|
||||
maxTokens: opts.maxTokens,
|
||||
temperature: opts.temperature,
|
||||
timeoutMs: opts.timeoutMs,
|
||||
})
|
||||
await ensureOk(res)
|
||||
|
||||
Reference in new issue
Block a user