Closed creatorrr closed 2 days ago
@creatorrr could you plz elaborate what to fix here? Here's the code sample:
client = Client(base_url=base_url, api_key=dev_api_key)
agent = client.agents.create(
name="Jessica",
about="a helpful AI assistant",
model="gpt-4o",
)
print(f"agent: {agent.id}")
task_def = yaml.safe_load(open("wf.yaml"))
task = client.tasks.create(agent_id=agent.id, **task_def)
print("task ID", task.id)
t = client.tasks.get(task_id=task.id)
print("+++", t.run_browser)
print("++++", t.check_goal_status)
and here's the output
+++ [{'arguments': {'messages': '_.messages', 'recall': 'False', 'session_id': '_.julep_session_id'}, 'kind_': 'tool_call', 'tool': 'session_chat'}, {'evaluate': {'content': '_.choices[0].message.content', 'tool_calls': "[ { 'tool_call_id': tool_call.id, 'action': load_json(tool_call.function.arguments)['action'], 'text': load_json(tool_call.function.arguments).get('text'), 'coordinate': load_json(tool_call.function.arguments).get('coordinate') } for tool_call in _.choices[0].message.tool_calls or [] if tool_call.type == 'function']"}, 'kind_': 'evaluate'}, {'foreach': {'do': {'arguments': {'action': "_.action if not (str(_.get('text', '')).startswith('http') and _.action == 'type') else 'navigate'", 'connect_url': 'inputs[0].cdp_url', 'coordinate': "_.get('coordinate')", 'text': "_.get('text')"}, 'kind_': 'tool_call', 'tool': 'perform_browser_action'}, 'in_': '_.tool_calls'}, 'kind_': 'foreach'}, {'evaluate': {'contents': "[{ 'type': 'image_url', 'image_url': { 'url': result['base64_image'], } } if result['base64_image'] is not None else { 'type': 'text', 'text': result['output'] if result['output'] is not None else 'done' } for result in _]"}, 'kind_': 'evaluate'}, {'evaluate': {'messages': "[{'content': [_.contents[i]], 'role': 'tool', 'name': 'computer', 'tool_call_id': outputs[1].tool_calls[i].tool_call_id} for i in range(len(_.contents))]"}, 'kind_': 'evaluate'}, {'arguments': {'cdp_url': 'inputs[0].cdp_url', 'julep_session_id': 'inputs[0].julep_session_id', 'messages': '_.messages', 'workflow_label': "'check_goal_status'"}, 'kind_': 'yield', 'workflow': 'check_goal_status'}]
++++ [{'if_': 'len(_.messages) > 0', 'kind_': 'if_else', 'then': {'arguments': {'cdp_url': '_.cdp_url', 'julep_session_id': '_.julep_session_id', 'messages': '_.messages', 'workflow_label': "'run_browser'"}, 'kind_': 'yield', 'workflow': 'run_browser'}}]
I can't do model_dump() because I am getting an exception: TypeError: 'MockValSer' object cannot be converted to 'SchemaSerializer'
, but this is out of scope
@whiterabbit1983 which sdk version are you using? I've just checked it again on the latest version as of now which is1.42.0
, and it still produces the same behaviour as reported in the issue.
@HamadaSalhab I use the latest from the repo
Upd: Wait, now this is reproducible
📜 Description
No response
👟 Reproduction steps
👀 Have you searched previous issues to see if this has been raised before?