OpenFn / OpenFn/apollo

job chat: the assistant needs to understand data flow, workflows, mappings

Open
#163 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
5
Forks
10
Avg merge
2d 20h
Merged PRs (30d)
17

Description

In the assistant prompt we don't do a good job of explaining what a step or job is. And I think that's hurting it.

For example, I saw a question today where a user wanted to generate a dhis2 job to insert a datavalueset. The assistant generated a perfectly good create() function, but the snippet sort of asks the user to hand-write their data into it.

here's the question:

write a job for me that creates new datavaluesets under the "Approved School CHP" organization unit

Here's the assistant's code:

create("dataValueSets", {
  orgUnit: "eoYV2p74eVz", // "Approved School CHP"
  dataSet: "DATASET_ID_HERE", // Replace with actual dataSet ID
  period: "PERIOD_HERE", // Replace with actual period, e.g., "202301" for January 2023
  dataValues: [
    {
      dataElement: "DATA_ELEMENT_ID_1",
      value: "VALUE_1"
    },
    {
      dataElement: "DATA_ELEMENT_ID_2",
      value: "VALUE_2"
    }
    // Add more dataValues as needed
  ]
});

But this isn't how workflows work, is it?

What the snippet actually needs to do is read the input - presumably from state.data - and map some values there into the create calll.

Ok, the assistant doesn't know what the incoming data or value sets look like. It hasn't been told. but it can ask, right? Or it can include some kind of stub code. It's not useful two generate example entries like this.

I think the assistant doesn't really "understand":

  1. this is one step in a workflow which transforms data
  2. users are not going to hand-write data
  3. Some data is "fixed", like the org unit, but some comes from state, like dataValues
  4. the role of state at all in this kind of function

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the assistant prompt and the workflow step context described in the issue, especially state.data and the create call. Done means the assistant can explain jobs as data transformations, distinguish fixed values from state-derived values, and request or safely stub missing input instead of generating hand-written example entries.

Written by the indexing model from the issue text.

Assessment

Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.