An interaction is the combination of a prompt, a model’s completion, and optionally feedback and metadata (such as labels).

When you make an inference request to Adaptive, the resulting interaction is automatically logged to the Adaptive Interaction Store. You can also log interactions ad-hoc for an existing model that is attached to a use case, which is useful for evaluation or model tuning.

You can log interactions as follows:

Create an Adaptive client first

response = adaptive.interactions.create(
    model="model_key",
    completion="Model's completion",
    messages=[
        {"role": "system", "content": "System prompt"},
        {"role": "user", "content":"User input"}    
    ],
    feedbacks=[
        {"feedback_key": "metric_key_1", "value": 0, "details": "Feedback details 1"},
        {"feedback_key": "metric_key_2", "value": 1, "details": "Feedback details 2"}
    ]
    labels={"label_key": "label_value"}
)

All automatically or manually logged interactions can be explored in the Interactions page of the Adaptive UI.

You can also retrieve interactions programmatically via SDK for ad-hoc analysis. See the SDK Reference for all interaction-related methods.