mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-23 18:21:58 +00:00
模型接入报错的说法与修复候选收尾(前端):助手栏照实显示存着的模型设定、能重新选「跟随默认」清掉失效的接入;检查器模型一栏说清留空用哪个接入;停用接入的后果写全;问题只认自己那一处的修复
- 助手栏「助手使用的模型」:读 GET /api/copilot/model 的 error,照实写在下拉下面,齿轮上加红点(收着时也看得出来)。存着的 设定下拉里列不出来(点名了接入,或模型不在可选列表中)时列成一项并选中,不再停在「跟随默认」——以前看着一切正常、 发出一句话才报错,而且再选「跟随默认」不算改动、清不掉存着的接入,报错又指到改不了它的设置页。这时发出的请求不带 模型,服务端按存着的整组取,和下拉上显示的一致; - 检查器模型一栏:节点(没写就是全图默认)点名了接入时,空选项和说明写「使用接入「X」的默认模型」;X 不存在、已停用时 空选项说状态、不写说明,不再和检查器顶上接入那条问题矛盾(同后端去掉「没有指定模型」那一条); - 设置页:接入编辑框「启用」旁、卡片上「已停用」的悬停说明写全停用的后果(指定它或它的模型的节点和设置运行时报错), 不只说下拉里看不到;门控、裁判、核查三格存着的接入名恰好是某个启用接入的模型时,补一句在这一组哪一栏用它,和服务端 保存时 422 的那句一致; - 发布前检查:点名的模型接入只认节点、字段都对得上的修复,没有就是这一处没有修复,不再退到同节点、同编号别处的修复 (同后端 annotate)——以前给不出修复的那一行下面会画着另一处的选项; - 说法收进 terms.ts(PROVIDER_REF_TEXT、ASSISTANT_MODEL_TEXT),getModel / setModel 的返回补上类型(CopilotModel)。 检查:check-studio 加一节(检查器空选项与说明、助手栏的错误与重新选择、发出的请求不带模型、390 宽不多撑出横向溢出), check-manage 加一节(停用后果、接入名恰好是模型名)并跟上 422 的新说法,check-publish 的伪造门禁照后端「没有修复时 不指到发布前检查」,加一节给不出修复的那一行不借同节点别处的修复。
This commit is contained in:
@@ -91,6 +91,19 @@ export interface ProviderTest {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/**
|
||||
* 助手当前用哪个模型(GET / PUT /api/copilot/model)。provider、model 是存着的设定;存的接入不存在、已停用(或只存了
|
||||
* 模型名、提供它的接入已停用)时实际什么都用不了:effective_* 为空,error 是和生成时报的同一句。老后端不给 error
|
||||
*/
|
||||
export interface CopilotModel {
|
||||
configured: boolean
|
||||
provider: string | null
|
||||
model: string | null
|
||||
effective_provider: string | null
|
||||
effective_model: string | null
|
||||
error?: string | null
|
||||
}
|
||||
|
||||
/** 还没保存的模型接入配置。带 id 表示在编辑已有的那个,api_key 留空沿用已存的 */
|
||||
export interface ProviderDraft {
|
||||
id?: string
|
||||
@@ -718,12 +731,9 @@ export const api = {
|
||||
layout: (graph: GraphSpec) => post<GraphSpec>('/copilot/layout', { graph }),
|
||||
fromRun: (runId: string, name?: string) =>
|
||||
post<any>('/copilot/from-run', { run_id: runId, name }),
|
||||
getModel: () => get<{
|
||||
configured: boolean; provider: string | null; model: string | null
|
||||
effective_provider: string | null; effective_model: string | null
|
||||
}>('/copilot/model'),
|
||||
getModel: () => get<CopilotModel>('/copilot/model'),
|
||||
setModel: (body: { provider?: string | null; model?: string | null }) =>
|
||||
put<any>('/copilot/model', body),
|
||||
put<CopilotModel>('/copilot/model', body),
|
||||
/** 跑完之后复核一次。干净的运行后端直接返回 verdict='ok',不调模型 */
|
||||
review: (body: { run_id: string; question: string }) =>
|
||||
post<ReviewResult>('/copilot/review', body),
|
||||
|
||||
Reference in New Issue
Block a user