Skip to content

[Enhancement] Preserve all LLM function call parameters for multi-field actions #1468

Description

@cutepawss

Problem

When using LLM function calling with multi-parameter actions, only one parameter is preserved. All other parameters are silently dropped.

Root Cause

Two files contribute to this issue:

1. src/llm/function_schemas.py (line 154-168)

The convert_function_calls_to_actions function extracts only a single value:

action_value = args.get("action", "")

if not action_value:
    for param in ["text", "message", "value", "command"]:
        if param in args:
            action_value = args[param]
            break

if not action_value and args:
    action_value = str(list(args.values())[0])

All other parameters are discarded.

2. src/actions/orchestrator.py (line 335)

The _promise_action function hardcodes a single parameter:

input_interface = T.get_type_hints(agent_action.interface)["input"](
    **{"action": action.value}
)

Example

LLM returns:

{"name": "pay", "arguments": {"amount": "0.01", "currency": "ETH", "recipient": "0x..."}}

Expected: All 3 parameters passed to PaymentInput
Actual: Only one value extracted, others lost

Proposed Solution

  1. In function_schemas.py: Store all arguments as JSON string in action.value
  2. In orchestrator.py: Parse JSON and pass all fields to the interface
  3. Fallback to current behavior for backward compatibility

Context

Discovered while implementing Bounty #367 (Smart Assistant + Wallet Payments).
I have a working implementation ready to submit as PR if approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions