构造函数
constructor
new AgentService( dataDir: string, config?: Partial<AgentConfig>, llmConfig?: LLMConfig, sharedLLMService?: LLMService, sharedToolRegistry?: ToolRegistry,): AgentService 参数
- dataDir: string
可选config: Partial<AgentConfig>可选llmConfig: LLMConfig可选sharedLLMService: LLMService可选sharedToolRegistry: ToolRegistry
方法
setLLMConfig
setLLMConfig(config: LLMConfig): void
setPrompts
setPrompts(prompts: Partial<AgentPrompts> | null): void 参数
- prompts: Partial<AgentPrompts> | null
返回 void
setBrowserSessionManager
setBrowserSessionManager(manager: BrowserSessionManager | null): void 参数
- manager: BrowserSessionManager | null
返回 void
setProjectRoot
setProjectRoot(root: string): void
getProjectContext
getProjectContext(): ProjectContext | null
plan
plan( description: string, options?: { seedTest?: string; prdPath?: string; outputDir?: string },): Promise<AgentResult<TestPlan>> 参数
- description: string
可选options: { seedTest?: string; prdPath?: string; outputDir?: string }
generate
generate( planPath: string, options?: { outputDir?: string; seedTest?: string },): Promise<AgentResult<string[]>> 参数
- planPath: string
可选options: { outputDir?: string; seedTest?: string }
heal
heal( testFilePath: string, options?: { runId?: string; testId?: string; error?: string; stackTrace?: string; },): Promise<AgentResult<AgentHealResult>> 参数
- testFilePath: string
可选options: { runId?: string; testId?: string; error?: string; stackTrace?: string }
parseMarkdownPlan
parseMarkdownPlan(filePath: string): TestPlan | null
createSessionContext
createSessionContext(): AgentSessionContext
AgentService — 向后兼容类。 新代码请使用 UnifiedAIService。