ModelAssistantToolMessage
CORE · type · Type contract
Assistant turn that may declare tool calls and may carry an empty text body.
Import
ts
import type { ModelAssistantToolMessage } from '@jangts/agent-core/types';1
js
/** @typedef {import('@jangts/agent-core/types').ModelAssistantToolMessage} ModelAssistantToolMessage */1
Other public entry points:@jangts/agent-core/types, @jangts/agent-core/structs.
Definition
Type: ModelAssistantToolMessage
Type expression
ts
type ModelAssistantToolMessage = ModelMessage & {
readonly role: 'assistant';
readonly toolCalls?: readonly ModelToolCall[];
readonly toolCallId?: never;
readonly images?: never;
};1
2
3
4
5
6
2
3
4
5
6
Field structure
| Field | Type | Required | Description |
|---|---|---|---|
role | "assistant" | Required | See the type definition and usage context. |
content | string | Required | Rendered text content sent to the model. |
images | undefined | Optional | User-supplied visual input. Binary payload is separate from the text character budget. |
toolCalls | readonly ModelToolCall[] | undefined | Optional | Tool declarations made by an assistant turn; rejected on every other role at runtime. |
toolCallId | undefined | Optional | Call id answered by a tool result; rejected on every other role at runtime. |
Using the type
Read the contract at the call site
ts
import type { ModelAssistantToolMessage } from '@jangts/agent-core/types';
// Keep the original contract at the call site; TS and JS share the same runtime behavior.
function inspect(value: ModelAssistantToolMessage) {
return value.role;
}1
2
3
4
5
6
2
3
4
5
6
js
/** @param {import('@jangts/agent-core/types').ModelAssistantToolMessage} value */
function inspect(value) {
return value.role;
}1
2
3
4
2
3
4