For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
DocsReferenceChangelog
DocsReferenceChangelog
  • Introduction
    • Overview
    • Errors
  • SDK
    • Overview
    • Decorators
    • Run Evaluation
  • API
      • POSTLog to a Prompt
      • PATCHUpdate Prompt Log
      • STREAMCall Prompt
      • GETList Prompts
      • POSTUpsert Prompt
      • GETGet Prompt
      • DELDelete Prompt
      • PATCHMove Prompt
      • POSTPopulate Prompt template
      • GETList Versions of a Prompt
      • DELDelete Prompt Version
      • PATCHUpdate Prompt Version
      • POSTDeploy Prompt
      • DELRemove Deployment
      • GETList a Prompt's Environments
      • POSTUpdate Monitoring
      • GETSerialize
      • POSTDeserialize
LogoLogo
Sign inBook a demo
APIPrompts

Update Prompt Log

PATCH
https://api.humanloop.com/v5/prompts/:id/log/:log_id
PATCH
/v5/prompts/:id/log/:log_id
$curl -X PATCH https://api.humanloop.com/v5/prompts/id/log/log_id \
> -H "X-API-KEY: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "output_message": {
3 "content": "content",
4 "name": "name",
5 "tool_call_id": "tool_call_id",
6 "role": "user",
7 "tool_calls": [
8 {
9 "id": "id",
10 "type": "function",
11 "function": {
12 "name": "name"
13 }
14 }
15 ],
16 "thinking": [
17 {
18 "type": "thinking",
19 "thinking": "thinking",
20 "signature": "signature"
21 }
22 ]
23 },
24 "prompt_tokens": 1,
25 "reasoning_tokens": 1,
26 "output_tokens": 1,
27 "prompt_cost": 1.1,
28 "output_cost": 1.1,
29 "finish_reason": "finish_reason",
30 "messages": [
31 {
32 "content": "content",
33 "name": "name",
34 "tool_call_id": "tool_call_id",
35 "role": "user",
36 "tool_calls": [
37 {
38 "id": "id",
39 "type": "function",
40 "function": {
41 "name": "name"
42 }
43 }
44 ],
45 "thinking": [
46 {
47 "type": "thinking",
48 "thinking": "thinking",
49 "signature": "signature"
50 }
51 ]
52 }
53 ],
54 "tool_choice": "none",
55 "prompt": {
56 "path": "path",
57 "id": "id",
58 "directory_id": "directory_id",
59 "model": "model",
60 "endpoint": "complete",
61 "template": "template",
62 "template_language": "default",
63 "provider": "anthropic",
64 "max_tokens": 1,
65 "temperature": 1.1,
66 "top_p": 1.1,
67 "stop": "stop",
68 "presence_penalty": 1.1,
69 "frequency_penalty": 1.1,
70 "other": {
71 "key": "value"
72 },
73 "seed": 1,
74 "response_format": {
75 "type": "json_object",
76 "json_schema": {
77 "key": "value"
78 }
79 },
80 "reasoning_effort": "high",
81 "tools": [
82 {
83 "name": "name",
84 "description": "description"
85 }
86 ],
87 "linked_tools": [
88 {
89 "name": "name",
90 "description": "description",
91 "id": "id",
92 "version_id": "version_id"
93 }
94 ],
95 "attributes": {
96 "key": "value"
97 },
98 "version_name": "version_name",
99 "version_description": "version_description",
100 "description": "description",
101 "tags": [
102 "tags"
103 ],
104 "readme": "readme",
105 "name": "name",
106 "schema": {
107 "key": "value"
108 },
109 "version_id": "version_id",
110 "type": "prompt",
111 "environments": [
112 {
113 "id": "id",
114 "created_at": "2024-01-15T09:30:00Z",
115 "name": "name",
116 "tag": "default"
117 }
118 ],
119 "created_at": "2024-01-15T09:30:00Z",
120 "updated_at": "2024-01-15T09:30:00Z",
121 "created_by": {
122 "id": "id",
123 "email_address": "email_address",
124 "full_name": "full_name"
125 },
126 "last_used_at": "2024-01-15T09:30:00Z",
127 "version_logs_count": 1,
128 "total_logs_count": 1,
129 "inputs": [
130 {
131 "name": "name"
132 }
133 ],
134 "evaluator_aggregates": [
135 {
136 "value": 1.1,
137 "evaluator_id": "evaluator_id",
138 "evaluator_version_id": "evaluator_version_id",
139 "created_at": "2024-01-15T09:30:00Z",
140 "updated_at": "2024-01-15T09:30:00Z"
141 }
142 ],
143 "raw_file_content": "raw_file_content"
144 },
145 "start_time": "2024-01-15T09:30:00Z",
146 "end_time": "2024-01-15T09:30:00Z",
147 "output": "output",
148 "created_at": "2024-01-15T09:30:00Z",
149 "error": "error",
150 "provider_latency": 1.1,
151 "stdout": "stdout",
152 "provider_request": {
153 "key": "value"
154 },
155 "provider_response": {
156 "key": "value"
157 },
158 "inputs": {
159 "key": "value"
160 },
161 "source": "source",
162 "metadata": {
163 "key": "value"
164 },
165 "source_datapoint_id": "source_datapoint_id",
166 "trace_parent_id": "trace_parent_id",
167 "batches": [
168 "batches"
169 ],
170 "user": "user",
171 "environment": "environment",
172 "save": true,
173 "log_id": "log_id",
174 "id": "id",
175 "evaluator_logs": [
176 {
177 "start_time": "2024-01-15T09:30:00Z",
178 "end_time": "2024-01-15T09:30:00Z",
179 "output": "output",
180 "created_at": "2024-01-15T09:30:00Z",
181 "error": "error",
182 "provider_latency": 1.1,
183 "stdout": "stdout",
184 "provider_request": {
185 "key": "value"
186 },
187 "provider_response": {
188 "key": "value"
189 },
190 "inputs": {
191 "key": "value"
192 },
193 "source": "source",
194 "metadata": {
195 "key": "value"
196 },
197 "parent_id": "parent_id",
198 "source_datapoint_id": "source_datapoint_id",
199 "trace_parent_id": "trace_parent_id",
200 "batches": [
201 "batches"
202 ],
203 "user": "user",
204 "environment": "environment",
205 "save": true,
206 "log_id": "log_id",
207 "output_message": {
208 "role": "user"
209 },
210 "judgment": true,
211 "marked_completed": true,
212 "id": "id",
213 "evaluator_logs": [],
214 "trace_flow_id": "trace_flow_id",
215 "trace_id": "trace_id",
216 "evaluator": {
217 "path": "path",
218 "id": "id",
219 "spec": {
220 "arguments_type": "target_free",
221 "return_type": "boolean",
222 "evaluator_type": "llm"
223 },
224 "name": "name",
225 "version_id": "version_id",
226 "created_at": "2024-01-15T09:30:00Z",
227 "updated_at": "2024-01-15T09:30:00Z",
228 "last_used_at": "2024-01-15T09:30:00Z",
229 "version_logs_count": 1,
230 "total_logs_count": 1,
231 "inputs": [
232 {
233 "name": "name"
234 }
235 ]
236 }
237 }
238 ],
239 "trace_flow_id": "trace_flow_id",
240 "trace_id": "trace_id"
241}
Update a Log. Update the details of a Log with the given ID.
Was this page helpful?
Previous

