Skip to content

solve the “undefined variables ‘context’” problem #1853

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

notoufa
Copy link

@notoufa notoufa commented Jun 26, 2025

#1839
There does appear to be a real issue here, likely caused by a minor mistake during development. In the ActionNode.fill method, the parameter is incorrectly named req, while in template/operator.py, the _fill_node function explicitly passes an argument named context, leading to a parameter mismatch.

Here is a minimal reproduction of the inconsistency:

# template/operator.py
async def _fill_node(self, op_class, prompt, mode=None, **extra_kwargs):
    fill_kwargs = {"context": prompt, "llm": self.llm}
    if mode:
        fill_kwargs["mode"] = mode
    fill_kwargs.update(extra_kwargs)
    node = await ActionNode.from_pydantic(op_class).fill(**fill_kwargs)
    return node.instruct_content.model_dump()
# actions/action_node.py
async def fill(
    self,
    *,
    req,  # ← This should be `context`
    llm,
    schema="json",
    mode="auto",
    strgy="simple",
    images: Optional[Union[str, list[str]]] = None,
    timeout=USE_CONFIG_TIMEOUT,
    exclude=[],
    function_name: str = None,
):
    pass

Since the ActionNode class consistently uses context as the field name, changing the parameter name in fill from req to context should resolve the issue.


In addition, I noticed that during dataset evaluation via benchmark.run_evaluation, up to 50 asynchronous tasks may run concurrently. When using LLMs that produce streaming output, this results in interleaved outputs from different tasks being printed to the terminal, making logs difficult to read and debug.

It might be more helpful to either:

  • Disable streaming output during evaluation, or
  • Wait for each task to finish and then print the question and its answer together

This would make evaluation logs much more manageable.


Lastly, I’ve encountered a few other small issues during usage. It also seems that the project hasn’t seen recent updates or bug fixes, which makes me wonder if it’s still actively maintained. That would be unfortunate, as this is a valuable and meaningful project with great potential.

If needed, I’d be happy to contribute fixes via pull requests. Thank you for the great work so far!

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

Successfully merging this pull request may close these issues.

1 participant