Amazon Lambda Function for Amazon Lex chatbot using sagemaker and langchain

0

I have created one lambda function name: chatbot-sagemaker. Below is code structure:

chatbot-sagemaker: lambda_function.py requirements.txt


in requirements.txt -

langchain==0.0.161 pydantic==1.10.7 boto3==1.26.91 aws-requests-auth==0.4.3


The error I'm getting :

"errorMessage": "Unable to import module 'lambda_function': No module named 'langchain'", "errorType": "Runtime.ImportModuleError",

How can I solve this or how do I need to install those libraries in AWS lambda function? Please help.

1개 답변
1
수락된 답변

Hi,

Specifying your dependencies in requirements.txt is not sufficient.

Lambda runtime supplies a limited set of 3rd-party Python packages. You have to add the missing ones by yourself.

Follow this guidance to do it for langchain: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Best,

Didier

profile pictureAWS
전문가
답변함 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