Skip to content

Errors TS2307 and TS2322 (langchain, sap/cds and LLMType) #19

@barry91-acn

Description

@barry91-acn

Unfortunately I'm facing the following issues.
I already updated langchain and sap-cloud-sdk libraries.

  • npm i -g sap-cloud-sdk
  • npm install @sap-cloud-sdk/openapi
  • pip install -U generative-ai-hub-sdk[langchain]

Do you face the same?

Just for your info: I already builded successfully without any issue a version of this repository of June/July. This is why I think something is changed around library. But honestly now I do not understand what's needed to update/change in order to complete the build.

.........

citizen-genai-rag@1.0.0 build:ts
tsc

......srv/rag-service.ts(2,25): error TS2307: Cannot find module '@sap/cds/apis/services' or its corresponding type declarations.
srv/rag-service.ts(8,8): error TS2307: Cannot find module 'langchain/prompts' or its corresponding type declarations.
srv/rag-service.ts(111,13): error TS2322: Type 'BTPAzureOpenAIChatLLM' is not assignable to type 'LLMType'.
Type 'BTPAzureOpenAIChatLLM' is missing the following properties from type 'BaseLanguageModelInterface<any, BaseLanguageModelCallOptions>': callKeys, generatePrompt, predict, predictMessages, and 11 more.
srv/rag-service.ts(176,13): error TS2322: Type 'BTPAzureOpenAIChatLLM' is not assignable to type 'LLMType'.
Type 'BTPAzureOpenAIChatLLM' is missing the following properties from type 'BaseLanguageModelInterface<any, BaseLanguageModelCallOptions>': callKeys, generatePrompt, predict, predictMessages, and 11 more.
srv/utils/langchain/BTPAzureOpenAIChatLLM.ts(1,51): error TS2307: Cannot find module 'langchain/chat_models/openai' or its corresponding type declarations.
srv/utils/langchain/BTPAzureOpenAIChatLLM.ts(2,42): error TS2307: Cannot find module 'langchain/dist/types/openai-types' or its corresponding type declarations.
srv/utils/langchain/BTPEmbedding.ts(1,46): error TS2307: Cannot find module 'langchain/embeddings/base' or its corresponding type declarations.
.[2024-10-17 12:58:58] ERROR the "before-all"" build failed: could not execute the "npm run build:cf --prefix api" command: exit status 2
make: *** [Makefile_20241017125755.mta:28: pre_build] Error 1
[2024-10-17 12:58:58] ERROR could not build the MTA project: could not execute the "make -f Makefile_20241017125755.mta p=cf mtar=citizen-genai-rag_0.0.1.mtar strict=true mode= t="./mta_archives"" command: exit status 2

This is the section in which there are issues within the repository code:
image

Thanks in advance for the collaboration.
Best regards,
Andrea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions