Real-time
import sutro as so
input_data = {
"classification_policy": "Classify the latest tool-backed action when one is present. A later statement about future work does not override the observed action. If there is no tool invocation, classify the explicit plan or approval request. A returned tool result establishes completed; an invocation without a result establishes attempted; a proposal alone is planned. Do not infer deployment from a mention of publishing.",
"trace": "[{\"role\": \"user\", \"content\": \"Investigate the validation failure and propose a fix.\"}, {\"role\": \"agent\", \"content\": \"Read the validator implementation.\"}, {\"role\": \"tool\", \"content\": \"Read validators.py. The relevant function body was returned. No file was modified.\", \"name\": \"read_file\"}, {\"role\": \"agent\", \"content\": \"I will change the validation condition next.\"}]"
}
result = so.run_function(
"agent-trace-intent-classification",
input_data,
)
curl --fail-with-body -X POST "${SUTRO_API_URL%/}/v1/functions/agent-trace-intent-classification/run" \
-H "Authorization: Key $SUTRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"classification_policy": "Classify the latest tool-backed action when one is present. A later statement about future work does not override the observed action. If there is no tool invocation, classify the explicit plan or approval request. A returned tool result establishes completed; an invocation without a result establishes attempted; a proposal alone is planned. Do not infer deployment from a mention of publishing.",
"trace": "[{\"role\": \"user\", \"content\": \"Investigate the validation failure and propose a fix.\"}, {\"role\": \"agent\", \"content\": \"Read the validator implementation.\"}, {\"role\": \"tool\", \"content\": \"Read validators.py. The relevant function body was returned. No file was modified.\", \"name\": \"read_file\"}, {\"role\": \"agent\", \"content\": \"I will change the validation condition next.\"}]"
}
}'
Batch
import sutro as so
job_id = so.batch_run_function(
name="agent-trace-intent-classification",
data="agent_trace_intent_classification.csv",
)
results = so.await_job_completion(job_id)
curl --fail-with-body -X POST "${SUTRO_API_URL%/}/v1/batch-inference" \
-H "Authorization: Key $SUTRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "agent-trace-intent-classification",
"inputs": [
{
"classification_policy": "Classify the latest tool-backed action when one is present. A later statement about future work does not override the observed action. If there is no tool invocation, classify the explicit plan or approval request. A returned tool result establishes completed; an invocation without a result establishes attempted; a proposal alone is planned. Do not infer deployment from a mention of publishing.",
"trace": "[{\"role\": \"user\", \"content\": \"Investigate the validation failure and propose a fix.\"}, {\"role\": \"agent\", \"content\": \"Read the validator implementation.\"}, {\"role\": \"tool\", \"content\": \"Read validators.py. The relevant function body was returned. No file was modified.\", \"name\": \"read_file\"}, {\"role\": \"agent\", \"content\": \"I will change the validation condition next.\"}]"
}
]
}'