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:
@@ -28,7 +28,7 @@ func TestNormalizeAllowedToolCodes(t *testing.T) {
|
||||
|
||||
func TestToolCatalogResolveAllowedToolCodes(t *testing.T) {
|
||||
catalog := newToolCatalog()
|
||||
agent := &models.AIAgent{
|
||||
agent := models.AIAgent{
|
||||
AllowedMCPTools: `[{"toolCode":"graph/create_ticket_with_confirmation"},{"toolCode":"graph/handoff_to_human"}]`,
|
||||
}
|
||||
skill := &models.SkillDefinition{
|
||||
@@ -45,7 +45,7 @@ func TestToolCatalogResolveAllowedToolCodes(t *testing.T) {
|
||||
|
||||
func TestToolCatalogResolveAllowedToolCodesFallsBackWhenSkillEmpty(t *testing.T) {
|
||||
catalog := newToolCatalog()
|
||||
agent := &models.AIAgent{
|
||||
agent := models.AIAgent{
|
||||
AllowedMCPTools: `[{"toolCode":"graph/create_ticket_with_confirmation"},{"toolCode":"graph/handoff_to_human"}]`,
|
||||
}
|
||||
ret := catalog.resolveAllowedToolCodes(agent, nil)
|
||||
|
||||
Reference in New Issue
Block a user