AgentInterface sets default streamFn and getApiKey

- Make Agent.streamFn and Agent.getApiKey public
- AgentInterface sets defaults if not already set
- Example no longer needs to configure these
This commit is contained in:
Mario Zechner 2025-12-28 11:42:37 +01:00
parent 92898f486b
commit 4d1936d3df
3 changed files with 21 additions and 14 deletions

View file

@ -82,8 +82,8 @@ export class Agent {
private transformContext?: (messages: AgentMessage[], signal?: AbortSignal) => Promise<AgentMessage[]>;
private messageQueue: AgentMessage[] = [];
private queueMode: "all" | "one-at-a-time";
private streamFn: StreamFn;
private getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;
public streamFn: StreamFn;
public getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;
private runningPrompt?: Promise<void>;
private resolveRunningPrompt?: () => void;