mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
fix: support combined LLMService with wings service
This commit is contained in:
+6
-15
@@ -27,10 +27,6 @@ func NewXTDriver(driver IDriver, opts ...option.AIServiceOption) (*XTDriver, err
|
||||
|
||||
var err error
|
||||
|
||||
// Initialize Wings service (always available)
|
||||
driverExt.WingsService = ai.NewWingsService()
|
||||
log.Info().Msg("Wings service initialized")
|
||||
|
||||
// Handle LLM service initialization
|
||||
if services.LLMConfig != nil {
|
||||
// Use advanced LLM configuration if provided
|
||||
@@ -53,15 +49,11 @@ func NewXTDriver(driver IDriver, opts ...option.AIServiceOption) (*XTDriver, err
|
||||
}
|
||||
|
||||
// Register uixt MCP tools to LLM service if it exists
|
||||
mcpTools := driverExt.client.Server.ListTools()
|
||||
einoTools := ai.ConvertMCPToolsToEinoToolInfos(mcpTools, "uixt")
|
||||
if err = driverExt.WingsService.RegisterTools(einoTools); err != nil {
|
||||
log.Debug().Err(err).Msg("Wings service ignoring tool registration (expected)")
|
||||
}
|
||||
|
||||
if driverExt.LLMService != nil {
|
||||
if err = driverExt.LLMService.RegisterTools(einoTools); err != nil {
|
||||
log.Warn().Err(err).Msg("failed to register uixt tools to LLM service")
|
||||
mcpTools := driverExt.client.Server.ListTools()
|
||||
einoTools := ai.ConvertMCPToolsToEinoToolInfos(mcpTools, "uixt")
|
||||
if err := driverExt.LLMService.RegisterTools(einoTools); err != nil {
|
||||
log.Warn().Err(err).Msg("failed to register uixt tools")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +63,8 @@ func NewXTDriver(driver IDriver, opts ...option.AIServiceOption) (*XTDriver, err
|
||||
// XTDriver = IDriver + AI
|
||||
type XTDriver struct {
|
||||
IDriver
|
||||
CVService ai.ICVService // OCR/CV
|
||||
LLMService ai.ILLMService // LLM (fallback service)
|
||||
WingsService ai.ILLMService // Wings API service (priority service)
|
||||
CVService ai.ICVService // OCR/CV
|
||||
LLMService ai.ILLMService // LLM
|
||||
|
||||
services *option.AIServiceOptions // AI services options
|
||||
client *MCPClient4XTDriver // MCP Client for built-in uixt server
|
||||
|
||||
Reference in New Issue
Block a user