When to use Online Tasks API
The Online Tasks API programmatically creates or updates automated evaluation tasks that run in the Arize platform. Use this for real-time evaluation of spans from your application.Creating an Evaluation Task
You can programmatically create an evaluation task using thecreateEvalTask mutation. This allows you to set up evaluations based on your specific criteria for LLM applications.
Key Parameters:
-
modelId: The unique identifier for your project. -
samplingRate: Set the percentage of inputs the task will sample for evaluation. -
queryFilter: Define conditions to filter which inputs are included in the evaluation. -
name: The name of the evaluation task. -
templateEvaluators: Settings for how the evaluation will be performed (e.g., evaluator name, template, rails, explanations). -
llmConfig: Specify the LLM configuration, such as model provider and temperature settings.
Updating an Evaluation Task
To update an existing evaluation task, use thepatchEvalTask mutation. You can choose to modify any parameters you wish to update without needing to include parameters you want to leave unchanged.
Running Task
To programmatically run a task on historical data, use therunOnlineTask mutation. This allows you to run your task on specific time range.
Key Input Parameters:
-
onlineTaskId: The unique identifier for your task -
dataStartTime: A date-time string at UTC (such as 2007-12-03T10:15:30Z) for the start of your historical data. -
dataEndTime: The end time for your historical data -
maxSpans: The maximum number of spans you would like to evaluate. Defaults to 10,000 if not specified.
Response Types:
The response to this mutation is a union type, meaning it can return one of two types:-
TaskError: Indicates a failure to start the task run. It includes an error message explaining the reason for the failure. - `