mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: Add User-Agent to API requests
This change introduces a User-Agent header to all API requests made by the Gemini CLI. The User-Agent string includes the CLI version, Node.js version, operating system, and architecture. This will help in tracking usage and identifying potential issues. Fixes https://b.corp.google.com/issues/416353675 Signed-off-by: Gemini
This commit is contained in:
committed by
N. Taylor Mullen
parent
2970f0a06c
commit
8537aabba4
@@ -34,7 +34,15 @@ export class GeminiClient {
|
||||
private readonly MAX_TURNS = 100;
|
||||
|
||||
constructor(private config: Config) {
|
||||
this.client = new GoogleGenAI({ apiKey: config.getApiKey() });
|
||||
const userAgent = config.getUserAgent();
|
||||
this.client = new GoogleGenAI({
|
||||
apiKey: config.getApiKey(),
|
||||
httpOptions: {
|
||||
headers: {
|
||||
'User-Agent': userAgent,
|
||||
},
|
||||
},
|
||||
});
|
||||
this.model = config.getModel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user