-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jicheng Lu
committed
Nov 21, 2024
1 parent
b98542b
commit f563594
Showing
7 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { UserAction } from '../enums'; | ||
|
||
export const AgentExtensions = { | ||
chatable: (/** @type {import('$agentTypes').AgentModel} */ agent) => { | ||
if (agent == null || agent.id == null) { | ||
return false; | ||
} | ||
|
||
if (agent.actions == null) { | ||
return true; | ||
} | ||
return agent.actions.includes(UserAction.Chat); | ||
}, | ||
editable: (/** @type {import('$agentTypes').AgentModel} */ agent) => { | ||
if (agent == null || agent.id == null) { | ||
return false; | ||
} | ||
|
||
if (agent.actions == null) { | ||
return true; | ||
} | ||
return agent.actions.includes(UserAction.Edit); | ||
}, | ||
trainable: (/** @type {import('$agentTypes').AgentModel} */ agent) => { | ||
if (agent == null || agent.id == null) { | ||
return false; | ||
} | ||
|
||
if (agent.actions == null) { | ||
return true; | ||
} | ||
return agent.actions.includes(UserAction.Train); | ||
}, | ||
evaluable: (/** @type {import('$agentTypes').AgentModel} */ agent) => { | ||
if (agent == null || agent.id == null) { | ||
return false; | ||
} | ||
|
||
if (agent.actions == null) { | ||
return true; | ||
} | ||
return agent.actions.includes(UserAction.Edit); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters