convertMessage

fun convertMessage(message: Message, toolNames: List<String>): Message(source)

Converts the given message by formatting specific types of tool-related messages (e.g., MessagePart.Tool.Call and MessagePart.Tool.Result) into descriptive messages. If the message is not a tool-related message, it remains unchanged.

Return

The converted message, either modified if it's a tool-related message, or unchanged otherwise.

Parameters

message

The input message to be converted.

toolNames

The list of tool names used to determine which tools are present in the call. If not, the message part should be converted.