smoltalk
Preparing search index...
AssistantMessage
Class AssistantMessage
Hierarchy (
View Summary
)
BaseMessage
AssistantMessage
Implements
MessageClass
Index
Constructors
constructor
Properties
_
audio?
_
content
_
cost?
_
name?
_
raw
Data?
_
refusal?
_
role
_
thinking
Blocks?
_
tool
Calls?
_
usage?
Accessors
audio
content
cost
name
raw
Data
refusal
role
thinking
Blocks
tool
Calls
usage
Methods
content
To
String
to
Anthropic
Message
to
Google
Message
to
JSON
to
Ollama
Message
to
Open
AI
Message
to
Open
AI
Response
Input
Item
from
JSON
Constructors
constructor
new
AssistantMessage
(
content
:
string
|
TextPart
[]
|
null
,
options
?:
{
audio
?:
any
;
cost
?:
CostEstimate
;
name
?:
string
;
rawData
?:
any
;
refusal
?:
string
|
null
;
thinkingBlocks
?:
ThinkingBlock
[]
;
toolCalls
?:
ToolCall
[]
;
usage
?:
TokenUsage
;
}
,
)
:
AssistantMessage
Parameters
content
:
string
|
TextPart
[]
|
null
options
:
{
audio
?:
any
;
cost
?:
CostEstimate
;
name
?:
string
;
rawData
?:
any
;
refusal
?:
string
|
null
;
thinkingBlocks
?:
ThinkingBlock
[]
;
toolCalls
?:
ToolCall
[]
;
usage
?:
TokenUsage
;
}
= {}
Returns
AssistantMessage
Properties
Optional
_
audio
_audio
?:
any
_
content
_content
:
string
|
TextPart
[]
|
null
Optional
_
cost
_cost
?:
CostEstimate
Optional
_
name
_name
?:
string
Optional
_
raw
Data
_rawData
?:
any
Optional
_
refusal
_refusal
?:
string
|
null
_
role
_role
:
"assistant"
= ...
Optional
_
thinking
Blocks
_thinkingBlocks
?:
ThinkingBlock
[]
Optional
_
tool
Calls
_toolCalls
?:
ToolCall
[]
Optional
_
usage
_usage
?:
TokenUsage
Accessors
audio
get
audio
()
:
any
Returns
any
content
get
content
()
:
string
Returns
string
set
content
(
value
:
string
)
:
void
Parameters
value
:
string
Returns
void
cost
get
cost
()
:
CostEstimate
|
undefined
Returns
CostEstimate
|
undefined
name
get
name
()
:
string
|
undefined
Returns
string
|
undefined
raw
Data
get
rawData
()
:
any
Returns
any
refusal
get
refusal
()
:
string
|
null
|
undefined
Returns
string
|
null
|
undefined
role
get
role
()
:
"assistant"
Returns
"assistant"
thinking
Blocks
get
thinkingBlocks
()
:
ThinkingBlock
[]
|
undefined
Returns
ThinkingBlock
[]
|
undefined
tool
Calls
get
toolCalls
()
:
ToolCall
[]
|
undefined
Returns
ToolCall
[]
|
undefined
usage
get
usage
()
:
TokenUsage
|
undefined
Returns
TokenUsage
|
undefined
Methods
Protected
content
To
String
contentToString
(
content
:
string
|
unknown
[]
|
null
|
undefined
)
:
string
Parameters
content
:
string
|
unknown
[]
|
null
|
undefined
Returns
string
to
Anthropic
Message
toAnthropicMessage
()
:
{
content
:
|
string
|
(
|
{
signature
:
string
;
thinking
:
string
;
type
:
"thinking"
}
|
{
text
:
string
;
type
:
"text"
}
|
{
id
:
string
;
input
:
Record
<
string
,
any
>
;
name
:
string
;
type
:
"tool_use"
;
}
)
[]
;
role
:
"assistant"
;
}
Returns
{
content
:
|
string
|
(
|
{
signature
:
string
;
thinking
:
string
;
type
:
"thinking"
}
|
{
text
:
string
;
type
:
"text"
}
|
{
id
:
string
;
input
:
Record
<
string
,
any
>
;
name
:
string
;
type
:
"tool_use"
;
}
)
[]
;
role
:
"assistant"
;
}
to
Google
Message
toGoogleMessage
()
:
Content
Returns
Content
to
JSON
toJSON
()
:
{
audio
?:
any
;
content
:
string
|
{
text
:
string
;
type
:
"text"
}
[]
|
null
;
cost
?:
{
cachedInputCost
?:
number
;
currency
:
string
;
inputCost
:
number
;
outputCost
:
number
;
totalCost
:
number
;
}
;
name
?:
string
;
rawData
?:
any
;
refusal
?:
string
|
null
;
role
:
"assistant"
;
thinkingBlocks
?:
{
signature
:
string
;
text
:
string
}
[]
;
toolCalls
?:
{
arguments
:
Record
<
string
,
any
>
;
id
:
string
;
name
:
string
}
[]
;
usage
?:
{
cachedInputTokens
?:
number
;
inputTokens
:
number
;
outputTokens
:
number
;
totalTokens
?:
number
;
}
;
}
Returns
{
audio
?:
any
;
content
:
string
|
{
text
:
string
;
type
:
"text"
}
[]
|
null
;
cost
?:
{
cachedInputCost
?:
number
;
currency
:
string
;
inputCost
:
number
;
outputCost
:
number
;
totalCost
:
number
;
}
;
name
?:
string
;
rawData
?:
any
;
refusal
?:
string
|
null
;
role
:
"assistant"
;
thinkingBlocks
?:
{
signature
:
string
;
text
:
string
}
[]
;
toolCalls
?:
{
arguments
:
Record
<
string
,
any
>
;
id
:
string
;
name
:
string
}
[]
;
usage
?:
{
cachedInputTokens
?:
number
;
inputTokens
:
number
;
outputTokens
:
number
;
totalTokens
?:
number
;
}
;
}
to
Ollama
Message
toOllamaMessage
()
:
Message
Returns
Message
to
Open
AI
Message
toOpenAIMessage
()
:
ChatCompletionMessageParam
Returns
ChatCompletionMessageParam
to
Open
AI
Response
Input
Item
toOpenAIResponseInputItem
()
:
ResponseInputItem
|
ResponseInputItem
[]
Returns
ResponseInputItem
|
ResponseInputItem
[]
Static
from
JSON
fromJSON
(
json
:
unknown
)
:
AssistantMessage
Parameters
json
:
unknown
Returns
AssistantMessage
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
_
audio
_
content
_
cost
_
name
_
raw
Data
_
refusal
_
role
_
thinking
Blocks
_
tool
Calls
_
usage
Accessors
audio
content
cost
name
raw
Data
refusal
role
thinking
Blocks
tool
Calls
usage
Methods
content
To
String
to
Anthropic
Message
to
Google
Message
to
JSON
to
Ollama
Message
to
Open
AI
Message
to
Open
AI
Response
Input
Item
from
JSON
smoltalk
Loading...