Record calls answered elsewhere
const url = 'https://api.pensievelabs.co/v1/captures';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model":"grade-audit","calls":[{"input":{"task":"rust-2291","grade":"pass"},"answer":"grade_holds","source":"frontier","provider_model":"frontier-large","latency_ms":2140,"key":"rust-2291"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pensievelabs.co/v1/captures \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "grade-audit", "calls": [ { "input": { "task": "rust-2291", "grade": "pass" }, "answer": "grade_holds", "source": "frontier", "provider_model": "frontier-large", "latency_ms": 2140, "key": "rust-2291" } ] }'Calls your own code answered, usually a frontier model, recorded so Pensieve can build the
test and training data from real traffic. The SDK’s capture sends these for you.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Any unique string. Sending it again within 24 hours returns the first response.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
A cl_ id you made, so you can send outcomes before this arrives.
The id of the decision this call follows, when Pensieve routed the case to your code. Your code’s answer is recorded on that call instead of a new one. Don’t send id with it.
What answered, such as frontier, rules or human.
Example
{ "model": "grade-audit", "calls": [ { "input": { "task": "rust-2291", "grade": "pass" }, "answer": "grade_holds", "source": "frontier", "provider_model": "frontier-large", "latency_ms": 2140, "key": "rust-2291" } ]}Responses
Section titled “Responses”The ids given to the recorded calls.
object
How many items were recorded.
For each item in order, the call or test case it was recorded as (for a capture with decision_id,
that decision’s call). For an outcome, the call it was matched to, or null while it waits for its
call: it is matched when a call with that id, or that model and key, is recorded.
Example
{ "object": "receipt"}default
Section titled “default”Something went wrong; error.type says what.
object
object
The request field the error is about.
Example
{ "error": { "type": "invalid_request" }}