Input
Last updated
Last updated
Copyright © 2023 Arize AI, Inc
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. Similarly, it looks for "output.value"
(or SpanAttributes.OUTPUT_VALUE
or SemanticConventions.OUTPUT_VALUE
) for to populate the Output column.
When viewing a single span, certain fields show up more prominently. For example, for LLM types spans, the Input messages are populated by the key SpanAttributes.LLM_INPUT_MESSAGES
. If you're sending multiple messages, this should allow you to view the entire series of messages, both from the user and assistant roles, in a single page. A similar concept applies for Output Messages.
This example code shows how you can instrument the inputs of a python app. If you have prompt templates and template variables, this will instrument that as well, giving you access to the prompt template tab.
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.