refactor(agent): own model selection on each agent
This commit is contained in:
1 parent
639602e63a
commit
a9c006f9c3
237 files changed
+1051
-1734
No files matched your search
@@ -5,7 +5,7 @@ import { mkdir } from 'node:fs/promises'
|
||||
import type { Context } from '@deepseek-ai/cordis'
|
||||
import type { Agent, AgentOptions, AgentSetup } from '@deepseek-ai/dsh-agent'
|
||||
import type {} from '@deepseek-ai/dsh-agent-default-model'
|
||||
import * as ModelSwitchNotice from '@deepseek-ai/dsh-agent-model/notice'
|
||||
import { installModelSelection } from '@deepseek-ai/dsh-agent'
|
||||
import type {} from '@deepseek-ai/dsh-agent-preset-registry'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
import type { Session, SessionId } from '@deepseek-ai/dsh-session'
|
||||
@@ -306,13 +306,13 @@ export class ApiSessionAgentController {
|
||||
async composeAgent(presetId: string | undefined): Promise<ApiSessionComposition> {
|
||||
const presets = this.ctx.get('agentPresets')
|
||||
if (presets === undefined) {
|
||||
return { setup: async (agentCtx) => { await agentCtx.plugin(ModelSwitchNotice) } }
|
||||
return { setup: (agentCtx) => { installModelSelection(agentCtx) } }
|
||||
}
|
||||
const resolvedId = (await presets.resolve(presetId)).id
|
||||
return {
|
||||
agentPreset: resolvedId,
|
||||
setup: async (agentCtx) => {
|
||||
await agentCtx.plugin(ModelSwitchNotice)
|
||||
installModelSelection(agentCtx)
|
||||
await presets.mount(agentCtx, resolvedId)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user