-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
571 variable interpolation #589
Conversation
iandjx
commented
Sep 30, 2024
•
edited
Loading
edited
- Enhanced the CrewAppForm component to handle variable choices and kickoff variables, including UI updates.
- Integrated variable selection and creation in SortableItem and TaskForm components.
- Added session variable update logic in StructuredInputForm with API integration.
- Refactored task building logic in agent-backend with helper functions and session variable interpolation.
- Simplified variable fetching logic in the database layer.
- Added new helper functions for task management in agent-backend.
- Improved session and task API logic to handle new variable-related features.
570 Add support for task output variables
e921be0
to
d3e0be8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments apply to agents and tasks even if I only commented one one
isStructuredOutput, | ||
variableIds: (variableIds || []).map(toObjectId) | ||
variableIds: (variableIds || []).map(toObjectId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A variable ID here can refer to a variable that was deleted
const selectedAgents = agentIds?.map(a => agentChoices.find(ac => ac._id === a)); | ||
const variableIdsOfSelectedAgents = selectedAgents?.map(a => a?.variableIds || []).flat(); | ||
const variablesOfSelectedAgents = variableIdsOfSelectedAgents?.map(v => | ||
variableChoices?.find(vc => vc._id === v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable may not be found, suggest to filter this list for safety but also handle this in backend when saving tasks, agents, etc
setKickOffVariables(v || []); | ||
}} | ||
options={combinedVariables.map(v => ({ | ||
label: v.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncaught error here because the variable can be null see above comment
webapp/src/controllers/session.ts
Outdated
crewAppVariables.push(...variables); | ||
|
||
variables.forEach(variable => { | ||
if (!crewAppVariables.some(v => (v._id as ObjectId).equals(variable._id))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable can be null, need to handle or filter above
Added changes such that error gets returned if a non-existent variable is included when adding a new agent/task or editing an agent/task Added logic to fitler out undefined variables in crewapp form tested by
|
…gital/agentcloud into 571-variable-interpolation