When the Chat view appears
Weave looks for patterns similar to common LLM chat APIs:- Inputs include a
messagesarray. Each item should includerole(for exampleuser,assistant, orsystem) andcontent. Including amodelfield alongsidemessagesmatches what many providers log for a single completion call. - Outputs include a
choicesarray. Each item should include amessageobject with acontentfield for the assistant reply.
Shape inputs and outputs
The following example shows the minimal structure for one user turn and one assistant reply. Values are illustrative.messages with the appropriate role and content values.
Log calls with the Service API
To start and end calls over HTTP, send payloads that put the fields above on the call record:- On call start, set
inputsto includemessages(and typicallymodel). - On call end, set
outputto includechoiceswithmessage.contentfor the completion text.
Log calls with the SDK or integrations
When you use W&B Weave integrations with provider SDKs, traced calls often inherit the correct structure without manual formatting. For background on how chat-style data appears in thread views, see Chat view behavior in the Threads documentation.Customize or override display
If you need different rendering than the default Chat view, you can still control how data appears usingweave.Markdown and postprocessors. See View and customize trace display.