2 Messages🔗ℹ

(message role content tool-calls tool-call-id name) -> message?

  role       : (or/c 'system 'user 'assistant 'tool)

  content    : (or/c string? #f)

  tool-calls : (listof tool-call?)

  tool-call-id : (or/c string? #f)

  name       : (or/c string? #f)

Constructors: system-message, user-message, assistant-message, tool-result-message. At the edge, normalize-messages also accepts bare strings (user messages) and (list role content) forms; everything downstream sees structs only. An assistant message must carry content or tool calls; a tool result must carry its #:tool-call-id. Wire formats never leak into user code.