You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,15 @@ make run # run the web app locally in your dev environment
39
39
40
40
## Features
41
41
42
-
-**Prompting**: Uses [Terraform templates](./api/terraform/apigateway_endpoints.tf) to create 30 different ChatBots, each with its own customized UX and api endpoint.
42
+
-**Complete OpenAI API**: Deploys a production-ready API for integrating to OpenAI's complete suite of services, including ChatGTP, DALL·E, Whisper, and TTS.
43
43
44
-
-**Function Calling**: Uses [Yaml templates](./api/terraform/python/openai_api/lambda_openai_function/config/) stored locally or in an AWS S3 bucket to easily configure highly customized ChatGPT prompting behavior that uses both dynamic prompting as well as [OpenAI Python Function Calling](https://platform.openai.com/docs/guides/function-calling) to integrate your own custom Python functions into chat response processing. Refer to the [Python source code](./api/terraform/python/openai_api/lambda_openai_function/) for additional documentation and examples including the fully implemented "[get_current_weather()](./api/terraform/python/openai_api/lambda_openai_function/function_weather.py)" from The official [OpenAI API documentation](https://platform.openai.com/docs/guides/function-calling/common-use-cases), and, a much more interesting example, [get_additional_info()](./api/terraform/python/openai_api/lambda_openai_function/function_refers_to.py) which implements yaml template custom configurations.
44
+
-**LangChain Integration**: A simple API endpoint for building context-aware, reasoning applications with LangChain’s flexible abstractions and AI-first toolkit. Use this endpoint to develop a wide range of applications, from chatbots to question-answering systems.
45
+
46
+
-**Dynamic ChatGPT Prompting**: Simple [Terraform templates](./api/terraform/apigateway_endpoints.tf) to create highly presonalized ChatBots. Program and skin your own custom chat apps in minutes.
47
+
48
+
- **Function Calling**: OpenAI's most advanced integration feature to date. OpenAI API Function Calling is a feature that enables developers to integrate their own custom Python functions into the processing of chat responses. For example, when a chatbot powered by OpenAI's GPT-3 model is generating responses, it can call these custom Python functions to perform specific tasks or computations, and then include the results of these functions in its responses. This powerful feature can be used to create more dynamic and interactive chatbots that can perform tasks such as fetching real-time data, performing calculations, or interacting with other APIs or services. See the [Python source code](./api/terraform/python/openai_api/lambda_openai_function/) for additional documentation and examples, including, "[get_current_weather()](./api/terraform/python/openai_api/lambda_openai_function/function_weather.py)" from The official [OpenAI API documentation](https://platform.openai.com/docs/guides/function-calling/common-use-cases)
49
+
50
+
-**Function Calling Plugins**: We created our own yaml-based "plugin" model, [function_calling_plugin()](./api/terraform/python/openai_api/lambda_openai_function/plugin.py). See this [example plugin](./api/terraform/python/openai_api/lambda_openai_function/config/example-configuration.yaml) and this [documentation](./api/terraform/python/openai_api/lambda_openai_function/README.md) for details, or try it out on this [live site](https://openai.lawrencemcdaniel.com/). Yaml templates can be stored locally or served from a secure AWS S3 bucket. You'll find set of fun example plugins [here](./api/terraform/python/openai_api/lambda_openai_function/config/).
Copy file name to clipboardExpand all lines: api/terraform/python/openai_api/lambda_openai_function/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,9 @@ The following screenshots demonstrate the two Function Calling Python functions
12
12
13
13
Fully implements the "[get_current_weather()](https://platform.openai.com/docs/guides/function-calling)" from The official OpenAI API documentation. OpenAI's documentation provides scaffolding for this feature, but falls short of actually providing code that retrieves location-based current weather forecasts.
14
14
15
-
## function_refers_to.py
15
+
## plugin.py
16
16
17
-
This module demonstrates an alternative implementation of prompt behavior modification involving both Function Calling, plus, dynamic modifications to the system prompt. The module passes a customized configuration object to `get_additional_info()` based on a configurable set of search terms that it looks for in the user prompt. The function works with multiple customized configurations. That is, it maintains a list of custom configurations, and user prompts including search terms associated with multiple custom configurations will result in prompt configuration multiple "Function Calling" apis. The custom configurations are persisted both inside this repository in the [config](./config/) folder as well as via a remote AWS S3 bucket that Terraform creates and configures for you automatically. Custom configurations are data-driven via a standardized yaml format. Use [example-configuration.yaml](./config/example-configuration.yaml) as a template to create your own custom configurations. Storing these in the AWS S3 bucket is preferable to keeping these inside your repo.
17
+
This module demonstrates an alternative implementation of prompt behavior modification involving both Function Calling, plus, dynamic modifications to the system prompt. The module passes a customized configuration object to `function_calling_plugin()` based on a configurable set of search terms that it looks for in the user prompt. The function works with multiple customized configurations. That is, it maintains a list of custom configurations, and user prompts including search terms associated with multiple custom configurations will result in prompt configuration multiple "Function Calling" apis. The custom configurations are persisted both inside this repository in the [config](./config/) folder as well as via a remote AWS S3 bucket that Terraform creates and configures for you automatically. Custom configurations are data-driven via a standardized yaml format. Use [example-configuration.yaml](./config/example-configuration.yaml) as a template to create your own custom configurations. Storing these in the AWS S3 bucket is preferable to keeping these inside your repo.
18
18
19
19
### Example custom configurations
20
20
@@ -48,7 +48,7 @@ function_calling:
48
48
function_description: an example custom configuration to integrate with OpenAI API Function Calling additional information function, in this module.
49
49
additional_information:
50
50
about: >
51
-
This is some sample text that will be returned ChatGPT if it opts to invoke the get_additional_info() function.
51
+
This is some sample text that will be returned ChatGPT if it opts to invoke the function_calling_plugin() function.
52
52
In an API call, you can describe functions and have the model intelligently choose to output a JSON object containing arguments to call one or many functions. The Chat Completions API does not call the function; instead, the model generates JSON that you can use to call the function in your code.
53
53
The latest models (gpt-3.5-turbo-1106 and gpt-4-1106-preview) have been trained to both detect when a function should to be called (depending on the input) and to respond with JSON that adheres to the function signature more closely than previous models. With this capability also comes potential risks. We strongly recommend building in user confirmation flows before taking actions that impact the world on behalf of users (sending an email, posting something online, making a purchase, etc).
0 commit comments