Skip to content

Commit 80321f8

Browse files
committed
docs: add function calling documentation
1 parent 8b0d940 commit 80321f8

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,39 @@
1717

1818
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.
1919

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+
2022
![Marv](https://cdn.lawrencemcdaniel.com/marv.gif)
2123

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.
2329

2430
Code composition as of Jan-2024:
2531

2632
```console
2733
-------------------------------------------------------------------------------
2834
Language files blank comment code
2935
-------------------------------------------------------------------------------
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
3845
INI 2 15 0 70
3946
HTML 2 1 0 65
40-
Text 3 5 0 64
4147
Jupyter Notebook 1 0 186 48
42-
Bourne Shell 4 13 42 36
48+
Bourne Shell 5 17 55 47
4349
TOML 1 1 0 23
4450
Dockerfile 1 4 4 5
4551
-------------------------------------------------------------------------------
46-
SUM: 174 1826 1590 9387
52+
SUM: 191 1,993 1,849 10,369
4753
-------------------------------------------------------------------------------
4854
```
4955

@@ -96,6 +102,11 @@ A REST API implementing each of the [30 example applications](https://platform.o
96102
- [NodeJS](https://nodejs.org/en/download): used with NPM for local ReactJS developer environment, and for configuring/testing Semantic Release.
97103
- [Docker Compose](https://docs.docker.com/compose/install/): used by an automated Terraform process to create the AWS Lambda Layer for OpenAI and LangChain.
98104

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+
99110
## Documentation
100111

101112
Detailed documentation for each endpoint is available here: [Documentation](./doc/examples/)

0 commit comments

Comments
 (0)