agents / Exports / MessageConverter
Class: MessageConverter
Universal message converter utility Handles message format conversion between different providers
Table of contents
Constructors
Methods
Constructors
constructor
• new MessageConverter(): MessageConverter
Returns
Methods
toProviderFormat
▸ toProviderFormat(messages, providerName): ProviderMessage[]
Convert messages to provider-specific format
Parameters
| Name | Type |
|---|---|
messages | Message[] |
providerName | string |
Returns
ProviderMessage[]
Defined in
packages/agents/src/utils/message-converter.ts:46
extractSystemMessage
▸ extractSystemMessage(messages): undefined | string
Extract system message from messages
Parameters
| Name | Type |
|---|---|
messages | Message[] |
Returns
undefined | string
Defined in
packages/agents/src/utils/message-converter.ts:121
filterNonSystemMessages
▸ filterNonSystemMessages(messages): Message[]
Filter non-system messages
Parameters
| Name | Type |
|---|---|
messages | Message[] |
Returns
Message[]