@agentionai/agents 0.13.0 → 1.0.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.
@@ -1,16 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.LlamaCppAgent = void 0;
7
- const openai_1 = __importDefault(require("openai"));
8
- const BaseAgent_1 = require("../BaseAgent");
9
- const AgentEvent_1 = require("../AgentEvent");
10
- const AgentError_1 = require("../errors/AgentError");
11
- const transformers_1 = require("../../history/transformers");
12
- const VizReporter_1 = require("../../viz/VizReporter");
13
- const VizConfig_1 = require("../../viz/VizConfig");
4
+ const OpenAICompatibleAgent_1 = require("../openai-compatible/OpenAICompatibleAgent");
14
5
  /**
15
6
  * Agent for locally-hosted models served by a llama.cpp server (`llama-server`),
16
7
  * which exposes an OpenAI-compatible `/v1/chat/completions` API.
@@ -23,7 +14,6 @@ const VizConfig_1 = require("../../viz/VizConfig");
23
14
  * id: "1",
24
15
  * name: "Assistant",
25
16
  * description: "A helpful assistant",
26
- * apiKey: "",
27
17
  * baseURL: "http://localhost:8080/v1",
28
18
  * });
29
19
  *
@@ -35,227 +25,19 @@ const VizConfig_1 = require("../../viz/VizConfig");
35
25
  * const models = await agent.listModels();
36
26
  * ```
37
27
  */
