feat: Refactor agent configuration by removing deprecated parameters and enhancing conversation model management
- Removed the `thinkingModelId` and `rerankModelId` from agent configuration, streamlining the settings structure. - Introduced a new `conversationModels` interface to manage summary and rerank model IDs. - Updated related UI components and API logic to accommodate the changes in agent configuration. - Enhanced localization for new conversation model settings in English, Russian, and Chinese.
This commit is contained in:
@@ -64,6 +64,8 @@ func NewAgentService(
|
||||
func (s *agentService) CreateAgentEngine(
|
||||
ctx context.Context,
|
||||
config *types.AgentConfig,
|
||||
chatModel chat.Chat,
|
||||
rerankModel rerank.Reranker,
|
||||
eventBus *event.EventBus,
|
||||
contextManager interfaces.ContextManager,
|
||||
sessionID string,
|
||||
@@ -76,20 +78,10 @@ func (s *agentService) CreateAgentEngine(
|
||||
return nil, fmt.Errorf("invalid agent config: %w", err)
|
||||
}
|
||||
|
||||
chatModel, err := s.modelService.GetChatModel(ctx, config.ThinkingModelID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get thinking model: %w", err)
|
||||
}
|
||||
|
||||
if chatModel == nil {
|
||||
return nil, fmt.Errorf("chat model is nil after initialization")
|
||||
}
|
||||
|
||||
rerankModel, err := s.modelService.GetRerankModel(ctx, config.RerankModelID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get rerank model: %w", err)
|
||||
}
|
||||
|
||||
if rerankModel == nil {
|
||||
return nil, fmt.Errorf("rerank model is nil after initialization")
|
||||
}
|
||||
@@ -264,10 +256,6 @@ func (s *agentService) ValidateConfig(config *types.AgentConfig) error {
|
||||
return fmt.Errorf("max iterations too high: %d (max %d)", config.MaxIterations, MAX_ITERATIONS)
|
||||
}
|
||||
|
||||
if config.ThinkingModelID == "" {
|
||||
return fmt.Errorf("ThinkingModelID is required but not set")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user