Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatwardhan committed Sep 3, 2024
1 parent 553da2d commit 64ecce5
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 68 deletions.
2 changes: 1 addition & 1 deletion api-reference/llm_queries/chat_completions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ A string used to represent where the request came from, for examples, did it com
Whether or not to use custom API keys with the specified provider, meaning that you will be using your own account with that provider in the backend.
</ParamField>

<ParamField body="tags" type="array | null" >
<ParamField body="tags" type="string | array | null" >
Comma-separated list of tags to associate with the corresponding prompt.
</ParamField>

Expand Down
60 changes: 0 additions & 60 deletions api-reference/logging/get_prompt_history.mdx

This file was deleted.

72 changes: 72 additions & 0 deletions api-reference/logging/get_query_history.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: 'Get Query History'
api: 'GET /v0/queries'
---
Get the queries history, optionally for a given set of tags for a narrowed search.

#### Authorizations

<ParamField header="Authorization" type="string" required="true">
Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.
</ParamField>

#### Query Parameters

<ParamField query="tags" type="string | array | null" >
Tags to filter for queries that are marked with these tags.
</ParamField>

<ParamField query="endpoints" type="string | array | null" >
Optionally specify an endpoint, or a list of endpoints to filter for
</ParamField>

<ParamField query="start_time" type="string | null" >
Timestamp of the earliest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`.
</ParamField>

<ParamField query="end_time" type="string | null" >
Timestamp of the latest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`.
</ParamField>

<RequestExample>

```bash cURL
curl --request GET \
--url 'https://api.unify.ai/v0/queries?tags=my_tag&endpoints=gpt-4o@openai&start_time=2024-07-12%2004:20:32&end_time=2024-08-12%2004:20:32' \
--header 'Authorization: Bearer <UNIFY_KEY>'
```

```python Python
import requests

url = "https://api.unify.ai/v0/queries?tags=my_tag&endpoints=gpt-4o@openai&start_time=2024-07-12%2004:20:32&end_time=2024-08-12%2004:20:32"

headers = {"Authorization": "Bearer <token>"}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</RequestExample>
<ResponseExample>

```json 200
{}
```

```json 422
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
```

</ResponseExample>
40 changes: 40 additions & 0 deletions api-reference/logging/get_query_tags.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: 'Get Query Tags'
api: 'GET /v0/tags'
---
Returns a list of the tags in your account

#### Authorizations

<ParamField header="Authorization" type="string" required="true">
Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.
</ParamField>

<RequestExample>

```bash cURL
curl --request GET \
--url 'https://api.unify.ai/v0/tags' \
--header 'Authorization: Bearer <UNIFY_KEY>'
```

```python Python
import requests

url = "https://api.unify.ai/v0/tags"

headers = {"Authorization": "Bearer <token>"}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</RequestExample>
<ResponseExample>

```json 200
{}
```

</ResponseExample>
113 changes: 107 additions & 6 deletions api-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,45 @@
]
}
},
"/v0/prompt_history": {
"/v0/tags": {
"get": {
"tags": [
"Logging"
],
"summary": "Get Prompt History",
"description": "Get the prompt history, optionally for a given set of tags for a narrowed search.",
"operationId": "get_prompt_history_v0_prompt_history_get",
"summary": "Get Query Tags",
"description": "Returns a list of the tags in your account",
"operationId": "get_query_tags_v0_tags_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"type": "string"
},
"type": "array",
"title": "Response Get Query Tags V0 Tags Get"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/v0/queries": {
"get": {
"tags": [
"Logging"
],
"summary": "Get Query History",
"description": "Get the queries history, optionally for a given set of tags for a narrowed search.",
"operationId": "get_query_history_v0_queries_get",
"security": [
{
"HTTPBearer": []
Expand All @@ -275,12 +306,79 @@
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "Tags to filter for prompts that are marked with these tags.",
"description": "Tags to filter for queries that are marked with these tags.",
"title": "Tags"
},
"description": "Tags to filter for prompts that are marked with these tags."
"description": "Tags to filter for queries that are marked with these tags.",
"example": "my_tag"
},
{
"name": "endpoints",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "Optionally specify an endpoint, or a list of endpoints to filter for",
"title": "Endpoints"
},
"description": "Optionally specify an endpoint, or a list of endpoints to filter for",
"example": "gpt-4o@openai"
},
{
"name": "start_time",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Timestamp of the earliest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`.",
"title": "Start Time"
},
"description": "Timestamp of the earliest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`.",
"example": "2024-07-12 04:20:32"
},
{
"name": "end_time",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Timestamp of the latest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`.",
"title": "End Time"
},
"description": "Timestamp of the latest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`.",
"example": "2024-08-12 04:20:32"
}
],
"responses": {
Expand Down Expand Up @@ -3380,6 +3478,9 @@
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
Expand Down
3 changes: 2 additions & 1 deletion mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
{
"group": "Logging",
"pages": [
"api-reference/logging/get_prompt_history",
"api-reference/logging/get_query_tags",
"api-reference/logging/get_query_history",
"api-reference/logging/get_query_metrics"
]
},
Expand Down

0 comments on commit 64ecce5

Please sign in to comment.