@outputai/llm 0.11.1-next.da26845.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/package.json +7 -3
  2. package/src/agent.js +7 -2
  3. package/src/generate.js +1 -0
  4. package/src/index.d.ts +14 -6
  5. package/src/utils/wrap.js +35 -2
  6. package/src/agent.spec.js +0 -595
  7. package/src/ai_provider.spec.js +0 -217
  8. package/src/ai_sdk_options.spec.js +0 -390
  9. package/src/fixtures/image_response_v7_google_vertex.js +0 -72
  10. package/src/fixtures/image_response_v7_openai.js +0 -77
  11. package/src/fixtures/models_api_light.json +0 -675
  12. package/src/fixtures/models_api_v7_subset.json +0 -259
  13. package/src/fixtures/stream_response_v7_anthropic.js +0 -389
  14. package/src/fixtures/stream_response_v7_google_vertex.js +0 -462
  15. package/src/fixtures/stream_response_v7_openai.js +0 -353
  16. package/src/fixtures/stream_response_v7_perplexity.js +0 -671
  17. package/src/fixtures/text_response_v7_anthropic.js +0 -359
  18. package/src/fixtures/text_response_v7_anthropic_cache.js +0 -719
  19. package/src/fixtures/text_response_v7_google_vertex.js +0 -435
  20. package/src/fixtures/text_response_v7_openai.js +0 -347
  21. package/src/fixtures/text_response_v7_perplexity.js +0 -764
  22. package/src/generate.spec.js +0 -525
  23. package/src/prompt/content.spec.js +0 -208
  24. package/src/prompt/interpolations.spec.js +0 -109
  25. package/src/prompt/loader.full.spec.js +0 -309
  26. package/src/prompt/loader.spec.js +0 -258
  27. package/src/prompt/markup/attributes.spec.js +0 -132
  28. package/src/prompt/markup/nodes.spec.js +0 -333
  29. package/src/prompt/markup/tokenizer.spec.js +0 -149
  30. package/src/prompt/markup/tokens.spec.js +0 -250
  31. package/src/prompt/validations.spec.js +0 -812
  32. package/src/utils/cost.full.spec.js +0 -272
  33. package/src/utils/cost.spec.js +0 -290
  34. package/src/utils/error_handler.spec.js +0 -230
  35. package/src/utils/file.spec.js +0 -89
  36. package/src/utils/image.spec.js +0 -20
  37. package/src/utils/legacy_cost_attribute.spec.js +0 -278
  38. package/src/utils/models.spec.js +0 -119
  39. package/src/utils/models_pricing.spec.js +0 -162
  40. package/src/utils/skills.spec.js +0 -168
  41. package/src/utils/sources.spec.js +0 -122
  42. package/src/utils/stream.spec.js +0 -55
  43. package/src/utils/tools.spec.js +0 -167
  44. package/src/utils/usage.full.spec.js +0 -215
  45. package/src/utils/usage.spec.js +0 -246
  46. package/src/utils/wrap.spec.js +0 -467
  47. package/src/validations.spec.js +0 -631
