Log Input
Last updated
Last updated
Copyright © 2023 Arize AI, Inc
Most auto-instrumentors automatically populate the input field without requiring manual logging. This section reviews manual instrumentation of input.
In the tracing tab, our table view looks for the span attributes "input.value"
(or SpanAttributes.INPUT_VALUE
or SemanticConventions.INPUT_VALUE
) to populate the input column.
When viewing a single span, certain fields are highlighted more prominently. For example, in LLM-type spans, the Input messages are captured by the SpanAttributes.LLM_INPUT_MESSAGES
key. This enables you to view the full series of messages exchanged between the user and assistant on one page.
This example code shows how you can instrument the inputs of a python app.
One thing to note is the format of the LLM_INPUT_MESSAGES
. This attribute is represented as a list of chat completion params, which have role
and content
fields. In order to set this, you need to set the index as well as each field for each message, as shown in the example below. This example uses the ChatCompletionMessageParam
message type from OpenAi, but any data following the format of example_messages
below will do.