Call Prompt

Next
Built with

Authentication

X-API-KEYstring
API Key authentication via header

Path parameters

idstringRequired
Unique identifier for Prompt.
log_idstringRequired
Unique identifier for the Log.

Request

This endpoint expects an object.
output_messageobjectOptional
The message returned by the provider.
prompt_tokensintegerOptional
Number of tokens in the prompt used to generate the output.
reasoning_tokensintegerOptional
Number of reasoning tokens used to generate the output.
output_tokensintegerOptional
Number of tokens in the output generated by the model.
prompt_costdoubleOptional
Cost in dollars associated to the tokens in the prompt.
output_costdoubleOptional
Cost in dollars associated to the tokens in the output.
finish_reasonstringOptional
Reason the generation finished.
messageslist of objectsOptional
The messages passed to the to provider chat endpoint.
tool_choice"none" or "auto" or "required" or objectOptional
Controls how the model uses tools. The following options are supported: - `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. - `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. - `'required'` means the model must call one or more of the provided tools. - `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.
outputstringOptional

Generated output from your model for the provided inputs. Can be None if logging an error, or if creating a parent Log with the intention to populate it later.

created_atdatetimeOptional
User defined timestamp for when the log was created.
errorstringOptional
Error message if the log is an error.
provider_latencydoubleOptional
Duration of the logged event in seconds.
stdoutstringOptional
Captured log and debug statements.
provider_requestmap from strings to anyOptional
Raw request sent to provider.
provider_responsemap from strings to anyOptional
Raw response received the provider.
inputsmap from strings to anyOptional
The inputs passed to the prompt template.
sourcestringOptional
Identifies where the model was called from.
metadatamap from strings to anyOptional
Any additional metadata to record.
start_timedatetimeOptional
When the logged event started.
end_timedatetimeOptional
When the logged event ended.

Response

Successful Response
object
OR
object
OR
object
OR
object
OR
object

Errors

422
Update Log Prompts ID Log Log ID Patch Request Unprocessable Entity Error

Controls how the model uses tools. The following options are supported:

  • 'none' means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt.
  • 'auto' means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt.
  • 'required' means the model must call one or more of the provided tools.
  • {'type': 'function', 'function': {name': <TOOL_NAME>}} forces the model to use the named function.