diff --git a/docs/api.html b/docs/api.html new file mode 100644 index 0000000..d903b4e --- /dev/null +++ b/docs/api.html @@ -0,0 +1,598 @@ + + + +
+ +Download OpenAPI specification:Download
Profile tabular data. The Swagger UI isn't able to call this currently.
+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" ]
+ ]
+ }
+}'
+
+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
+
+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)
+
+datasetId required | string (Datasetid) |
required | object (LogMultiple) |
Timestamp (integer) or Timestamp (null) (Timestamp) |
{- "datasetId": "string",
- "multiple": {
- "columns": [
- "string"
], - "data": [
- [
- "string"
]
]
}, - "timestamp": 0
}
null
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.
+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]]
+ }
+}'
+
+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)
+
+dataset_id required | string (Dataset Id) |
timestamp required | integer (Timestamp) |
required | object (Embeddings) |
{- "dataset_id": "string",
- "timestamp": 0,
- "embeddings": {
- "property1": [
- [
- 0
]
], - "property2": [
- [
- 0
]
]
}
}
null
This is a convenience wrapper around the llm request type for calling /log, which accepts bulk data.
+Prompt (string) or Prompt (null) (Prompt) | |
Response (string) or Response (null) (Response) | |
datasetId required | string (Datasetid) |
Timestamp (integer) or Timestamp (null) (Timestamp) |
{- "prompt": "string",
- "response": "string",
- "datasetId": "string",
- "timestamp": 0
}
null
This endpoint can be used to synchronously get validation results from a single input +prompt/response. It automatically performs whylogs profiling and sends profiles to +whylabs in the background, just like the /log endpoint.
+Args: + log (bool, optional): Determines if logging to WhyLabs is enabled for the validate request. Defaults to True.
+log | boolean (Log) Default: true |
Prompt (string) or Prompt (null) (Prompt) | |
Response (string) or Response (null) (Response) | |
datasetId required | string (Datasetid) |
Timestamp (integer) or Timestamp (null) (Timestamp) |
{- "prompt": "string",
- "response": "string",
- "datasetId": "string",
- "timestamp": 0
}
{- "report": [
- {
- "id": 0,
- "metric": "string",
- "details": "string",
- "value": 0,
- "upper_threshold": 0,
- "lower_threshold": 0
}
]
}
{- "statuses": {
- "property1": {
- "dataset_timestamps": 0,
- "dataset_profiles": 0,
- "segment_caches": 0,
- "writers": 0,
- "pending_writables": 0,
- "pending_views": [
- "string"
], - "views": [
- "string"
]
}, - "property2": {
- "dataset_timestamps": 0,
- "dataset_profiles": 0,
- "segment_caches": 0,
- "writers": 0,
- "pending_writables": 0,
- "pending_views": [
- "string"
], - "views": [
- "string"
]
}
}
}