diff --git a/dist/agent.js b/dist/agent.js index 0000000..1111111 100644 --- a/dist/agent.js +++ b/dist/agent.js @@ -42,6 +42,8 @@ export class Agent { this.followUpMode = opts.followUpMode || "one-at-a-time"; this.streamFn = opts.streamFn || streamSimple; this.getApiKey = opts.getApiKey; + // PATCH: Support extraParams for provider-specific features (e.g., GLM-4.7 thinking mode) + this.extraParams = opts.extraParams; } get state() { return this._state; @@ -193,6 +195,8 @@ export class Agent { convertToLlm: this.convertToLlm, transformContext: this.transformContext, getApiKey: this.getApiKey, + // PATCH: Pass extraParams through to stream function + extraParams: this.extraParams, getSteeringMessages: async () => { if (this.steeringMode === "one-at-a-time") { if (this.steeringQueue.length > 0) { diff --git a/dist/agent.d.ts b/dist/agent.d.ts index 0000000..1111111 100644 --- a/dist/agent.d.ts +++ b/dist/agent.d.ts @@ -33,6 +33,10 @@ export interface AgentOptions { * Useful for expiring tokens (e.g., GitHub Copilot OAuth). */ getApiKey?: (provider: string) => Promise | string | undefined; + /** + * Extra params to pass to the provider API (e.g., Z.AI GLM thinking mode params). + */ + extraParams?: Record; } export declare class Agent { private _state; @@ -45,6 +49,8 @@ export declare class Agent { private followUpMode; streamFn: StreamFn; getApiKey?: (provider: string) => Promise | string | undefined; + /** Extra params to pass to the provider API. */ + extraParams?: Record; private runningPrompt?; private resolveRunningPrompt?; constructor(opts?: AgentOptions);