julep-ai / julep

A new DSL and server for AI agents and multi-step tasks
https://julep.ai
Apache License 2.0
2.57k stars 905 forks source link

[Bug]: tool call arguments mappin failure #799

Closed Vedantsahai18 closed 1 hour ago

Vedantsahai18 commented 3 hours ago

πŸ“œ Description

ERROR:agents_api.web:[{'type': 'missing', 'loc': ('body', 'main', 0, 'EvaluateStep', 'evaluate'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'dict_type', 'loc': ('body', 'main', 0, 'ToolCallStep', 'arguments', 'dict[str,union[dict[str,union[list[str],dict[str,str],list[dict[str,str]],str]],list[dict[str,union[list[str],dict[str,str],list[dict[str,str]],str]]],str]]'), 'msg': 'Input should be a valid dictionary', 'input': ['url']}, {'type': 'dict_type', 'loc': ('body', 'main', 0, 'ToolCallStep', 'arguments', 'list[dict[str,union[dict[str,union[list[str],dict[str,str],list[dict[str,str]],str]],list[dict[str,union[list[str],dict[str,str],list[dict[str,str]],str]]],str]]]', 0), 'msg': 'Input should be a valid dictionary', 'input': 'url'}, {'type': 'literal_error', 'loc': ('body', 'main', 0, 'ToolCallStep', 'arguments', "literal['_']"), 'msg': "Input should be '_'", 'input': ['url'], 'ctx': {'expected': "'_'"}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'PromptStep', 'prompt'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'GetStep', 'get'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'SetStep', 'set'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'LogStep', 'log'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'YieldStep', 'workflow'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'dict_type', 'loc': ('body', 'main', 0, 'YieldStep', 'arguments', 'dict[str,union[list[str],dict[str,str],list[dict[str,str]],str]]'), 'msg': 'Input should be a valid dictionary', 'input': ['url']}, {'type': 'literal_error', 'loc': ('body', 'main', 0, 'YieldStep', 'arguments', "literal['_']"), 'msg': "Input should be '_'", 'input': ['url'], 'ctx': {'expected': "'_'"}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'ReturnStep', 'return'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'SleepStep', 'sleep'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'ErrorWorkflowStep', 'error'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'WaitForInputStep', 'wait_for_input'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'IfElseWorkflowStep', 'if'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'IfElseWorkflowStep', 'then'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'SwitchStep', 'switch'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'ForeachStep', 'foreach'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'ParallelStep', 'parallel'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'Main', 'over'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}, {'type': 'missing', 'loc': ('body', 'main', 0, 'Main', 'map'), 'msg': 'Field required', 'input': {'tool': 'spider_crawler', 'arguments': ['url']}}]

πŸ‘Ÿ Reproduction steps

No response

πŸ‘€ Have you spent some time to check if this bug has been raised before?

Vedantsahai18 commented 3 hours ago
chat_task_def = yaml.safe_load(f"""
name: Browserbase Task

tools:
- name: computer
  type: computer_20241022
  computer_20241022:
    display_height_px: 768
    display_width_px: 1024
    display_number: 1

- name: create_session
  type: integration
  integration:
    provider: browserbase
    method: create_session
    setup:
      api_key: "{BROWSERBASE_API_KEY}"
      project_id: "{BROWSERBASE_PROJECT_ID}"

- name: get_live_urls
  type: integration
  integration:
    provider: browserbase
    method: get_live_urls
    setup:
      api_key: "{BROWSERBASE_API_KEY}"
      project_id: "{BROWSERBASE_PROJECT_ID}"

- name: get_connect_url
  type: integration
  integration:
    provider: browserbase
    method: get_connect_url
    setup:
      api_key: "{BROWSERBASE_API_KEY}"
      project_id: "{BROWSERBASE_PROJECT_ID}"

- name: perform_action
  type: integration
  integration:
    provider: remote_browser
    method: perform_action
    setup:
      width: "1024"
      height: "768"

- name: spider_crawler
  type: integration
  integration:
    provider: spider
    setup:
      spider_api_key: "KEY"

main:

- tool: spider_crawler
  arguments:
    url: "'https://julep.ai'"

# - prompt: 
#   - role: user
#     content: >-
#       You have access to a computer. Use it to tell me the current time.
#   disable_cache: true
#   auto_run_tools: true

# - tool: create_session
#   arguments:
#     project_id: "{BROWSERBASE_PROJECT_ID}"

# - evaluate:
#     session_id: "_['id']"

# - tool: get_live_urls
#   arguments:
#     id: "_['session_id']"

# - evaluate:
#     debugger_url: "_['urls']['debuggerUrl']"

# - tool: get_connect_url
#   arguments:
#     id: "outputs[1]['session_id']"

# - evaluate:
#     connect_url: "_['url']"

# - tool: perform_action
#   arguments:
#     connect_url: "_['connect_url']"
#     action: "navigate"
#     text: "'https://julep.ai'"
""")
Vedantsahai18 commented 3 hours ago
agents-api-multi-tenant-1      | Traceback (most recent call last):
gateway                        | 192.168.65.1 - - [01/Nov/2024:21:42:51 +0000] "POST /api/agents/224d2db7-a712-4e5d-9029-abc7a148c9a3/tasks/3dfafb4e-d217-442a-9e6d-b5cf008b976e HTTP/1.1" 422 4053 "-" "-" 5 "agents-api@file" "http://agents-api-multi-tenant:8080" 11ms
agents-api-multi-tenant-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
agents-api-multi-tenant-1      |     await app(scope, receive, sender)
agents-api-multi-tenant-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
agents-api-multi-tenant-1      |     response = await f(request)
agents-api-multi-tenant-1      |                ^^^^^^^^^^^^^^^^
agents-api-multi-tenant-1      |   File "/app/agents_api/routers/tasks/router.py", line 33, in custom_route_handler
agents-api-multi-tenant-1      |     return await original_route_handler(request)
agents-api-multi-tenant-1      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agents-api-multi-tenant-1      |   File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 346, in app
agents-api-multi-tenant-1      |     raise validation_error