From 0fe53d4156cacdc44de185243eaa236fb25005e9 Mon Sep 17 00:00:00 2001 From: sinedied Date: Fri, 17 Jan 2025 15:27:17 +0100 Subject: [PATCH] chore: update ua string --- libs/langchain-openai/src/azure/chat_models.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/langchain-openai/src/azure/chat_models.ts b/libs/langchain-openai/src/azure/chat_models.ts index e8d78a204a6a..4ab439295b5b 100644 --- a/libs/langchain-openai/src/azure/chat_models.ts +++ b/libs/langchain-openai/src/azure/chat_models.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import { type ClientOptions, AzureOpenAI as AzureOpenAIClient } from "openai"; import { LangSmithParams, @@ -504,9 +505,7 @@ export class AzureChatOpenAI extends ChatOpenAI { params.defaultHeaders = { ...params.defaultHeaders, - "User-Agent": params.defaultHeaders?.["User-Agent"] - ? `${params.defaultHeaders["User-Agent"]}: langchainjs-azure-openai-v2` - : `langchainjs-azure-openai-v2`, + "User-Agent": `langchainjs-azure-openai/2.0.0 (node.js/${process.version}; ${process.platform}; ${process.arch}) ${params.defaultHeaders?.["User-Agent"] || ""}` }; this.client = new AzureOpenAIClient({