@@ -1,764 +0,0 @@
1
- export default {
2
- initialResponseMessages: [],
3
- steps: [
4
- {
5
- callId: 'call-id',
6
- stepNumber: 0,
7
- model: {
8
- provider: 'perplexity',
9
- modelId: 'sonar'
10
- },
11
- runtimeContext: {},
12
- toolsContext: {},
13
- content: [
14
- {
15
- type: 'text',
16
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
17
- },
18
- {
19
- type: 'source',
20
- sourceType: 'url',
21
- id: 'Y1wOpBWV3uYIVMOh',
22
- url: 'https://en.wikipedia.org/wiki/Carburetor'
23
- },
24
- {
25
- type: 'source',
26
- sourceType: 'url',
27
- id: 'LUs0oIpf6m83yr3h',
28
- url: 'https://www.explainthatstuff.com/how-carburetors-work.html'
29
- },
30
- {
31
- type: 'source',
32
- sourceType: 'url',
33
- id: 'TLPODNd9vFnX7aTq',
34
- url: 'https://www.uti.edu/blog/automotive/carburetors'
35
- },
36
- {
37
- type: 'source',
38
- sourceType: 'url',
39
- id: 'oNTdFFCxYnDcJDnk',
40
- url: 'https://www.autozone.com/diy/fuel-systems/what-is-a-carburetor'
41
- },
42
- {
43
- type: 'source',
44
- sourceType: 'url',
45
- id: 'MVfb6xvQBlWpOR0e',
46
- url: 'https://www.hagerty.com/resources/car-knowledge/what-is-a-carburetor-and-how-does-it-work'
47
- },
48
- {
49
- type: 'source',
50
- sourceType: 'url',
51
- id: 'OkRwDvwrhHklNsAc',
52
- url: 'https://www.youtube.com/watch?v=1ohL6KgasjA'
53
- },
54
- {
55
- type: 'source',
56
- sourceType: 'url',
57
- id: '9BrlMyWJBX8qHHw1',
58
- url: 'https://www.autoevolution.com/news/carburetors-a-short-history-and-an-explanation-about-how-they-work-84729.html'
59
- },
60
- {
61
- type: 'source',
62
- sourceType: 'url',
63
- id: 'Hby5UlSWuuJthZBH',
64
- url: 'https://www.youtube.com/watch?v=oIU-lGc3DL4'
65
- },
66
- {
67
- type: 'source',
68
- sourceType: 'url',
69
- id: 'Wl9jtGuJT2Xvduq2',
70
- url: 'https://www.britannica.com/technology/carburetor'
71
- },
72
- {
73
- type: 'source',
74
- sourceType: 'url',
75
- id: 'QY7ndTb20yEDPdgK',
76
- url: 'https://www.carparts.com/blog/whats-a-carburetor-how-it-works-common-types-and-diy-diagnostics-quickref/'
77
- },
78
- {
79
- type: 'source',
80
- sourceType: 'url',
81
- id: '9t5lHrrVIQCcn5e6',
82
- url: 'https://www.youtube.com/watch?v=Tb72lqM1VbU'
83
- },
84
- {
85
- type: 'source',
86
- sourceType: 'url',
87
- id: 'kXiSH1LLTwXhI3df',
88
- url: 'https://www.autozone.com/diy/fuel-systems/what-does-a-carburetor-do'
89
- },
90
- {
91
- type: 'source',
92
- sourceType: 'url',
93
- id: 'gZkzm4p6hcJIP9Nf',
94
- url: 'https://auto.howstuffworks.com/question377.htm'
95
- },
96
- {
97
- type: 'source',
98
- sourceType: 'url',
99
- id: 'a7xPQWIXRzd6M84P',
100
- url: 'https://www.youtube.com/watch?v=MfTpU6HS4cA'
101
- },
102
- {
103
- type: 'source',
104
- sourceType: 'url',
105
- id: 'YHWAR6aoY1r4pXvs',
106
- url: 'https://www.angleofattack.com/how-does-an-airplane-carburetor-work/'
107
- },
108
- {
109
- type: 'source',
110
- sourceType: 'url',
111
- id: 'FUiYtiRn49z8HXKS',
112
- url: 'https://www.hagerty.com/media/maintenance-and-tech/understanding-the-carburetor/'
113
- },
114
- {
115
- type: 'source',
116
- sourceType: 'url',
117
- id: '17jfMMqbimPVDwSW',
118
- url: 'https://www.revzilla.com/common-tread/how-does-a-carburetor-work'
119
- },
120
- {
121
- type: 'source',
122
- sourceType: 'url',
123
- id: 'vWVYMrlLoL0xgpc1',
124
- url: 'https://www.youtube.com/watch?v=toVfvRhWbj8'
125
- },
126
- {
127
- type: 'source',
128
- sourceType: 'url',
129
- id: '7LAKTGKXeADEtR2Y',
130
- url: 'https://www.reddit.com/r/explainlikeimfive/comments/zvizwr/eli5_how_does_a_carburetor_work/'
131
- }
132
- ],
133
- finishReason: 'stop',
134
- rawFinishReason: 'stop',
135
- usage: {
136
- inputTokens: 1025,
137
- inputTokenDetails: {
138
- noCacheTokens: 1025
139
- },
140
- outputTokens: 437,
141
- outputTokenDetails: {
142
- textTokens: 437,
143
- reasoningTokens: 0
144
- },
145
- totalTokens: 1462,
146
- raw: {
147
- prompt_tokens: 1025,
148
- completion_tokens: 437,
149
- total_tokens: 1462,
150
- cost: {
151
- input_tokens_cost: 0.00103,
152
- output_tokens_cost: 0.00044,
153
- request_cost: 0.005,
154
- total_cost: 0.00646
155
- }
156
- }
157
- },
158
- performance: {
159
- effectiveOutputTokensPerSecond: 71.39039559539492,
160
- effectiveTotalTokensPerSecond: 238.83926398276287,
161
- stepTimeMs: 6121.617084999998,
162
- responseTimeMs: 6121.271584999999,
163
- toolExecutionMs: {}
164
- },
165
- warnings: [],
166
- request: {},
167
- response: {
168
- id: 'res-id',
169
- timestamp: '2026-08-25T00:00:00.000Z',
170
- modelId: 'sonar',
171
- headers: {
172
- 'cf-cache-status': 'DYNAMIC',
173
- 'cf-ray': 'cf-id',
174
- connection: 'keep-alive',
175
- 'content-encoding': 'gzip',
176
- 'content-type': 'application/json',
177
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
178
- server: 'cloudflare',
179
- 'set-cookie': '__cflb=token; HttpOnly; SameSite=None; Secure; Path=/; Expires=Tue, 25 Aug 2026 00:00:00 GMT',
180
- 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
181
- 'transfer-encoding': 'chunked',
182
- 'x-ratelimit-limit': '67',
183
- 'x-ratelimit-remaining': '66',
184
- 'x-ratelimit-reset': '1787656221',
185
- 'x-ratelimit-used': '1',
186
- 'x-request-id': 'req-id'
187
- },
188
- messages: [
189
- {
190
- role: 'assistant',
191
- content: [
192
- {
193
- type: 'text',
194
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
195
- }
196
- ]
197
- }
198
- ]
199
- },
200
- providerMetadata: {
201
- perplexity: {
202
- images: null,
203
- usage: {
204
- citationTokens: null,
205
- numSearchQueries: null
206
- },
207
- cost: {
208
- inputTokensCost: 0.00103,
209
- outputTokensCost: 0.00044,
210
- requestCost: 0.005,
211
- totalCost: 0.00646
212
- }
213
- }
214
- }
215
- }
216
- ],
217
- _output: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.',
218
- totalUsage: {
219
- inputTokens: 1025,
220
- inputTokenDetails: {
221
- noCacheTokens: 1025
222
- },
223
- outputTokens: 437,
224
- outputTokenDetails: {
225
- textTokens: 437,
226
- reasoningTokens: 0
227
- },
228
- totalTokens: 1462
229
- },
230
- // these are getters only
231
- finalStep: {
232
- callId: 'call-id',
233
- stepNumber: 0,
234
- model: {
235
- provider: 'perplexity',
236
- modelId: 'sonar'
237
- },
238
- runtimeContext: {},
239
- toolsContext: {},
240
- content: [
241
- {
242
- type: 'text',
243
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
244
- },
245
- {
246
- type: 'source',
247
- sourceType: 'url',
248
- id: 'Y1wOpBWV3uYIVMOh',
249
- url: 'https://en.wikipedia.org/wiki/Carburetor'
250
- },
251
- {
252
- type: 'source',
253
- sourceType: 'url',
254
- id: 'LUs0oIpf6m83yr3h',
255
- url: 'https://www.explainthatstuff.com/how-carburetors-work.html'
256
- },
257
- {
258
- type: 'source',
259
- sourceType: 'url',
260
- id: 'TLPODNd9vFnX7aTq',
261
- url: 'https://www.uti.edu/blog/automotive/carburetors'
262
- },
263
- {
264
- type: 'source',
265
- sourceType: 'url',
266
- id: 'oNTdFFCxYnDcJDnk',
267
- url: 'https://www.autozone.com/diy/fuel-systems/what-is-a-carburetor'
268
- },
269
- {
270
- type: 'source',
271
- sourceType: 'url',
272
- id: 'MVfb6xvQBlWpOR0e',
273
- url: 'https://www.hagerty.com/resources/car-knowledge/what-is-a-carburetor-and-how-does-it-work'
274
- },
275
- {
276
- type: 'source',
277
- sourceType: 'url',
278
- id: 'OkRwDvwrhHklNsAc',
279
- url: 'https://www.youtube.com/watch?v=1ohL6KgasjA'
280
- },
281
- {
282
- type: 'source',
283
- sourceType: 'url',
284
- id: '9BrlMyWJBX8qHHw1',
285
- url: 'https://www.autoevolution.com/news/carburetors-a-short-history-and-an-explanation-about-how-they-work-84729.html'
286
- },
287
- {
288
- type: 'source',
289
- sourceType: 'url',
290
- id: 'Hby5UlSWuuJthZBH',
291
- url: 'https://www.youtube.com/watch?v=oIU-lGc3DL4'
292
- },
293
- {
294
- type: 'source',
295
- sourceType: 'url',
296
- id: 'Wl9jtGuJT2Xvduq2',
297
- url: 'https://www.britannica.com/technology/carburetor'
298
- },
299
- {
300
- type: 'source',
301
- sourceType: 'url',
302
- id: 'QY7ndTb20yEDPdgK',
303
- url: 'https://www.carparts.com/blog/whats-a-carburetor-how-it-works-common-types-and-diy-diagnostics-quickref/'
304
- },
305
- {
306
- type: 'source',
307
- sourceType: 'url',
308
- id: '9t5lHrrVIQCcn5e6',
309
- url: 'https://www.youtube.com/watch?v=Tb72lqM1VbU'
310
- },
311
- {
312
- type: 'source',
313
- sourceType: 'url',
314
- id: 'kXiSH1LLTwXhI3df',
315
- url: 'https://www.autozone.com/diy/fuel-systems/what-does-a-carburetor-do'
316
- },
317
- {
318
- type: 'source',
319
- sourceType: 'url',
320
- id: 'gZkzm4p6hcJIP9Nf',
321
- url: 'https://auto.howstuffworks.com/question377.htm'
322
- },
323
- {
324
- type: 'source',
325
- sourceType: 'url',
326
- id: 'a7xPQWIXRzd6M84P',
327
- url: 'https://www.youtube.com/watch?v=MfTpU6HS4cA'
328
- },
329
- {
330
- type: 'source',
331
- sourceType: 'url',
332
- id: 'YHWAR6aoY1r4pXvs',
333
- url: 'https://www.angleofattack.com/how-does-an-airplane-carburetor-work/'
334
- },
335
- {
336
- type: 'source',
337
- sourceType: 'url',
338
- id: 'FUiYtiRn49z8HXKS',
339
- url: 'https://www.hagerty.com/media/maintenance-and-tech/understanding-the-carburetor/'
340
- },
341
- {
342
- type: 'source',
343
- sourceType: 'url',
344
- id: '17jfMMqbimPVDwSW',
345
- url: 'https://www.revzilla.com/common-tread/how-does-a-carburetor-work'
346
- },
347
- {
348
- type: 'source',
349
- sourceType: 'url',
350
- id: 'vWVYMrlLoL0xgpc1',
351
- url: 'https://www.youtube.com/watch?v=toVfvRhWbj8'
352
- },
353
- {
354
- type: 'source',
355
- sourceType: 'url',
356
- id: '7LAKTGKXeADEtR2Y',
357
- url: 'https://www.reddit.com/r/explainlikeimfive/comments/zvizwr/eli5_how_does_a_carburetor_work/'
358
- }
359
- ],
360
- finishReason: 'stop',
361
- rawFinishReason: 'stop',
362
- usage: {
363
- inputTokens: 1025,
364
- inputTokenDetails: {
365
- noCacheTokens: 1025
366
- },
367
- outputTokens: 437,
368
- outputTokenDetails: {
369
- textTokens: 437,
370
- reasoningTokens: 0
371
- },
372
- totalTokens: 1462,
373
- raw: {
374
- prompt_tokens: 1025,
375
- completion_tokens: 437,
376
- total_tokens: 1462,
377
- cost: {
378
- input_tokens_cost: 0.00103,
379
- output_tokens_cost: 0.00044,
380
- request_cost: 0.005,
381
- total_cost: 0.00646
382
- }
383
- }
384
- },
385
- performance: {
386
- effectiveOutputTokensPerSecond: 71.39039559539492,
387
- effectiveTotalTokensPerSecond: 238.83926398276287,
388
- stepTimeMs: 6121.617084999998,
389
- responseTimeMs: 6121.271584999999,
390
- toolExecutionMs: {}
391
- },
392
- warnings: [],
393
- request: {},
394
- response: {
395
- id: 'res-id',
396
- timestamp: '2026-08-25T00:00:00.000Z',
397
- modelId: 'sonar',
398
- headers: {
399
- 'cf-cache-status': 'DYNAMIC',
400
- 'cf-ray': 'cf-id',
401
- connection: 'keep-alive',
402
- 'content-encoding': 'gzip',
403
- 'content-type': 'application/json',
404
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
405
- server: 'cloudflare',
406
- 'set-cookie': '__cflb=token; HttpOnly; SameSite=None; Secure; Path=/; Expires=Tue, 25 Aug 2026 00:00:00 GMT',
407
- 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
408
- 'transfer-encoding': 'chunked',
409
- 'x-ratelimit-limit': '67',
410
- 'x-ratelimit-remaining': '66',
411
- 'x-ratelimit-reset': '1787656221',
412
- 'x-ratelimit-used': '1',
413
- 'x-request-id': 'req-id'
414
- },
415
- messages: [
416
- {
417
- role: 'assistant',
418
- content: [
419
- {
420
- type: 'text',
421
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
422
- }
423
- ]
424
- }
425
- ]
426
- },
427
- providerMetadata: {
428
- perplexity: {
429
- images: null,
430
- usage: {
431
- citationTokens: null,
432
- numSearchQueries: null
433
- },
434
- cost: {
435
- inputTokensCost: 0.00103,
436
- outputTokensCost: 0.00044,
437
- requestCost: 0.005,
438
- totalCost: 0.00646
439
- }
440
- }
441
- }
442
- },
443
- content: [
444
- {
445
- type: 'text',
446
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
447
- },
448
- {
449
- type: 'source',
450
- sourceType: 'url',
451
- id: 'Y1wOpBWV3uYIVMOh',
452
- url: 'https://en.wikipedia.org/wiki/Carburetor'
453
- },
454
- {
455
- type: 'source',
456
- sourceType: 'url',
457
- id: 'LUs0oIpf6m83yr3h',
458
- url: 'https://www.explainthatstuff.com/how-carburetors-work.html'
459
- },
460
- {
461
- type: 'source',
462
- sourceType: 'url',
463
- id: 'TLPODNd9vFnX7aTq',
464
- url: 'https://www.uti.edu/blog/automotive/carburetors'
465
- },
466
- {
467
- type: 'source',
468
- sourceType: 'url',
469
- id: 'oNTdFFCxYnDcJDnk',
470
- url: 'https://www.autozone.com/diy/fuel-systems/what-is-a-carburetor'
471
- },
472
- {
473
- type: 'source',
474
- sourceType: 'url',
475
- id: 'MVfb6xvQBlWpOR0e',
476
- url: 'https://www.hagerty.com/resources/car-knowledge/what-is-a-carburetor-and-how-does-it-work'
477
- },
478
- {
479
- type: 'source',
480
- sourceType: 'url',
481
- id: 'OkRwDvwrhHklNsAc',
482
- url: 'https://www.youtube.com/watch?v=1ohL6KgasjA'
483
- },
484
- {
485
- type: 'source',
486
- sourceType: 'url',
487
- id: '9BrlMyWJBX8qHHw1',
488
- url: 'https://www.autoevolution.com/news/carburetors-a-short-history-and-an-explanation-about-how-they-work-84729.html'
489
- },
490
- {
491
- type: 'source',
492
- sourceType: 'url',
493
- id: 'Hby5UlSWuuJthZBH',
494
- url: 'https://www.youtube.com/watch?v=oIU-lGc3DL4'
495
- },
496
- {
497
- type: 'source',
498
- sourceType: 'url',
499
- id: 'Wl9jtGuJT2Xvduq2',
500
- url: 'https://www.britannica.com/technology/carburetor'
501
- },
502
- {
503
- type: 'source',
504
- sourceType: 'url',
505
- id: 'QY7ndTb20yEDPdgK',
506
- url: 'https://www.carparts.com/blog/whats-a-carburetor-how-it-works-common-types-and-diy-diagnostics-quickref/'
507
- },
508
- {
509
- type: 'source',
510
- sourceType: 'url',
511
- id: '9t5lHrrVIQCcn5e6',
512
- url: 'https://www.youtube.com/watch?v=Tb72lqM1VbU'
513
- },
514
- {
515
- type: 'source',
516
- sourceType: 'url',
517
- id: 'kXiSH1LLTwXhI3df',
518
- url: 'https://www.autozone.com/diy/fuel-systems/what-does-a-carburetor-do'
519
- },
520
- {
521
- type: 'source',
522
- sourceType: 'url',
523
- id: 'gZkzm4p6hcJIP9Nf',
524
- url: 'https://auto.howstuffworks.com/question377.htm'
525
- },
526
- {
527
- type: 'source',
528
- sourceType: 'url',
529
- id: 'a7xPQWIXRzd6M84P',
530
- url: 'https://www.youtube.com/watch?v=MfTpU6HS4cA'
531
- },
532
- {
533
- type: 'source',
534
- sourceType: 'url',
535
- id: 'YHWAR6aoY1r4pXvs',
536
- url: 'https://www.angleofattack.com/how-does-an-airplane-carburetor-work/'
537
- },
538
- {
539
- type: 'source',
540
- sourceType: 'url',
541
- id: 'FUiYtiRn49z8HXKS',
542
- url: 'https://www.hagerty.com/media/maintenance-and-tech/understanding-the-carburetor/'
543
- },
544
- {
545
- type: 'source',
546
- sourceType: 'url',
547
- id: '17jfMMqbimPVDwSW',
548
- url: 'https://www.revzilla.com/common-tread/how-does-a-carburetor-work'
549
- },
550
- {
551
- type: 'source',
552
- sourceType: 'url',
553
- id: 'vWVYMrlLoL0xgpc1',
554
- url: 'https://www.youtube.com/watch?v=toVfvRhWbj8'
555
- },
556
- {
557
- type: 'source',
558
- sourceType: 'url',
559
- id: '7LAKTGKXeADEtR2Y',
560
- url: 'https://www.reddit.com/r/explainlikeimfive/comments/zvizwr/eli5_how_does_a_carburetor_work/'
561
- }
562
- ],
563
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.',
564
- files: [],
565
- reasoning: [],
566
- toolCalls: [],
567
- staticToolCalls: [],
568
- dynamicToolCalls: [],
569
- toolResults: [],
570
- staticToolResults: [],
571
- dynamicToolResults: [],
572
- sources: [
573
- {
574
- type: 'source',
575
- sourceType: 'url',
576
- id: 'Y1wOpBWV3uYIVMOh',
577
- url: 'https://en.wikipedia.org/wiki/Carburetor'
578
- },
579
- {
580
- type: 'source',
581
- sourceType: 'url',
582
- id: 'LUs0oIpf6m83yr3h',
583
- url: 'https://www.explainthatstuff.com/how-carburetors-work.html'
584
- },
585
- {
586
- type: 'source',
587
- sourceType: 'url',
588
- id: 'TLPODNd9vFnX7aTq',
589
- url: 'https://www.uti.edu/blog/automotive/carburetors'
590
- },
591
- {
592
- type: 'source',
593
- sourceType: 'url',
594
- id: 'oNTdFFCxYnDcJDnk',
595
- url: 'https://www.autozone.com/diy/fuel-systems/what-is-a-carburetor'
596
- },
597
- {
598
- type: 'source',
599
- sourceType: 'url',
600
- id: 'MVfb6xvQBlWpOR0e',
601
- url: 'https://www.hagerty.com/resources/car-knowledge/what-is-a-carburetor-and-how-does-it-work'
602
- },
603
- {
604
- type: 'source',
605
- sourceType: 'url',
606
- id: 'OkRwDvwrhHklNsAc',
607
- url: 'https://www.youtube.com/watch?v=1ohL6KgasjA'
608
- },
609
- {
610
- type: 'source',
611
- sourceType: 'url',
612
- id: '9BrlMyWJBX8qHHw1',
613
- url: 'https://www.autoevolution.com/news/carburetors-a-short-history-and-an-explanation-about-how-they-work-84729.html'
614
- },
615
- {
616
- type: 'source',
617
- sourceType: 'url',
618
- id: 'Hby5UlSWuuJthZBH',
619
- url: 'https://www.youtube.com/watch?v=oIU-lGc3DL4'
620
- },
621
- {
622
- type: 'source',
623
- sourceType: 'url',
624
- id: 'Wl9jtGuJT2Xvduq2',
625
- url: 'https://www.britannica.com/technology/carburetor'
626
- },
627
- {
628
- type: 'source',
629
- sourceType: 'url',
630
- id: 'QY7ndTb20yEDPdgK',
631
- url: 'https://www.carparts.com/blog/whats-a-carburetor-how-it-works-common-types-and-diy-diagnostics-quickref/'
632
- },
633
- {
634
- type: 'source',
635
- sourceType: 'url',
636
- id: '9t5lHrrVIQCcn5e6',
637
- url: 'https://www.youtube.com/watch?v=Tb72lqM1VbU'
638
- },
639
- {
640
- type: 'source',
641
- sourceType: 'url',
642
- id: 'kXiSH1LLTwXhI3df',
643
- url: 'https://www.autozone.com/diy/fuel-systems/what-does-a-carburetor-do'
644
- },
645
- {
646
- type: 'source',
647
- sourceType: 'url',
648
- id: 'gZkzm4p6hcJIP9Nf',
649
- url: 'https://auto.howstuffworks.com/question377.htm'
650
- },
651
- {
652
- type: 'source',
653
- sourceType: 'url',
654
- id: 'a7xPQWIXRzd6M84P',
655
- url: 'https://www.youtube.com/watch?v=MfTpU6HS4cA'
656
- },
657
- {
658
- type: 'source',
659
- sourceType: 'url',
660
- id: 'YHWAR6aoY1r4pXvs',
661
- url: 'https://www.angleofattack.com/how-does-an-airplane-carburetor-work/'
662
- },
663
- {
664
- type: 'source',
665
- sourceType: 'url',
666
- id: 'FUiYtiRn49z8HXKS',
667
- url: 'https://www.hagerty.com/media/maintenance-and-tech/understanding-the-carburetor/'
668
- },
669
- {
670
- type: 'source',
671
- sourceType: 'url',
672
- id: '17jfMMqbimPVDwSW',
673
- url: 'https://www.revzilla.com/common-tread/how-does-a-carburetor-work'
674
- },
675
- {
676
- type: 'source',
677
- sourceType: 'url',
678
- id: 'vWVYMrlLoL0xgpc1',
679
- url: 'https://www.youtube.com/watch?v=toVfvRhWbj8'
680
- },
681
- {
682
- type: 'source',
683
- sourceType: 'url',
684
- id: '7LAKTGKXeADEtR2Y',
685
- url: 'https://www.reddit.com/r/explainlikeimfive/comments/zvizwr/eli5_how_does_a_carburetor_work/'
686
- }
687
- ],
688
- finishReason: 'stop',
689
- rawFinishReason: 'stop',
690
- warnings: [],
691
- providerMetadata: {
692
- perplexity: {
693
- images: null,
694
- usage: {
695
- citationTokens: null,
696
- numSearchQueries: null
697
- },
698
- cost: {
699
- inputTokensCost: 0.00103,
700
- outputTokensCost: 0.00044,
701
- requestCost: 0.005,
702
- totalCost: 0.00646
703
- }
704
- }
705
- },
706
- response: {
707
- id: 'res-id',
708
- timestamp: '2026-08-25T00:00:00.000Z',
709
- modelId: 'sonar',
710
- headers: {
711
- 'cf-cache-status': 'DYNAMIC',
712
- 'cf-ray': 'cf-id',
713
- connection: 'keep-alive',
714
- 'content-encoding': 'gzip',
715
- 'content-type': 'application/json',
716
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
717
- server: 'cloudflare',
718
- 'set-cookie': '__cflb=token; HttpOnly; SameSite=None; Secure; Path=/; Expires=Tue, 25 Aug 2026 00:00:00 GMT',
719
- 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
720
- 'transfer-encoding': 'chunked',
721
- 'x-ratelimit-limit': '67',
722
- 'x-ratelimit-remaining': '66',
723
- 'x-ratelimit-reset': '1787656221',
724
- 'x-ratelimit-used': '1',
725
- 'x-request-id': 'req-id'
726
- },
727
- messages: [
728
- {
729
- role: 'assistant',
730
- content: [
731
- {
732
- type: 'text',
733
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
734
- }
735
- ]
736
- }
737
- ]
738
- },
739
- responseMessages: [
740
- {
741
- role: 'assistant',
742
- content: [
743
- {
744
- type: 'text',
745
- text: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
746
- }
747
- ]
748
- }
749
- ],
750
- request: {},
751
- usage: {
752
- inputTokens: 1025,
753
- inputTokenDetails: {
754
- noCacheTokens: 1025
755
- },
756
- outputTokens: 437,
757
- outputTokenDetails: {
758
- textTokens: 437,
759
- reasoningTokens: 0
760
- },
761
- totalTokens: 1462
762
- },
763
- output: 'A **carburetor** is a mechanical device that mixes **air** and **gasoline** in the right proportion before the mixture enters an engine and is burned.[1][4][9] It was the standard way to feed fuel to many gasoline engines before **fuel injection** became common.[1][6][9]\n\nThe simplest mental model is: think of a carburetor as a carefully shaped tube with a fuel reservoir attached. As air moves through a narrowed section called a **venturi**, its pressure drops and that helps pull fuel into the airflow, creating a combustible mix.[1][5][9]\n\nHow it works in practice:\n\n- Air enters the carburetor and speeds up through the venturi, which lowers pressure.[1][5]\n- That pressure drop draws fuel from a small chamber into the airflow.[5][9]\n- The carburetor adjusts the mixture for different conditions such as **idling**, normal driving, and acceleration using parts like the **choke**, **jets**, **throttle**, and **accelerator pump**.[9][12]\n- The mixed air-fuel charge then goes into the engine cylinders, where a spark plug ignites it.[4][13]\n\nWhy carburetors mattered:\n\n- They provided a way to meter fuel without electronic controls.[1][10]\n- They were widely used for decades in cars, motorcycles, small engines, and some aircraft engines.[9][15]\n- They are now mostly replaced by **fuel injection**, which is generally more precise and easier to control under changing conditions.[1][6][19]\n\nA common confusion is that a carburetor does not *create* power on its own; it simply prepares the **air-fuel mixture** so the engine can burn it efficiently.[4][12][13]\n\nIf you want, I can also explain:\n- the **main parts** of a carburetor,\n- **how a choke works**, or\n- **carburetor vs. fuel injection**.'
764
- };