Python
import os
from dataframer import Dataframer
client = Dataframer(
api_key=os.environ.get("DATAFRAMER_API_KEY"), # This is the default and can be omitted
)
context = client.dataframer.context.retrieve()
print(context.knowledge)curl https://df-api.dataframer.ai/api/dataframer/context/ \
-H "Authorization: Bearer $DATAFRAMER_API_KEY"{
"knowledge": {
"facts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "policy_rule",
"text": "<string>",
"grounding": "<string>",
"tags": [
"<string>"
],
"confidence": 0.5,
"created_at": "2023-11-07T05:31:56Z",
"source": {
"source_id": "<string>",
"source_url": "<string>"
},
"content_location": {
"data_plane": true,
"s3_key": "<string>",
"storage_uri": "<string>",
"sha256": "<string>",
"bytes_size": 123,
"version": 123,
"fields": {}
},
"content_unavailable_reason": "result_content_in_data_plane"
}
],
"total": 123
},
"rubric_count": 123,
"rubrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"platform": "langfuse"
},
"version": 123,
"description": "<string>",
"instructions": "<string>",
"dimensions": [
{
"name": "<string>",
"scoring_model": "pass_fail",
"required": true,
"levels": [
{
"label": "<string>",
"description": "<string>",
"value": 123
}
],
"positive_examples": [
{
"query": "<string>",
"answer": "<string>",
"source_id": "<string>",
"source_url": "<string>"
}
],
"negative_examples": [
{
"query": "<string>",
"answer": "<string>",
"source_id": "<string>",
"source_url": "<string>"
}
],
"examples": [
{
"query": "<string>",
"answer": "<string>",
"source_id": "<string>",
"source_url": "<string>"
}
]
}
],
"examples_omitted": 123
}
]
}{
"bad_uuid": {
"value": {
"error": "Invalid rubric_id format: \"abc\" is not a valid UUID"
}
}
}{
"not_found": {
"value": {
"error": "Rubric not found"
}
}
}Context
Get context
Retrieve the knowledge and rubric content that failures reference
GET
/
api
/
dataframer
/
context
/
Python
import os
from dataframer import Dataframer
client = Dataframer(
api_key=os.environ.get("DATAFRAMER_API_KEY"), # This is the default and can be omitted
)
context = client.dataframer.context.retrieve()
print(context.knowledge)curl https://df-api.dataframer.ai/api/dataframer/context/ \
-H "Authorization: Bearer $DATAFRAMER_API_KEY"{
"knowledge": {
"facts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "policy_rule",
"text": "<string>",
"grounding": "<string>",
"tags": [
"<string>"
],
"confidence": 0.5,
"created_at": "2023-11-07T05:31:56Z",
"source": {
"source_id": "<string>",
"source_url": "<string>"
},
"content_location": {
"data_plane": true,
"s3_key": "<string>",
"storage_uri": "<string>",
"sha256": "<string>",
"bytes_size": 123,
"version": 123,
"fields": {}
},
"content_unavailable_reason": "result_content_in_data_plane"
}
],
"total": 123
},
"rubric_count": 123,
"rubrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"platform": "langfuse"
},
"version": 123,
"description": "<string>",
"instructions": "<string>",
"dimensions": [
{
"name": "<string>",
"scoring_model": "pass_fail",
"required": true,
"levels": [
{
"label": "<string>",
"description": "<string>",
"value": 123
}
],
"positive_examples": [
{
"query": "<string>",
"answer": "<string>",
"source_id": "<string>",
"source_url": "<string>"
}
],
"negative_examples": [
{
"query": "<string>",
"answer": "<string>",
"source_id": "<string>",
"source_url": "<string>"
}
],
"examples": [
{
"query": "<string>",
"answer": "<string>",
"source_id": "<string>",
"source_url": "<string>"
}
]
}
],
"examples_omitted": 123
}
]
}{
"bad_uuid": {
"value": {
"error": "Invalid rubric_id format: \"abc\" is not a valid UUID"
}
}
}{
"not_found": {
"value": {
"error": "Rubric not found"
}
}
}Authorizations
Query Parameters
Response
Workspace knowledge and rubric content

