-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementEnhance an existing featureEnhance an existing feature
Description
Description
I am using Qwen2.5 as my llm. When calling the end_turn tool in multiagent tasks, the "end_turn" tool is called with None for the arguments, rather than an empty dictionary as is done with gpt.
This causes this error:
| ERROR | Task run 'Tool call: end_turn' - Task run failed with exception: TypeError('controlflow.orchestration.turn_strategies.get_end_turn_tool..end_turn() argument after ** must be a mapping, not NoneType') - Retries are exhausted Traceback (most recent call last): controlflow
The issue is this part of the file tools/tools.py
(around line 60)
@prefect_task(task_run_name="Tool call: {self.name}")
def run(self, input: dict):
result = self.fn(**input)
This issue is resolved if a check for None is added:
@prefect_task(task_run_name="Tool call: {self.name}")
def run(self, input: dict):
# Set input to an empty dictionary if it is None
input = input or {}
result = self.fn(**input)
Example Code
import controlflow as cf
model = ChatOpenAI(temperature=0.0, model="Qwen/Qwen2.5-7B-Instruct", base_url="my-vllm-server/v1")
optimist = cf.Agent(
name="Optimist",
instructions="Always find the best in every situation.",
model=model
)
pessimist = cf.Agent(
name="Pessimist",
instructions="Always find the worst in every situation.",
model=model
)
cf.run(
f"Debate world peace",
instructions=(
"Mark the task successful once both agents have have spoken"
),
agents=[optimist, pessimist],
)
Version Information
control flow version: 0.11.2
python 3.11.0
Additional Context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationenhancementEnhance an existing featureEnhance an existing feature