Skip to content
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

Add the ability to define a variable for task output (including structured output) #570

Open
tomlynchRNA opened this issue Sep 17, 2024 · 1 comment
Assignees

Comments

@tomlynchRNA
Copy link
Contributor

  • For free text, a single variable name field for the whole task output
  • For structured output json, one variable name field per field

When a task completes, save the output or each structured output field to the variables on the session.

I included Charles for agent-backend help because its probably better to save these from the agent-backend side when theyre generated as opposed to trying to distinguish output messages inside the webapp socket handler.

ref #569

@iandjx
Copy link
Collaborator

iandjx commented Sep 24, 2024

@charl3sj I'll be adding a task property called taskOutputVariableName
intead of doing a regex search i.e.

if not task.isStructuredOutput:
        match = re.search(r'^{([\w_]+)}$', task.expected_output)
        if match:
            var_name = match.group(1)
            session_variables = session.variables.copy()
            session_variables[var_name] = str(task_output)

get the variable name from task.taskOuputVariableName and update the session variable with that key value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants