* Replace the headers sent with every runtime request. * * This is an overwrite, not a merge — the supplied object becomes the * complete header set. Entries whose value is `null` or `undefined` are * dropped, which is how you clear a header (e.g. removing `Authorization` * on logout)
(headers: Record<string, string | null | undefined>)
| 717 | * core-level headers. |
| 718 | */ |
| 719 | setHeaders(headers: Record<string, string | null | undefined>): void { |
| 720 | this._headers = normalizeHeaders(headers); |
| 721 | this.agentRegistry.applyHeadersToAgents( |
| 722 | this.agentRegistry.agents as Record<string, AbstractAgent>, |
| 723 | ); |
| 724 | void this.notifySubscribers( |
| 725 | (subscriber) => |
| 726 | subscriber.onHeadersChanged?.({ |
| 727 | copilotkit: this, |
| 728 | headers: this.headers, |
| 729 | }), |
| 730 | "Subscriber onHeadersChanged error:", |
| 731 | ); |
| 732 | } |
| 733 | |
| 734 | setCredentials(credentials: RequestCredentials | undefined): void { |
| 735 | this._credentials = credentials; |
no test coverage detected