Refactor AI Agent and AI Config handling across multiple files
- Updated function signatures to accept AI Agent and AI Config as non-pointer types for better clarity and safety. - Modified instances where AI Agent and AI Config were dereferenced to improve code readability. - Removed unnecessary nil checks for AI Agent and AI Config, simplifying the logic. - Adjusted related tests and services to align with the new function signatures. - Cleaned up code in runtime, skills, and executor packages to ensure consistency in handling AI configurations.
This commit is contained in:
@@ -50,7 +50,7 @@ func TestResolveBuildsStaticToolMetadata(t *testing.T) {
|
||||
})
|
||||
toolSet, err := r.Resolve(registry.Context{
|
||||
Conversation: &models.Conversation{ID: 1},
|
||||
AIAgent: &models.AIAgent{ID: 1},
|
||||
AIAgent: models.AIAgent{ID: 1},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("resolve returned error: %v", err)
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
type Context struct {
|
||||
Conversation *models.Conversation
|
||||
AIAgent *models.AIAgent
|
||||
AIConfig *models.AIConfig
|
||||
AIAgent models.AIAgent
|
||||
AIConfig models.AIConfig
|
||||
UserMessage *models.Message
|
||||
AllowedToolCodes []string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user