Skip to content

Commit

Permalink
feat(agent): add enabled flag to CustomAgentConfig #195
Browse files Browse the repository at this point in the history
Add an `enabled` flag to CustomAgentConfig and filter enabled agents.
  • Loading branch information
phodal committed May 29, 2024
1 parent efb06f3 commit 0dfaa32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ data class CustomAgentConfig(
val interactive: InteractionType = InteractionType.ChatPanel,
val auth: CustomAgentAuth? = null,
val defaultTimeout: Long = 10,
val enabled: Boolean = true,
) {
var state: CustomAgentState = CustomAgentState.START

Expand All @@ -67,7 +68,11 @@ data class CustomAgentConfig(
} catch (e: Exception) {
emptyList()
}
return configs

/**
* Only return enabled agents
*/
return configs.filter { it.enabled }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
},
"defaultTimeout": {
"type": "number"
},
"enabled": {
"type": "boolean"
}
},
"required": [
Expand Down

0 comments on commit 0dfaa32

Please sign in to comment.