38
- class LlamaCppAgent extends BaseAgent_1.BaseAgent {
28
+ class LlamaCppAgent extends OpenAICompatibleAgent_1.OpenAICompatibleAgent {
39
29
  constructor(config, history) {
40
- super({ ...config, vendor: "llamacpp" }, history);
41
- /** Count of tool calls in current execution */
42
- this.currentToolCallCount = 0;
43
30
  const vendorConfig = config.vendorConfig?.llamacpp || {};
44
31
  const baseURL = config.baseURL ?? vendorConfig.baseURL ?? "http://localhost:8080/v1";
45
- this.client = new openai_1.default({
46
- apiKey: config.apiKey || "not-needed",
32
+ super({
33
+ ...config,
34
+ vendor: "llamacpp",
47
35
  baseURL,
48
- });
49
- this.config = {
50
- model: config.model || "default",
51
- baseURL,
52
- maxTokens: config.maxTokens,
53
- temperature: config.temperature,
54
- topP: config.topP,
55
- stopSequences: config.stopSequences,
56
- seed: config.seed,
57
- presencePenalty: config.presencePenalty,
58
- frequencyPenalty: config.frequencyPenalty,
59
- apiKey: config.apiKey,
60
- };
61
- this.addSystemMessage(this.getSystemMessage());
62
- }
63
- /**
64
- * List the models currently available on the llama.cpp server (via its
65
- * OpenAI-compatible `/v1/models` endpoint).
66
- */
67
- async listModels() {
68
- try {
69
- const page = await this.client.models.list();
70
- return page.data;
71
- }
72
- catch (error) {
73
- throw new AgentError_1.ExecutionError(`Failed to list llama.cpp models: ${error instanceof Error ? error.message : "Unknown error"}`);
74
- }
75
- }
76
- getToolDefinitions() {
77
- return Array.from(this.tools.values()).map((tool) => {
78
- const prompt = tool.getPrompt();
79
- return {
80
- type: "function",
81
- function: {
82
- name: prompt.name,
83
- description: prompt.description,
84
- parameters: prompt.input_schema,
85
- },
86
- };
87
- });
88
- }
89
- async process(_input) {
90
- return "";
91
- }
92
- async execute(input) {
93
- this.emit(AgentEvent_1.AgentEvent.BEFORE_EXECUTE, input);
94
- this.lastTokenUsage = undefined;
95
- this.currentToolCallCount = 0;
96
- const inputPreview = typeof input === "string" ? input : JSON.stringify(input);
97
- if (VizConfig_1.vizConfig.isEnabled()) {
98
- this.vizEventId = VizReporter_1.vizReporter.agentStart(this.id, this.name, this.config.model, "llamacpp", inputPreview);
99
- }
100
- if (this.history.transient) {
101
- this.history.clear();
102
- this.addSystemMessage(this.getSystemMessage());
103
- }
104
- if (typeof input === "string") {
105
- this.addTextToHistory("user", input);
106
- }
107
- else {
108
- this.addMessageToHistory("user", input);
109
- }
110
- this.history.setSessionAnchor();
111
- this.history.beginExecution();
112
- try {
113
- const response = await this.callLlamaCpp();
114
- this.emit(AgentEvent_1.AgentEvent.AFTER_EXECUTE, response);
115
- return await this.handleResponse(response);
116
- }
117
- catch (error) {
118
- if (error instanceof openai_1.default.APIError) {
119
- const apiError = new AgentError_1.ApiError(`llama.cpp API error: ${error.message}`, error.status, error);
120
- this.emit(AgentEvent_1.AgentEvent.ERROR, apiError);
121
- if (this.vizEventId) {
122
- VizReporter_1.vizReporter.agentError(this.vizEventId, "ApiError", apiError.message, error.status === 429);
123
- this.vizEventId = undefined;
124
- }
125
- throw apiError;
126
- }
127
- if (error instanceof AgentError_1.ExecutionError || error instanceof AgentError_1.ApiError) {
128
- this.emit(AgentEvent_1.AgentEvent.ERROR, error);
129
- if (this.vizEventId) {
130
- VizReporter_1.vizReporter.agentError(this.vizEventId, error.constructor.name, error.message, false);
131
- this.vizEventId = undefined;
132
- }
133
- throw error;
134
- }
135
- const executionError = new AgentError_1.ExecutionError(`llama.cpp error: ${error instanceof Error ? error.message : "Unknown error"}`);
136
- this.emit(AgentEvent_1.AgentEvent.ERROR, executionError);
137
- if (this.vizEventId) {
138
- VizReporter_1.vizReporter.agentError(this.vizEventId, "ExecutionError", executionError.message, false);
139
- this.vizEventId = undefined;
140
- }
141
- throw executionError;
142
- }
143
- finally {
144
- this.history.endExecution();
145
- }
146
- }
147
- async callLlamaCpp() {
148
- const messages = transformers_1.chatCompletionsTransformer.toProvider(this.history.getEntries());
149
- const tools = this.tools.size > 0 ? this.getToolDefinitions() : undefined;
150
- return this.client.chat.completions.create({
151
- model: this.config.model,
152
- messages,
153
- tools,
154
- stream: false,
155
- max_tokens: this.config.maxTokens,
156
- temperature: this.config.temperature,
157
- top_p: this.config.topP,
158
- stop: this.config.stopSequences,
159
- seed: this.config.seed,
160
- presence_penalty: this.config.presencePenalty,
161
- frequency_penalty: this.config.frequencyPenalty,
162
- });
163
- }
164
- async handleResponse(response) {
165
- const usage = this.parseUsage(response);
166
- if (this.lastTokenUsage) {
167
- this.lastTokenUsage.input_tokens += usage.input_tokens;
168
- this.lastTokenUsage.output_tokens += usage.output_tokens;
169
- this.lastTokenUsage.total_tokens += usage.total_tokens;
170
- }
171
- else {
172
- this.lastTokenUsage = { ...usage };
173
- }
174
- const choice = response.choices[0];
175
- const message = choice.message;
176
- if (choice.finish_reason === "length") {
177
- const error = new AgentError_1.MaxTokensExceededError("Response exceeded maximum token limit", this.config.maxTokens || 1024);
178
- this.emit(AgentEvent_1.AgentEvent.MAX_TOKENS_EXCEEDED, error);
179
- this.emit(AgentEvent_1.AgentEvent.ERROR, error);
180
- if (this.vizEventId) {
181
- VizReporter_1.vizReporter.agentError(this.vizEventId, "MaxTokensExceededError", error.message, false);
182
- this.vizEventId = undefined;
183
- }
184
- throw error;
185
- }
186
- const hasToolCalls = message.tool_calls && message.tool_calls.length > 0;
187
- if (!hasToolCalls) {
188
- const textContent = message.content || "";
189
- const entry = transformers_1.chatCompletionsTransformer.fromProviderMessage(message);
190
- this.addToHistory(entry);
191
- this.emit(AgentEvent_1.AgentEvent.DONE, message, usage);
192
- if (this.vizEventId) {
193
- VizReporter_1.vizReporter.agentComplete(this.vizEventId, {
194
- input: this.lastTokenUsage?.input_tokens || 0,
195
- output: this.lastTokenUsage?.output_tokens || 0,
196
- total: this.lastTokenUsage?.total_tokens || 0,
197
- }, "end_turn", this.currentToolCallCount > 0, this.currentToolCallCount, textContent);
198
- this.vizEventId = undefined;
199
- }
200
- return textContent;
201
- }
202
- // Tool calls detected
203
- const toolCalls = message.tool_calls;
204
- this.emit(AgentEvent_1.AgentEvent.TOOL_USE, toolCalls);
205
- this.currentToolCallCount += toolCalls.length;
206
- const assistantEntry = transformers_1.chatCompletionsTransformer.fromProviderMessage(message);
207
- this.addToHistory(assistantEntry);
208
- const toolResults = await this.handleToolCalls(toolCalls);
209
- for (const result of toolResults) {
210
- const resultEntry = transformers_1.chatCompletionsTransformer.toolResultEntry(result.toolCallId, result.content);
211
- this.addToHistory(resultEntry);
212
- }
213
- // Continue conversation with tool results
214
- try {
215
- const newResponse = await this.callLlamaCpp();
216
- this.emit(AgentEvent_1.AgentEvent.AFTER_EXECUTE, newResponse);
217
- return this.handleResponse(newResponse);
218
- }
219
- catch (error) {
220
- const executionError = new AgentError_1.ExecutionError(`llama.cpp error during tool response: ${error instanceof Error ? error.message : "Unknown error"}`);
221
- this.emit(AgentEvent_1.AgentEvent.ERROR, executionError);
222
- throw executionError;
223
- }
224
- }
225
- async handleToolCalls(toolCalls) {
226
- return Promise.all(toolCalls.map(async (toolCall) => {
227
- const toolName = toolCall.type === "function" ? toolCall.function.name : "";
228
- const tool = this.tools.get(toolName);
229
- const toolCallId = toolCall.id;
230
- if (toolCall.type !== "function" || !tool) {
231
- const errorMessage = `Tool '${toolName}' not found`;
232
- const error = new AgentError_1.ToolExecutionError(errorMessage, toolName, toolCall.type === "function" ? toolCall.function.arguments : undefined);
233
- this.emit(AgentEvent_1.AgentEvent.TOOL_ERROR, error);
234
- return { toolCallId, content: errorMessage };
235
- }
236
- try {
237
- const args = JSON.parse(toolCall.function.arguments || "{}");
238
- const result = await tool.execute(this.getId(), this.getName(), args, toolCallId, this.config.model, "llamacpp");
239
- return { toolCallId, content: JSON.stringify(result) };
240
- }
241
- catch (error) {
242
- const errorMessage = `Error executing tool '${toolName}': ${error instanceof Error ? error.message : "Unknown error"}`;
243
- if (this.debug) {
244
- console.error(errorMessage);
245
- }
246
- const toolError = new AgentError_1.ToolExecutionError(errorMessage, toolName, toolCall.function.arguments);
247
- this.emit(AgentEvent_1.AgentEvent.TOOL_ERROR, toolError);
248
- return { toolCallId, content: errorMessage };
249
- }
250
- }));
36
+ model: config.model ?? "default",
37
+ }, history);
251
38
  }
252
- parseUsage(response) {
253
- const usage = response.usage;
254
- return {
255
- input_tokens: usage?.prompt_tokens ?? 0,
256
- output_tokens: usage?.completion_tokens ?? 0,
257
- total_tokens: usage?.total_tokens ?? 0,
258
- };
39
+ getVendorName() {
40
+ return "llama.cpp";
259
41
  }
260
42
  }
261
43
  exports.LlamaCppAgent = LlamaCppAgent;
@@ -2,6 +2,7 @@ import { BaseAgent, BaseAgentConfig, TokenUsage } from "../BaseAgent";
2
2
  import { History, MessageContent } from "../../history/History";
3
3
  import { Tool, Response, ResponseUsage } from "openai/resources/responses/responses";
4
4
  import { OpenAIModel } from "../model-types";
5
+ import { StreamChunk } from "../openai-compatible/OpenAICompatibleAgent";
5
6
  type AgentConfig = BaseAgentConfig & {
6
7
  apiKey: string;
7
8
  model?: OpenAIModel;
@@ -42,6 +43,20 @@ export declare class OpenAiAgent extends BaseAgent {
42
43
  execute(input: string | MessageContent[]): Promise<string>;
43
44
  protected handleResponse(response: Response): Promise<string>;
44
45
  private handleToolUse;
46
+ /**
47
+ * Stream a response as an async generator of `StreamChunk` objects.
48
+ * Yields `{ type: "text" }` for visible output and `{ type: "reasoning" }` for
49
+ * reasoning summary tokens (o-series models). Tool calls are handled transparently.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * for await (const chunk of agent.executeStream("Explain recursion")) {
54
+ * if (chunk.type === "text") process.stdout.write(chunk.content);
55
+ * }
56
+ * ```
57
+ */
58
+ executeStream(input: string | MessageContent[]): AsyncGenerator<StreamChunk>;
59
+ private streamTurn;
45
60
  protected parseUsage(input: ResponseUsage): TokenUsage;
46
61
  }
47
62
  export {};
@@ -341,6 +341,156 @@ class OpenAiAgent extends BaseAgent_1.BaseAgent {
341
341
  }));
342
342
  return toolResults;
343
343
  }
