diff --git a/api-reference/llm_queries/chat_completions.mdx b/api-reference/llm_queries/chat_completions.mdx index 7aa8d9e6f..8e105d9a7 100644 --- a/api-reference/llm_queries/chat_completions.mdx +++ b/api-reference/llm_queries/chat_completions.mdx @@ -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. - + Comma-separated list of tags to associate with the corresponding prompt. diff --git a/api-reference/logging/get_prompt_history.mdx b/api-reference/logging/get_prompt_history.mdx deleted file mode 100644 index b5fd747b6..000000000 --- a/api-reference/logging/get_prompt_history.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: 'Get Prompt History' -api: 'GET /v0/prompt_history' ---- -Get the prompt history, optionally for a given set of tags for a narrowed search. - -#### Authorizations - - - Bearer authentication header of the form `Bearer `, where `` is your auth token. - - -#### Query Parameters - - -Tags to filter for prompts that are marked with these tags. - - - - -```bash cURL -curl --request GET \ - --url 'https://api.unify.ai/v0/prompt_history?tags=None' \ - --header 'Authorization: Bearer ' -``` - -```python Python -import requests - -url = "https://api.unify.ai/v0/prompt_history?tags=None" - -headers = {"Authorization": "Bearer "} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - - - - -```json 200 -{} -``` - -```json 422 -{ - "detail": [ - { - "loc": [ - "string" - ], - "msg": "string", - "type": "string" - } - ] -} -``` - - diff --git a/api-reference/logging/get_query_history.mdx b/api-reference/logging/get_query_history.mdx new file mode 100644 index 000000000..ae977235c --- /dev/null +++ b/api-reference/logging/get_query_history.mdx @@ -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 + + + Bearer authentication header of the form `Bearer `, where `` is your auth token. + + +#### Query Parameters + + +Tags to filter for queries that are marked with these tags. + + + +Optionally specify an endpoint, or a list of endpoints to filter for + + + +Timestamp of the earliest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`. + + + +Timestamp of the latest query to aggregate. Format is `YYYY-MM-DD hh:mm:ss`. + + + + +```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 ' +``` + +```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 "} + +response = requests.request("GET", url, headers=headers) + +print(response.text) +``` + + + + +```json 200 +{} +``` + +```json 422 +{ + "detail": [ + { + "loc": [ + "string" + ], + "msg": "string", + "type": "string" + } + ] +} +``` + + diff --git a/api-reference/logging/get_query_tags.mdx b/api-reference/logging/get_query_tags.mdx new file mode 100644 index 000000000..8e94431e1 --- /dev/null +++ b/api-reference/logging/get_query_tags.mdx @@ -0,0 +1,40 @@ +--- +title: 'Get Query Tags' +api: 'GET /v0/tags' +--- +Returns a list of the tags in your account + +#### Authorizations + + + Bearer authentication header of the form `Bearer `, where `` is your auth token. + + + + +```bash cURL +curl --request GET \ + --url 'https://api.unify.ai/v0/tags' \ + --header 'Authorization: Bearer ' +``` + +```python Python +import requests + +url = "https://api.unify.ai/v0/tags" + +headers = {"Authorization": "Bearer "} + +response = requests.request("GET", url, headers=headers) + +print(response.text) +``` + + + + +```json 200 +{} +``` + + diff --git a/api-reference/openapi.json b/api-reference/openapi.json index e2fe110b0..4c63e8ea2 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -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": [] @@ -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": { @@ -3380,6 +3478,9 @@ }, "tags": { "anyOf": [ + { + "type": "string" + }, { "items": { "type": "string" diff --git a/mint.json b/mint.json index e874cf46f..2d598bfe0 100644 --- a/mint.json +++ b/mint.json @@ -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" ] },