mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 06:23:52 +08:00
feat: optimize ILLMService interface to support different models for each component
- Add LLMServiceConfig to support mixed model configuration - Enable Planner, Asserter, Querier to use different optimal models - Provide recommended configurations for various use cases - Maintain backward compatibility with existing API - Update documentation to reflect current state without iteration history - Merge test files and add comprehensive configuration tests - Resolve circular dependency by moving config to option package
This commit is contained in:
15
uixt/sdk.go
15
uixt/sdk.go
@@ -33,13 +33,24 @@ func NewXTDriver(driver IDriver, opts ...option.AIServiceOption) (*XTDriver, err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if services.LLMService != "" {
|
||||
|
||||
// Handle LLM service initialization
|
||||
if services.LLMConfig != nil {
|
||||
// Use advanced LLM configuration if provided
|
||||
driverExt.LLMService, err = ai.NewLLMServiceWithOptionConfig(services.LLMConfig)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "init llm service with config failed")
|
||||
}
|
||||
} else if services.LLMService != "" {
|
||||
// Fallback to simple LLM service if no config provided
|
||||
driverExt.LLMService, err = ai.NewLLMService(services.LLMService)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "init llm service failed")
|
||||
}
|
||||
}
|
||||
|
||||
// Register uixt MCP tools to LLM service
|
||||
// Register uixt MCP tools to LLM service if it exists
|
||||
if driverExt.LLMService != nil {
|
||||
mcpTools := driverExt.client.Server.ListTools()
|
||||
einoTools := ai.ConvertMCPToolsToEinoToolInfos(mcpTools, "uixt")
|
||||
if err := driverExt.LLMService.RegisterTools(einoTools); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user