oracle/oci-typescript-sdk

ToolCall class is missing fields

Opened this issue · 0 comments

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.