langchain-ai / langchainjs

πŸ¦œπŸ”— Build context-aware reasoning applications πŸ¦œπŸ”—
https://js.langchain.com/docs/
MIT License
12.51k stars 2.13k forks source link

ChatDeepInfra does not implement bindTools #7020

Open maharifu opened 1 day ago

maharifu commented 1 day ago

Checked other resources

Example Code

Following the quickstart tutorial here, but replacing ChatOpenAI with ChatDeepInfra like this:

const model = new ChatDeepInfra({
  model: 'meta-llama/Meta-Llama-3-70B-Instruct',
  temperature: 0,
  apiKey: 'XXXXX',
}).bindTools(tools);

Error Message and Stack Trace (if applicable)

TypeError: (intermediate value).bindTools is not a function

Description

System Info

npm info langchain

langchain@0.3.2 | MIT | deps: 12 | versions: 297
Typescript bindings for langchain
https://github.com/langchain-ai/langchainjs/tree/main/langchain/

keywords: llm, ai, gpt3, chain, prompt, prompt engineering, chatgpt, machine learning, ml, openai, embeddings, vectorstores

dist
.tarball: https://registry.npmjs.org/langchain/-/langchain-0.3.2.tgz
.shasum: aec3e679d3d6c36f469448380affa475c92fbd86
.integrity: sha512-kd2kz1cS/PIVrLEDFlrZsAasQfPLbY1UqCZbRKa3/QcpB33/n6xPDvXSMfBuKhvNj0bjW6MXDR9HZTduXjJBgg==
.unpackedSize: 2.9 MB

dependencies:
@langchain/openai: >=0.1.0 <0.4.0        openapi-types: ^12.1.3
@langchain/textsplitters: >=0.0.0 <0.2.0 p-retry: 4
js-tiktoken: ^1.0.12                     uuid: ^10.0.0
js-yaml: ^4.1.0                          yaml: ^2.2.1
jsonpointer: ^5.0.1                      zod-to-json-schema: ^3.22.3
langsmith: ^0.1.56-rc.1                  zod: ^3.22.4

maintainers:
- nfcampos <nuno@boringbits.io>
- jacoblee93 <jacoblee93@gmail.com>
- andrewnguonly <andrewnguonly@gmail.com>
- davidduong <david@duong.cz>
- hwchase17 <hw.chase.17@gmail.com>
- basproul <braceasproul@gmail.com>

dist-tags:
latest: 0.3.2                              tag-for-publishing-older-releases: 0.2.20
next: 0.3.2-rc.0

published a month ago by jacoblee93 <jacoblee93@gmail.com>
node --version
v20.10.0

Platform: Linux

dosubot[bot] commented 1 day ago

Hey @maharifu! πŸ‘‹ I'm here to help you with bugs, questions, and more while you wait for a human maintainer.

The TypeError: (intermediate value).bindTools is not a function issue occurs because the ChatDeepInfra class in LangChain.js does not implement the bindTools method. This is a known limitation, as there is no documentation or comments in the LangChain.js codebase that describe the tool integration capabilities of ChatDeepInfra or any alternative methods for binding tools with it [1][2].

If you are looking for similar issues, there is a related discussion about the bindTools method not being implemented for certain models, such as ChatOpenAI, which might provide some context or potential workarounds [3]. However, for ChatDeepInfra, there is currently no direct solution or alternative method available in the LangChain.js repository.

To continue talking to Dosu, mention @dosu.

taariq commented 1 day ago

Hey there @ovuruska. Would you be able to help here from the Deep Infra side?