|
17 | 17 |
|
18 | 18 | A [React](https://react.dev/) + [AWS Serverless](https://aws.amazon.com/serverless/) full stack implementation of the [30 example applications](https://platform.openai.com/examples) found in the official OpenAI API documentation. This repository is used as an instructional tool for the YouTube channel "[Full Stack With Lawrence](https://youtube.com/@FullStackWithLawrence)" as well as for University of British Columbia course, "[Artificial Intelligence Cloud Technology Implementation](https://extendedlearning.ubc.ca/courses/artificial-intelligence-cloud-technology-implementation/mg202)" taught by Lawrence McDaniel.
|
19 | 19 |
|
| 20 | +_New in version 0.10.x: A new chat app named "OpenAI Function Calling". See [lambda_openai_function](https://github.com/FullStackWithLawrence/aws-openai/tree/main/api/terraform/python/openai_api/lambda_openai_function) for examples including the fully implemented "[get_current_weather()](https://platform.openai.com/docs/guides/function-calling)" from The official OpenAI API documentation, and also a fun example of how get OpenAI to not only recognize you but also say flowery nice things about you!_ |
| 21 | + |
20 | 22 | 
|
21 | 23 |
|
22 |
| -**IMPORTANT DISCLAIMER: AWS' Lambda service has a hard 29-second timeout. OpenAI API calls often take longer than this, in which case the AWS API Gateway endpoint will return a 504 "Gateway timeout error" response to the React client. This happens frequently with apps created using chatgpt-4. Each of the 30 OpenAI API example applications are nonetheless implemented exactly as they are specified in the official documentation.** |
| 24 | +IMPORTANT DISCLAIMERS: |
| 25 | + |
| 26 | +1. AWS' Lambda service has a hard 29-second timeout. OpenAI API calls often take longer than this, in which case the AWS API Gateway endpoint will return a 504 "Gateway timeout error" response to the React client. This happens frequently with apps created using chatgpt-4. Each of the 30 OpenAI API example applications are nonetheless implemented exactly as they are specified in the official documentation. |
| 27 | + |
| 28 | +2. Distribution upload packages for AWS Lambda functions as well as AWS Lambda Layers are limited to 50mb (and 250mb unzipped). Often, this poses serious limitations for Layers, which are intended to store your PyPi / NPM package dependencies. Note that incidentally, these code samples are also pretty code scaffolding for alternative Docker-based deployment strategies using Elastic Container Service and/or Elastic Kubernetes Service. |
23 | 29 |
|
24 | 30 | Code composition as of Jan-2024:
|
25 | 31 |
|
26 | 32 | ```console
|
27 | 33 | -------------------------------------------------------------------------------
|
28 | 34 | Language files blank comment code
|
29 | 35 | -------------------------------------------------------------------------------
|
30 |
| -Markdown 49 738 6 2257 |
31 |
| -HCL 24 308 601 1990 |
32 |
| -Python 17 420 437 1580 |
33 |
| -YAML 19 111 101 1089 |
34 |
| -JavaScript 39 111 126 1086 |
35 |
| -JSX 6 42 44 793 |
36 |
| -CSS 5 31 14 172 |
37 |
| -make 1 26 29 109 |
| 36 | +HCL 29 346 714 2324 |
| 37 | +Markdown 51 751 6 2277 |
| 38 | +Python 22 514 557 1955 |
| 39 | +YAML 20 114 109 1204 |
| 40 | +JavaScript 39 114 127 1085 |
| 41 | +JSX 6 45 47 856 |
| 42 | +CSS 5 32 14 180 |
| 43 | +Text 6 13 0 116 |
| 44 | +make 1 26 30 114 |
38 | 45 | INI 2 15 0 70
|
39 | 46 | HTML 2 1 0 65
|
40 |
| -Text 3 5 0 64 |
41 | 47 | Jupyter Notebook 1 0 186 48
|
42 |
| -Bourne Shell 4 13 42 36 |
| 48 | +Bourne Shell 5 17 55 47 |
43 | 49 | TOML 1 1 0 23
|
44 | 50 | Dockerfile 1 4 4 5
|
45 | 51 | -------------------------------------------------------------------------------
|
46 |
| -SUM: 174 1826 1590 9387 |
| 52 | +SUM: 191 1,993 1,849 10,369 |
47 | 53 | -------------------------------------------------------------------------------
|
48 | 54 | ```
|
49 | 55 |
|
@@ -96,6 +102,11 @@ A REST API implementing each of the [30 example applications](https://platform.o
|
96 | 102 | - [NodeJS](https://nodejs.org/en/download): used with NPM for local ReactJS developer environment, and for configuring/testing Semantic Release.
|
97 | 103 | - [Docker Compose](https://docs.docker.com/compose/install/): used by an automated Terraform process to create the AWS Lambda Layer for OpenAI and LangChain.
|
98 | 104 |
|
| 105 | +Optional requirements: |
| 106 | + |
| 107 | +- [Google Maps API key](https://developers.google.com/maps/documentation/geocoding/overview). This is used the OpenAI API Function Calling coding example, "[get_current_weather()](https://platform.openai.com/docs/guides/function-calling)". |
| 108 | +- [Pinecone API key](https://docs.pinecone.io/docs/quickstart). This is used for OpenAI API Embedding examples. |
| 109 | + |
99 | 110 | ## Documentation
|
100 | 111 |
|
101 | 112 | Detailed documentation for each endpoint is available here: [Documentation](./doc/examples/)
|
|
0 commit comments