Skip to content

Commit 89a7909

Browse files
caspherolahntrl
andauthored
google-genai: support of adding custom headers on ChatGoogleGenerativeAI #6648 (#8327)
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com> Co-authored-by: Hunter Lovell <hunter@hntrl.io>
1 parent 38ff1b5 commit 89a7909

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@langchain/google-genai": patch
3+
---
4+
5+
support of adding custom headers on ChatGoogleGenerativeAI #6648

libs/providers/langchain-google-genai/src/chat_models.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ export interface GoogleGenerativeAIChatInput
185185
*/
186186
baseUrl?: string;
187187

188+
/**
189+
* Google API custom headers to use
190+
*/
191+
customHeaders?: Record<string, string>;
192+
188193
/** Whether to stream the results or not */
189194
streaming?: boolean;
190195

@@ -727,6 +732,7 @@ export class ChatGoogleGenerativeAI
727732
{
728733
apiVersion: fields.apiVersion,
729734
baseUrl: fields.baseUrl,
735+
customHeaders: fields.customHeaders,
730736
}
731737
);
732738
this.streamUsage = fields.streamUsage ?? this.streamUsage;

0 commit comments

Comments
 (0)