344
+ /**
345
+ * Stream a response as an async generator of `StreamChunk` objects.
346
+ * Yields `{ type: "text" }` for visible output and `{ type: "reasoning" }` for
347
+ * reasoning summary tokens (o-series models). Tool calls are handled transparently.
348
+ *
349
+ * @example
350
+ * ```typescript
351
+ * for await (const chunk of agent.executeStream("Explain recursion")) {
352
+ * if (chunk.type === "text") process.stdout.write(chunk.content);
353
+ * }
354
+ * ```
355
+ */
356
+ async *executeStream(input) {
357
+ this.emit(AgentEvent_1.AgentEvent.BEFORE_EXECUTE, input);
358
+ this.lastTokenUsage = undefined;
359
+ this.currentToolCallCount = 0;
360
+ const inputPreview = typeof input === "string" ? input : JSON.stringify(input);
361
+ if (VizConfig_1.vizConfig.isEnabled()) {
362
+ this.vizEventId = VizReporter_1.vizReporter.agentStart(this.id, this.name, this.config.model, "openai", inputPreview);
363
+ }
364
+ if (this.history.transient) {
365
+ this.history.clear();
366
+ this.addSystemMessage(this.getSystemMessage());
367
+ }
368
+ if (typeof input === "string") {
369
+ this.addTextToHistory("user", input);
370
+ }
371
+ else {
372
+ this.addMessageToHistory("user", input);
373
+ }
374
+ this.history.setSessionAnchor();
375
+ this.history.beginExecution();
376
+ try {
377
+ yield* this.streamTurn();
378
+ }
379
+ catch (error) {
380
+ if (error instanceof AgentError_1.AgentError) {
381
+ this.emit(AgentEvent_1.AgentEvent.ERROR, error);
382
+ if (this.vizEventId) {
383
+ VizReporter_1.vizReporter.agentError(this.vizEventId, error.constructor.name, error.message, false);
384
+ this.vizEventId = undefined;
385
+ }
386
+ throw error;
387
+ }
388
+ if (error && typeof error === "object" && "error" in error) {
389
+ const openAIError = error;
390
+ const apiError = new AgentError_1.ApiError(`OpenAI API error: ${openAIError.error.message || "Unknown error"}`, openAIError.status, openAIError.error);
391
+ this.emit(AgentEvent_1.AgentEvent.ERROR, apiError);
392
+ if (this.vizEventId) {
393
+ VizReporter_1.vizReporter.agentError(this.vizEventId, "ApiError", apiError.message, openAIError.error.code === "rate_limit_exceeded");
394
+ this.vizEventId = undefined;
395
+ }
396
+ throw apiError;
397
+ }
398
+ const executionError = new AgentError_1.ExecutionError(`OpenAI error: ${error instanceof Error ? error.message : "Unknown error"}`);
399
+ this.emit(AgentEvent_1.AgentEvent.ERROR, executionError);
400
+ if (this.vizEventId) {
401
+ VizReporter_1.vizReporter.agentError(this.vizEventId, "ExecutionError", executionError.message, false);
402
+ this.vizEventId = undefined;
403
+ }
404
+ throw executionError;
405
+ }
406
+ finally {
407
+ this.history.endExecution();
408
+ }
409
+ }
410
+ async *streamTurn() {
411
+ const inputMessages = transformers_1.openAiTransformer.toProvider(this.history.getEntries());
412
+ const stream = await this.client.responses.create({
413
+ model: this.config.model,
414
+ max_output_tokens: this.config.maxTokens,
415
+ input: inputMessages,
416
+ tools: this.getToolDefinitions(),
417
+ store: false,
418
+ stream: true,
419
+ temperature: this.config.temperature,
420
+ top_p: this.config.topP,
421
+ user: this.config.user,
422
+ ...(this.config.disableReasoning && { reasoning: { effort: null } }),
423
+ ...(this.config.reasoningEffort && !this.config.disableReasoning && {
424
+ // `summary: "auto"` is required for the Responses API to stream
425
+ // `response.reasoning_summary_text.delta` events.
426
+ reasoning: { effort: this.config.reasoningEffort, summary: "auto" },
427
+ }),
428
+ });
429
+ let completedEvent = null;
430
+ for await (const event of stream) {
431
+ if (event.type === "response.output_text.delta") {
432
+ this.emit(AgentEvent_1.AgentEvent.CHUNK, event.delta);
433
+ yield { type: "text", content: event.delta };
434
+ }
435
+ if (event.type === "response.reasoning_summary_text.delta") {
436
+ this.emit(AgentEvent_1.AgentEvent.REASONING_CHUNK, event.delta);
437
+ yield { type: "reasoning", content: event.delta };
438
+ }
439
+ if (event.type === "response.completed") {
440
+ completedEvent = event;
441
+ if (event.response.usage) {
442
+ const usage = this.parseUsage(event.response.usage);
443
+ if (this.lastTokenUsage) {
444
+ this.lastTokenUsage.input_tokens += usage.input_tokens;
445
+ this.lastTokenUsage.output_tokens += usage.output_tokens;
446
+ this.lastTokenUsage.total_tokens += usage.total_tokens;
447
+ }
448
+ else {
449
+ this.lastTokenUsage = { ...usage };
450
+ }
451
+ }
452
+ }
453
+ if (event.type === "response.incomplete") {
454
+ throw new AgentError_1.MaxTokensExceededError("Response incomplete: max tokens reached", this.config.maxTokens || 1024);
455
+ }
456
+ }
457
+ if (!completedEvent) {
458
+ throw new AgentError_1.ExecutionError("OpenAI stream ended without a completed event");
459
+ }
460
+ const response = completedEvent.response;
461
+ const toolCalls = response.output.filter((o) => o.type === "function_call");
462
+ if (toolCalls.length > 0) {
463
+ this.emit(AgentEvent_1.AgentEvent.TOOL_USE, toolCalls);
464
+ this.currentToolCallCount += toolCalls.length;
465
+ const functionCalls = toolCalls.map((tc) => ({
466
+ id: tc.id || tc.call_id,
467
+ call_id: tc.call_id,
468
+ name: tc.name,
469
+ arguments: tc.arguments,
470
+ }));
471
+ const assistantEntry = transformers_1.openAiTransformer.fromProviderMessage("assistant", response.output_text || "", functionCalls);
472
+ this.addToHistory(assistantEntry);
473
+ const toolResults = await this.handleToolUse(toolCalls);
474
+ for (const result of toolResults) {
475
+ this.addToHistory(transformers_1.openAiTransformer.toolResultEntry(result.call_id, result.output, false));
476
+ }
477
+ yield* this.streamTurn();
478
+ }
479
+ else {
480
+ const textContent = response.output_text || "";
481
+ const entry = transformers_1.openAiTransformer.fromProviderMessage("assistant", textContent);
482
+ this.addToHistory(entry);
483
+ this.emit(AgentEvent_1.AgentEvent.DONE, response, this.lastTokenUsage);
484
+ if (this.vizEventId) {
485
+ VizReporter_1.vizReporter.agentComplete(this.vizEventId, {
486
+ input: this.lastTokenUsage?.input_tokens || 0,
487
+ output: this.lastTokenUsage?.output_tokens || 0,
488
+ total: this.lastTokenUsage?.total_tokens || 0,
489
+ }, "end_turn", this.currentToolCallCount > 0, this.currentToolCallCount, textContent);
490
+ this.vizEventId = undefined;
491
+ }
492
+ }
493
+ }
344
494
  parseUsage(input) {
345
495
  return {
346
496
  input_tokens: input.input_tokens,
@@ -0,0 +1,75 @@
1
+ import OpenAI from "openai";
2
+ import { ChatCompletion, ChatCompletionTool } from "openai/resources/chat/completions";
3
+ import { Model } from "openai/resources/models";
4
+ import { BaseAgent, BaseAgentConfig, TokenUsage } from "../BaseAgent";
5
+ import { AgentVendor } from "../AgentConfig";
6
+ import { History, MessageContent } from "../../history/History";
7
+ /**
8
+ * A single chunk yielded by `executeStream()`.
9
+ * - `"text"` — visible output token
10
+ * - `"reasoning"` — internal reasoning token (DeepSeek-style `reasoning_content`)
11
+ */
12
+ export type StreamChunk = {
13
+ type: "text" | "reasoning";
14
+ content: string;
15
+ };
16
+ export type OpenAICompatibleConfig = BaseAgentConfig & {
17
+ /** Base URL of the OpenAI-compatible `/v1` endpoint (required) */
18
+ baseURL: string;
19
+ model?: string;
20
+ maxTokens?: number;
21
+ };
22
+ /**
23
+ * Abstract base class for agents that talk to any OpenAI-compatible
24
+ * `/v1/chat/completions` endpoint (llama.cpp, vLLM, LM Studio, etc.).
25
+ *
26
+ * Subclasses must implement:
27
+ * - `getVendorName()` — human-readable name used in error messages (e.g. `"llama.cpp"`)
28
+ *
29
+ * Subclasses may override:
30
+ * - `buildExtraRequestParams()` — extra fields merged into the completions request
31
+ */
32
+ export declare abstract class OpenAICompatibleAgent extends BaseAgent {
33
+ protected client: OpenAI;
34
+ protected config: Partial<OpenAICompatibleConfig>;
35
+ lastTokenUsage?: TokenUsage;
36
+ private vizEventId?;
37
+ private currentToolCallCount;
38
+ constructor(config: OpenAICompatibleConfig & {
39
+ vendor: AgentVendor;
40
+ }, history?: History);
41
+ /** Human-readable vendor name used in error messages (e.g. `"llama.cpp"`). */
42
+ protected abstract getVendorName(): string;
43
+ /** Extra fields to merge into the chat completions request. Override for vendor-specific params. */
44
+ protected buildExtraRequestParams(): Record<string, unknown>;
45
+ /**
46
+ * List the models available on the server via the `/v1/models` endpoint.
47
+ */
48
+ listModels(): Promise<Model[]>;
49
+ protected getToolDefinitions(): ChatCompletionTool[];
50
+ protected process(_input: string): Promise<string>;
51
+ execute(input: string | MessageContent[]): Promise<string>;
52
+ private callProvider;
53
+ protected handleResponse(response: ChatCompletion): Promise<string>;
54
+ private handleToolCalls;
55
+ /**
56
+ * Stream a response as an async generator of `StreamChunk` objects.
57
+ *
58
+ * Yields `{ type: "text" }` for visible output and `{ type: "reasoning" }` for
59
+ * internal reasoning tokens (models that expose `reasoning_content`, e.g. DeepSeek R1).
60
+ * Tool calls are executed transparently — the generator continues streaming after
61
+ * each tool-call round-trip.
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * for await (const chunk of agent.executeStream("Explain recursion")) {
66
+ * if (chunk.type === "text") process.stdout.write(chunk.content);
67
+ * }
68
+ * ```
69
+ */
70
+ executeStream(input: string | MessageContent[]): AsyncGenerator<StreamChunk>;
71
+ private streamTurn;
72
+ private accumulateStreamUsage;
73
+ protected parseUsage(response: ChatCompletion): TokenUsage;
74
+ }
75
+ //# sourceMappingURL=OpenAICompatibleAgent.d.ts.map