-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Checked other resources
- This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
- I added a very descriptive title to this issue.
- I searched the LangChain.js documentation with the integrated search.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangChain.js rather than my code.
- The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
Using the following code
export function getLangChainModel(model: string) {
return new ChatWatsonx({
version: "2024-03-14",
serviceUrl: WATSONX_BASE_URL,
projectId: WATSONX_PROJECT_ID,
watsonxAIAuthType: "iam",
watsonxAIApikey: WATSONX_API_KEY,
model,
});
}
export function getLangChainEmbeddingsModel(model: string) {
return new WatsonxEmbeddings({
version: "2024-03-14",
serviceUrl: WATSONX_BASE_URL,
projectId: WATSONX_PROJECT_ID,
watsonxAIAuthType: "iam",
watsonxAIApikey: WATSONX_API_KEY,
model,
truncateInputTokens: 512,
});
}
const browser = new WebBrowser({
model: getLangChainModel(DEFAULT_MODEL_ID),
embeddings: getLangChainEmbeddingsModel(EMBEDDING_MODEL),
});
await this.browser.invoke(input)Error Message and Stack Trace (if applicable)
Error: Unexpected properties: handlers, inheritableHandlers, inheritableTags, inheritableMetadata, name, _parentRunId. Expected only: headers, signal, tool_choice, promptIndex, ls_structured_output_format, watsonxCallbacks, writer, interrupt, spaceId, projectId, tools, toolChoiceOption, frequencyPenalty, logitBias, logprobs, topLogprobs, maxTokens, maxCompletionTokens, n, presencePenalty, responseFormat, seed, stop, temperature, topP, timeLimit, model, reasoningEffort, includeReasoning.
Description
The problem is when the tool invokes the watsonx chat models it sends extra properties in the options handlers, inheritableHandlers, inheritableTags, inheritableMetadata, name, _parentRunId which makes the validation fail.
System Info
@langchain/community: 1.1.15
node: v20.19.2
platform: mac