FastAPI (0.1.0)

Download OpenAPI specification:Download

profile

Profile tabular data

Profile tabular data. The Swagger UI isn't able to call this currently.

Sample curl request:

curl -X 'POST'         -H "X-API-Key: <password>"         -H "Content-Type: application/json"         'http://localhost:8000/log'         --data-raw '{
    "datasetId": "model-62",
    "multiple": {
        "columns": [ "age", "workclass", "fnlwgt", "education" ],
        "data": [
            [ 25, "Private", 226802, "11th" ]
        ]
    }
}'

Sample Python client request:

from whylogs_container_client import AuthenticatedClient
import whylogs_container_client.api.profile.log as Log
from whylogs_container_client.models import LogRequest, LogMultiple
from datetime import datetime

client = AuthenticatedClient(base_url="http://localhost:8000", token="password", prefix="", auth_header_name="X-API-Key")

data = LogRequest(
    dataset_id="model-1",
    timestamp=int(datetime.now().timestamp() * 1000),
    multiple=LogMultiple(
        columns=["col1", "col2"],
        data=[[1, 2], [3, 4]],
    )
)

response = Log.sync_detailed(client=client, json_body=data)
if response.status_code != 200:
    raise Exception(f"Failed to log data. Status code: {response.status_code}")
# API is async, it won't fail and has no return body

Sample Python request (using requests):

import requests

# Define your API key
api_key = "<password>"

# API endpoint
url = 'http://localhost:8000/log'

# Sample data
data = {
    "datasetId": "model-62",
    "multiple": {
        "columns": ["age", "workclass", "fnlwgt", "education"],
        "data": [
            [25, "Private", 226802, "11th"]
        ]
    }
}

# Make the POST request
headers = {"X-API-Key": api_key}
response = requests.post(url, json=data, headers=headers)
Request Body schema: application/json
datasetId
required
string (Datasetid)
required
object (LogMultiple)
integer or null (Timestamp)

Responses

Request samples

Content type
application/json
{
  • "datasetId": "string",
  • "multiple": {
    },
  • "timestamp": 0
}

Response samples

Content type
application/json
null

Profile embeddings

This endpoint requires a custom configuration to set up before hand. See https://docs.whylabs.ai/docs/integrations-whylogs-container/ for setting up embeddings support.

Log embeddings data. The Swagger UI isn't able to call this currently.

Sample curl request:

curl -X 'POST'         -H "X-API-Key: <password>"         -H "Content-Type: application/octet-stream"         'http://localhost:8000/log-embeddings'         --data-raw '{
    "datasetId": "model-62",
    "timestamp": 1634235000,
    "embeddings": {
        "embeddings": [[0.12, 0.45, 0.33, 0.92]]
    }
}'

Sample Python request (using requests):

import requests

# Define your API key
api_key = "<password>"

# API endpoint
url = 'http://localhost:8000/log-embeddings'

# Sample data
data = {
    "datasetId": "model-62",
    "timestamp": 1634235000,  # an example timestamp
    "embeddings": {
        "embeddings": [[0.12, 0.45, 0.33, 0.92]]
    }
}

# Make the POST request
headers = {"X-API-Key": api_key, "Content-Type": "application/octet-stream"}
response = requests.post(url, json=data, headers=headers)
Request Body schema: application/json
dataset_id
required
string (Dataset Id)
timestamp
required
integer (Timestamp)
required
object (Embeddings)

Responses

Request samples

Content type
application/json
{
  • "dataset_id": "string",
  • "timestamp": 0,
  • "embeddings": {
    }
}

Response samples

Content type
application/json
null

Log Pubsub

Responses

Response samples

Content type
application/json
null

Log Pubsub Embeddings

Responses

Response samples

Content type
application/json
null

manage

Publish Profiles

Responses

Response samples

Content type
application/json
null

Health

Responses

Response samples

Content type
application/json
null

Status

Responses

Response samples

Content type
application/json
{
  • "version": "string",
  • "whylogs_logger_status": {
    },
  • "config": { }
}

Log Debug Info

Log the output of /status

Responses

Response samples

Content type
application/json
null

Deep Health

Responses

Response samples

Content type
application/json
null

llm

Evaluate and log a single prompt/response pair using langkit asynchronously.

This is a convenience wrapper around the llm request type for calling /log, which accepts bulk data.

Request Body schema: application/json
string or null (Prompt)
string or null (Response)
InputContext (object) or null
string or null (Id)
datasetId
required
string (Datasetid)
timestamp
integer (Timestamp)
object (Additional Data)
RunOptions (object) or null

Responses

Request samples

Content type
application/json
{
  • "prompt": "string",
  • "response": "string",
  • "context": {
    },
  • "id": "string",
  • "datasetId": "string",
  • "timestamp": 0,
  • "additional_data": {
    },
  • "options": {