@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,353 +0,0 @@
1
- export default {
2
- callId: 'call-id',
3
- toolsContext: {},
4
- stepNumber: 0,
5
- model: {
6
- provider: 'openai.responses',
7
- modelId: 'gpt-4.1-mini'
8
- },
9
- runtimeContext: {},
10
- finishReason: 'stop',
11
- usage: {
12
- inputTokens: 1035,
13
- inputTokenDetails: {
14
- noCacheTokens: 1035,
15
- cacheReadTokens: 0,
16
- cacheWriteTokens: 0
17
- },
18
- outputTokens: 386,
19
- outputTokenDetails: {
20
- textTokens: 386,
21
- reasoningTokens: 0
22
- },
23
- totalTokens: 1421
24
- },
25
- totalUsage: {
26
- inputTokens: 1035,
27
- inputTokenDetails: {
28
- noCacheTokens: 1035,
29
- cacheReadTokens: 0,
30
- cacheWriteTokens: 0
31
- },
32
- outputTokens: 386,
33
- outputTokenDetails: {
34
- textTokens: 386,
35
- reasoningTokens: 0
36
- },
37
- totalTokens: 1421
38
- },
39
- content: [
40
- {
41
- type: 'text',
42
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
43
- providerMetadata: {
44
- openai: {
45
- itemId: 'msg-id'
46
- }
47
- }
48
- }
49
- ],
50
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
51
- reasoning: [],
52
- files: [],
53
- sources: [],
54
- toolCalls: [],
55
- staticToolCalls: [],
56
- dynamicToolCalls: [],
57
- toolResults: [],
58
- staticToolResults: [],
59
- dynamicToolResults: [],
60
- responseMessages: [
61
- {
62
- role: 'assistant',
63
- content: [
64
- {
65
- type: 'text',
66
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
67
- providerOptions: {
68
- openai: {
69
- itemId: 'msg-id'
70
- }
71
- }
72
- }
73
- ]
74
- }
75
- ],
76
- warnings: [],
77
- request: {},
78
- response: {
79
- id: 'res-id',
80
- timestamp: '2026-08-25T00:00:00.000Z',
81
- modelId: 'gpt-4.1-mini-2025-04-14',
82
- headers: {
83
- 'access-control-expose-headers': 'X-Request-ID, CF-Ray, CF-Ray',
84
- 'alt-svc': 'h3=":443"; ma=86400',
85
- 'cf-cache-status': 'DYNAMIC',
86
- 'cf-ray': 'cf-id',
87
- connection: 'keep-alive',
88
- 'content-type': 'text/event-stream; charset=utf-8',
89
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
90
- 'openai-organization': 'org-id',
91
- 'openai-processing-ms': '808',
92
- 'openai-project': 'proj-id',
93
- 'openai-version': '2020-10-01',
94
- server: 'cloudflare',
95
- 'set-cookie': '__cf_bm=token; HttpOnly; SameSite=None; Secure; Path=/; Domain=api.openai.com; Expires=Tue, 25 Aug 2026 00:00:00 GMT',
96
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
97
- 'transfer-encoding': 'chunked',
98
- 'x-content-type-options': 'nosniff',
99
- 'x-request-id': 'req-id'
100
- },
101
- messages: [
102
- {
103
- role: 'assistant',
104
- content: [
105
- {
106
- type: 'text',
107
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
108
- providerOptions: {
109
- openai: {
110
- itemId: 'msg-id'
111
- }
112
- }
113
- }
114
- ]
115
- }
116
- ]
117
- },
118
- providerMetadata: {
119
- openai: {
120
- responseId: 'res-id',
121
- serviceTier: 'default'
122
- }
123
- },
124
- steps: [
125
- {
126
- callId: 'call-id',
127
- stepNumber: 0,
128
- model: {
129
- provider: 'openai.responses',
130
- modelId: 'gpt-4.1-mini'
131
- },
132
- runtimeContext: {},
133
- toolsContext: {},
134
- content: [
135
- {
136
- type: 'text',
137
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
138
- providerMetadata: {
139
- openai: {
140
- itemId: 'msg-id'
141
- }
142
- }
143
- }
144
- ],
145
- finishReason: 'stop',
146
- usage: {
147
- inputTokens: 1035,
148
- inputTokenDetails: {
149
- noCacheTokens: 1035,
150
- cacheReadTokens: 0,
151
- cacheWriteTokens: 0
152
- },
153
- outputTokens: 386,
154
- outputTokenDetails: {
155
- textTokens: 386,
156
- reasoningTokens: 0
157
- },
158
- totalTokens: 1421,
159
- raw: {
160
- input_tokens: 1035,
161
- input_tokens_details: {
162
- cached_tokens: 0,
163
- cache_write_tokens: 0
164
- },
165
- output_tokens: 386,
166
- output_tokens_details: {
167
- reasoning_tokens: 0
168
- }
169
- }
170
- },
171
- performance: {
172
- stepTimeMs: 12687.486881,
173
- toolExecutionMs: {},
174
- responseTimeMs: 12685.481256,
175
- effectiveOutputTokensPerSecond: 30.428486882784135,
176
- outputTokensPerSecond: 41.67483644163321,
177
- inputTokensPerSecond: 302.3400828838608,
178
- effectiveTotalTokensPerSecond: 112.01782347263278,
179
- timeToFirstOutputMs: 3423.297335,
180
- timeBetweenOutputChunksMs: {
181
- min: 0.03933300000062445,
182
- p10: 1.7335000000020955,
183
- median: 12.191209000000526,
184
- avg: 23.97169651822917,
185
- p90: 51.92025000000103,
186
- max: 436.5465009999989
187
- }
188
- },
189
- warnings: [],
190
- request: {},
191
- response: {
192
- id: 'res-id',
193
- timestamp: '2026-08-25T00:00:00.000Z',
194
- modelId: 'gpt-4.1-mini-2025-04-14',
195
- headers: {
196
- 'access-control-expose-headers': 'X-Request-ID, CF-Ray, CF-Ray',
197
- 'alt-svc': 'h3=":443"; ma=86400',
198
- 'cf-cache-status': 'DYNAMIC',
199
- 'cf-ray': 'cf-id',
200
- connection: 'keep-alive',
201
- 'content-type': 'text/event-stream; charset=utf-8',
202
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
203
- 'openai-organization': 'org-id',
204
- 'openai-processing-ms': '808',
205
- 'openai-project': 'proj-id',
206
- 'openai-version': '2020-10-01',
207
- server: 'cloudflare',
208
- 'set-cookie': '__cf_bm=token; HttpOnly; SameSite=None; Secure; Path=/; Domain=api.openai.com; Expires=Tue, 25 Aug 2026 00:00:00 GMT',
209
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
210
- 'transfer-encoding': 'chunked',
211
- 'x-content-type-options': 'nosniff',
212
- 'x-request-id': 'req-id'
213
- },
214
- messages: [
215
- {
216
- role: 'assistant',
217
- content: [
218
- {
219
- type: 'text',
220
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
221
- providerOptions: {
222
- openai: {
223
- itemId: 'msg-id'
224
- }
225
- }
226
- }
227
- ]
228
- }
229
- ]
230
- },
231
- providerMetadata: {
232
- openai: {
233
- responseId: 'res-id',
234
- serviceTier: 'default'
235
- }
236
- }
237
- }
238
- ],
239
- finalStep: {
240
- callId: 'call-id',
241
- stepNumber: 0,
242
- model: {
243
- provider: 'openai.responses',
244
- modelId: 'gpt-4.1-mini'
245
- },
246
- runtimeContext: {},
247
- toolsContext: {},
248
- content: [
249
- {
250
- type: 'text',
251
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
252
- providerMetadata: {
253
- openai: {
254
- itemId: 'msg-id'
255
- }
256
- }
257
- }
258
- ],
259
- finishReason: 'stop',
260
- usage: {
261
- inputTokens: 1035,
262
- inputTokenDetails: {
263
- noCacheTokens: 1035,
264
- cacheReadTokens: 0,
265
- cacheWriteTokens: 0
266
- },
267
- outputTokens: 386,
268
- outputTokenDetails: {
269
- textTokens: 386,
270
- reasoningTokens: 0
271
- },
272
- totalTokens: 1421,
273
- raw: {
274
- input_tokens: 1035,
275
- input_tokens_details: {
276
- cached_tokens: 0,
277
- cache_write_tokens: 0
278
- },
279
- output_tokens: 386,
280
- output_tokens_details: {
281
- reasoning_tokens: 0
282
- }
283
- }
284
- },
285
- performance: {
286
- stepTimeMs: 12687.486881,
287
- toolExecutionMs: {},
288
- responseTimeMs: 12685.481256,
289
- effectiveOutputTokensPerSecond: 30.428486882784135,
290
- outputTokensPerSecond: 41.67483644163321,
291
- inputTokensPerSecond: 302.3400828838608,
292
- effectiveTotalTokensPerSecond: 112.01782347263278,
293
- timeToFirstOutputMs: 3423.297335,
294
- timeBetweenOutputChunksMs: {
295
- min: 0.03933300000062445,
296
- p10: 1.7335000000020955,
297
- median: 12.191209000000526,
298
- avg: 23.97169651822917,
299
- p90: 51.92025000000103,
300
- max: 436.5465009999989
301
- }
302
- },
303
- warnings: [],
304
- request: {},
305
- response: {
306
- id: 'res-id',
307
- timestamp: '2026-08-25T00:00:00.000Z',
308
- modelId: 'gpt-4.1-mini-2025-04-14',
309
- headers: {
310
- 'access-control-expose-headers': 'X-Request-ID, CF-Ray, CF-Ray',
311
- 'alt-svc': 'h3=":443"; ma=86400',
312
- 'cf-cache-status': 'DYNAMIC',
313
- 'cf-ray': 'cf-id',
314
- connection: 'keep-alive',
315
- 'content-type': 'text/event-stream; charset=utf-8',
316
- date: 'Tue, 25 Aug 2026 00:00:00 GMT',
317
- 'openai-organization': 'org-id',
318
- 'openai-processing-ms': '808',
319
- 'openai-project': 'proj-id',
320
- 'openai-version': '2020-10-01',
321
- server: 'cloudflare',
322
- 'set-cookie': '__cf_bm=token; HttpOnly; SameSite=None; Secure; Path=/; Domain=api.openai.com; Expires=Tue, 25 Aug 2026 00:00:00 GMT',
323
- 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
324
- 'transfer-encoding': 'chunked',
325
- 'x-content-type-options': 'nosniff',
326
- 'x-request-id': 'req-id'
327
- },
328
- messages: [
329
- {
330
- role: 'assistant',
331
- content: [
332
- {
333
- type: 'text',
334
- text: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.',
335
- providerOptions: {
336
- openai: {
337
- itemId: 'msg-id'
338
- }
339
- }
340
- }
341
- ]
342
- }
343
- ]
344
- },
345
- providerMetadata: {
346
- openai: {
347
- responseId: 'res-id',
348
- serviceTier: 'default'
349
- }
350
- }
351
- },
352
- output: 'A *carburetor* is a mechanical device in older gasoline engines that mixes air and fuel in the right proportions before sending it into the engine’s cylinders to burn. It matters because this air-fuel mix controls how well the engine runs, affecting power, fuel efficiency, and emissions.\n\nAt its simplest, think of the carburetor as a funnel where air flows through a narrow passage, and gasoline is sprayed into that airflow. The faster air moves, the more fuel it pulls in, creating a balanced mixture for combustion. This is just a starting point, as carburetors have several parts that fine-tune this process.\n\nKey parts include:\n- The *venturi*, a narrow section that speeds up air and lowers its pressure, drawing fuel from the float chamber.\n- The *float chamber*, which holds a small supply of fuel at a steady level.\n- *Jets*, small openings that control fuel flow into the air stream.\n- Throttle plates which adjust how much air-fuel mixture enters the engine, controlling speed and power.\n\nFor example, when you press the gas pedal, the throttle opens, letting in more air. The venturi effect pulls more fuel into this air, enriching the mixture, so the engine runs faster. When you let off the gas, the throttle closes, reducing air and fuel flow, slowing the engine.\n\nCarburetors were common before electronic fuel injection systems took over because they are simpler and don’t require computers. However, carburetors can be less precise, leading to less efficient fuel use and more pollution.\n\nIn short, a carburetor is an ingenious, purely mechanical way to mix air and fuel for an engine, but modern cars mostly use electronic systems for better control. If you want to go deeper, you can explore how different types of carburetors work, like single vs. multiple barrel, or how they adjust for altitude and temperature changes.'
353
- };