Skip to content

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

AWS Lambda Functions

Python integrations for OpenAI API. Note that due to size constraints with AWS Lambda functions, this code is compulsorily split into various separate modules, as follows:

  1. openai_api: contains the actual Python source code to implement each API endpoint. Follow this link for additional documentation on this source code.

  2. layer_langchain: deploys an AWS Lambda Layer containing additional Python PyPi requirements used by lambda_langchain.

  3. layer_nlp: deploys an AWS Lambda Layer containing additional Python PyPi requirements used by lambda_openai_function to implement the function_weather.py feature

  4. layer_openai: deploys an AWS Lambda Layer containing additional Python PyPi requirements used by lambda_openai_function to implement the function_weather.py feature

  5. layer_pandas: deploys an AWS Lambda Layer containing common Python PyPi requirements used by all lambda functions.

AWS Lambda distribution packages are limited to 50mb in zipped compressed format, and 250mb when uncompressed. It turns out to be surprisingly challenging to squeeze all of the various Python requirements into a manageable combination of Layers that satisfy this limitation. Hence, there are four layers for this project. Note that this limitation is unique to AWS Lambda. You certainly would not face this challenge if instead you were to deploy this code to say, AWS Elastic Container Service or AWS Elastic Kubernetes Service.