题意:
在使用Playwright导航浏览器时,AWS Lambda失败(Python)
问题背景:
I have created an LLM agent with tools using Langchain and Python. I build my Lambda with with AWS SAM with Docker. After building, I test the Docker image using sam local invoke
, and the Lambda function executes as expected (on M1 Max chip), using Langchain's Playwright toolkit to navigate a headless, asynchronous chromium browser. After I deploy with SAM, I test the function in the AWS Lambda UI, but there is an issue with navigating the browser: Target page, context or browser has been closed
. I do not experience this error when testing the lambda locally with sam local invoke
.
我使用Langchain和Python创建了一个带有工具的LLM代理。