Skip to content

ToolCall class is missing fields #384

@inoop

Description

@inoop

Overview

The models.ToolCall class appears to be missing the name and arguments fields.

Description

When I call a generic model (e.g. LLama) with tools, I get the following AssistantMessage instance (raw json) from the model:

{
  "index": 0,
  "message": {
    "role": "ASSISTANT",
    "toolCalls": [
      {
        "type": "FUNCTION",
        "id": "call__egLN4oBTfqg3Gk3cfBXrg",
        "name": "adder",
        "arguments": "{\"a\": 333, \"b\": 666}"
      }
    ]
  },
  "pad": "aa"
}

Looking at the AssistantMessage class, there's a field called toolCalls which is of type Array<model.ToolCall> | undefined. Then, looking ath the ToolCall class, it's missing the name and arguments fields.

Workaround

This is mostly just confusing to developers, but since this is just a typing issue it can be worked around by upcasting to any and then extracting the desired fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions