POST
/
v1
/
logs
/
{log_id}
/
rating
Rate Log By Id
curl --request POST \
  --url https://api.pulze.ai/v1/logs/{log_id}/rating \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "good_answer": true,
  "feedback": "<string>"
}'
{
  "conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "parent_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "good_answer": true,
  "feedback": "<string>",
  "prompt_tokens": 0,
  "completion_tokens": 0,
  "total_tokens": 0,
  "prompt_tokens_cost": 0,
  "completion_tokens_cost": 0,
  "total_tokens_cost": 0,
  "prompt_tokens_cost_savings": 0,
  "completion_tokens_cost_savings": 0,
  "total_tokens_cost_savings": 0,
  "app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "auth0_id": "<string>",
  "costs_incurred": true,
  "namespace": "<string>",
  "payload": {
    "model": "<string>",
    "max_tokens": 123,
    "temperature": 0.5,
    "top_p": 123,
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "<string>",
          "description": "<string>",
          "parameters": {
            "type": "object",
            "properties": {},
            "required": [
              "<string>"
            ]
          }
        }
      }
    ],
    "tool_choice": "none",
    "n": 2,
    "stream": true,
    "logprobs": 2,
    "stop": "<string>",
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "best_of": 2,
    "logit_bias": {},
    "response_format": {
      "type": "text"
    },
    "messages": [
      {
        "role": "user",
        "content": "<string>",
        "tool_calls": [
          {
            "function": {},
            "id": "<string>",
            "type": "function"
          }
        ]
      }
    ],
    "assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "assistant_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "parent_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "plugins": [
      "legacy-file-search"
    ],
    "images": [
      "<string>"
    ],
    "files": [
      "<string>"
    ],
    "custom_headers": {
      "labels": {},
      "headers": {},
      "weights": {
        "cost": 0,
        "latency": 0,
        "quality": 1
      },
      "policies": {
        "privacy_level": 1,
        "max_cost": 0.02,
        "max_switch_model_retries": 1,
        "max_same_model_retries": 1,
        "optimize_internal_requests": 0,
        "prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "feature_flags": {
        "citations": false,
        "auto_tools": false,
        "smart_learn": true
      }
    }
  },
  "privacy_level": 1,
  "prompt": "<string>",
  "request_type": "completions",
  "response_text": "<string>",
  "response": {
    "choices": [
      {
        "index": 123,
        "finish_reason": "<string>",
        "message": {
          "role": "user",
          "content": "<string>",
          "tool_calls": [
            {
              "function": {},
              "id": "<string>",
              "type": "function"
            }
          ]
        }
      }
    ],
    "created": 0,
    "metadata": {
      "app_id": "<string>",
      "model": {
        "model": "<string>",
        "provider": "<string>",
        "owner": "<string>",
        "namespace": "<string>",
        "at": "<string>"
      },
      "costs": {
        "total_tokens": 123,
        "prompt_tokens": 123,
        "completion_tokens": 123
      },
      "cost_savings": {
        "total_tokens": 123,
        "prompt_tokens": 123,
        "completion_tokens": 123
      },
      "generated_artifacts": {
        "items": [
          {}
        ]
      },
      "search_results": {
        "items": [
          {}
        ]
      },
      "latency": 123,
      "labels": {},
      "error": "<string>",
      "scores": {
        "best_models": [],
        "candidates": [
          {}
        ]
      },
      "score": 123,
      "temperature": 123,
      "max_tokens": 0,
      "status_code": 123,
      "retries": 0,
      "extra": {},
      "warning": "<string>"
    },
    "id": "<string>",
    "usage": {
      "total_tokens": 123,
      "prompt_tokens": 123,
      "completion_tokens": 123
    },
    "model": "<string>",
    "object": "text_completion"
  },
  "status_code": -1,
  "is_test": false,
  "added_on": "2023-11-07T05:31:56Z",
  "latency": -1,
  "timestamp": 123,
  "parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "is_saved_for_later": false,
  "comment_count": 0,
  "parent": {},
  "children": [
    {}
  ],
  "model": {
    "supports_functions": true,
    "supports_json": true,
    "supports_n": true,
    "supports_penalties": true,
    "supports_stream": true,
    "supports_vision": true,
    "completion_token_cost": 123,
    "prompt_token_cost": 123,
    "base_cost": 123,
    "price_unit": "tokens",
    "model": "<string>",
    "provider": "<string>",
    "owner": "<string>",
    "namespace": "<string>",
    "at": "<string>",
    "context_window": 123,
    "until": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "url": "<string>",
    "api_target": "",
    "deprecated_on": "2023-11-07T05:31:56Z",
    "parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "parent": {},
    "prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "is_rag": true,
    "is_ft": true,
    "is_open_source": true,
    "is_gdpr": true,
    "is_chat": true,
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "added_by": "<string>",
    "added_on": "2023-11-07T05:31:56Z",
    "modified_on": "2023-11-07T05:31:56Z",
    "is_public": true,
    "is_test_model": true,
    "is_pulze_owner": true,
    "default_active": true
  },
  "collections": [
    {
      "name": "<string>",
      "collection": {
        "name": "<string>",
        "description": "<string>",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "request_count": 123
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

log_id
string<uuid>
required

Body

application/json
good_answer
boolean | null

The rating given to this request. It can be good (True), bad (False) or none (None == null)

feedback
string | null
default:""

An optional text with accompanies the feedback's rating

Response

Successful Response

conversation_id
string<uuid> | null
required
parent_request_id
string<uuid> | null
required
app_id
string<uuid> | null
required

The ID of the app that performed the request

auth0_id
string | null
required

The Auth0 ID of the user that performed the request

response
object
required

The response object

timestamp
integer
required

The timestamp of the request, in milliseconds

id
string<uuid>
required

ID of the request

good_answer
boolean | null

The rating given to this request. It can be good (True), bad (False) or none (None == null)

feedback
string | null
default:""

An optional text with accompanies the feedback's rating

prompt_tokens
integer
default:0

Number of tokens the request used

completion_tokens
integer
default:0

Number of tokens the response used

total_tokens
integer
default:0

Number of tokens of (request + response)

prompt_tokens_cost
number
default:0

Cost (in $) of the prompt

completion_tokens_cost
number
default:0

Cost (in $) of the response

total_tokens_cost
number
default:0

Cost (in $) of the (request + response)

prompt_tokens_cost_savings
number
default:0

Cost (in $) saved in the prompt costs comparison to the benchmark model

completion_tokens_cost_savings
number
default:0

Cost (in $) saved in the completion costs comparison to the benchmark model

total_tokens_cost_savings
number
default:0

Cost (in $) saved in total, in comparison to the benchmark model

costs_incurred
boolean
default:true

When a request requires multiple intermediate calls, they are stored as 'no costs incurred' -- that way we can store the costs, but don't charge the user

namespace
string | null

The name of the provider's model which was used to answer the request

payload
object

The payload sent with the request

privacy_level
enum<integer>
default:1

How much is logged? 1: everything, 2: mask request+response (but show log), 3: Not visible, not retrievable, no information stored.

Available options:
1,
2,
3
prompt
string | null

The prompt in text format

request_type
enum<string> | null
default:chat_completions

The type of request (text completion or chat) the user sends and expects back

Available options:
completions,
chat_completions
response_text
string

The response in text format

status_code
integer
default:-1

The status code of the request to the AI model

is_test
boolean
default:false

True if the request was performed from a sandbox app

added_on
string<date-time> | null

When the request was performed

latency
number
default:-1

Time it took for the LLM to respond

parent_id
string<uuid> | null

Reference to the ID of the parent of this log. A log has a parent when it's a subrequest used to retrieve the final answer.

is_saved_for_later
boolean
default:false
comment_count
integer
default:0
parent
object | null

The parent of the Request, if any. Requests which are part of a series of sub-requests (like multiple LLM calls, or RAG) will have the final, resulting Log as parent.

children
LogRequest · object[] | null

The children of the Request. Will equal None unless you use eager loading in the query

model
object | null

The model this request used. Optional beause it's not always populated

collections
AppCollectionRequest · object[] | null

The collections this request is associated with