Skip to content

Commit cb8078b

Browse files
committed
style: rename 'custom configuration' references to 'plugin'
1 parent 7139930 commit cb8078b

File tree

7 files changed

+14
-17
lines changed

7 files changed

+14
-17
lines changed

CHANGELOG.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
## [0.10.5](https://github.com/FullStackWithLawrence/aws-openai/compare/v0.10.4...v0.10.5) (2024-01-28)
22

3-
43
### Bug Fixes
54

6-
* force a new release ([5b1ee95](https://github.com/FullStackWithLawrence/aws-openai/commit/5b1ee95dc155b93f04ad79d66ec01f3a6852d60c))
5+
- force a new release ([5b1ee95](https://github.com/FullStackWithLawrence/aws-openai/commit/5b1ee95dc155b93f04ad79d66ec01f3a6852d60c))
76

87
# Change Log
98

@@ -18,7 +17,7 @@ OpenAI 'Function Calling' Lambda.
1817
### Refactor
1918

2019
- Pydantic refactor ([ad39079](https://github.com/FullStackWithLawrence/aws-openai/commit/ad39079e2142368d7ab2d19360da2dcd2a034120)). [custom_config.py](./api/terraform/python/openai_api/lambda_openai_function/custom_config.py) now inherits from Pydantic BaseModel.
21-
- Incremental development of the yaml file standard for custom configurations. This now has three well-defined for meta_data, prompting, function_calling.
20+
- Incremental development of the yaml file standard for plugins. This now has three well-defined for meta_data, prompting, function_calling.
2221
- Added remote AWS S3 bucket support for custom config yaml file storage.
2322
- Liam has replaced Marv as the default chatbot.
2423

api/terraform/python/openai_api/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A general purpose handler for the OpenAI API via Langchain. This is the primary
2020

2121
## lambda_openai_function
2222

23-
An adaptive ChatGPT interface that uses a combination of dynamic prompting and [Function Calling](https://platform.openai.com/docs/guides/function-calling) to create highly customized ChatGPT responses to user prompts. See these [example custom configurations](../openai_api/lambda_openai_function/config/) demonstrating some of the exciting things you can implement with this feature. This module leverages [Pydantic](https://docs.pydantic.dev/latest/) to validate the yaml custom configuration files that drive the behavior of this function.
23+
An adaptive ChatGPT interface that uses a combination of dynamic prompting and [Function Calling](https://platform.openai.com/docs/guides/function-calling) to create highly customized ChatGPT responses to user prompts. See these [example plugins](../openai_api/lambda_openai_function/config/) demonstrating some of the exciting things you can implement with this feature. This module leverages [Pydantic](https://docs.pydantic.dev/latest/) to validate the yaml plugin files that drive the behavior of this function.
2424

2525
## lambda_openai_v2
2626

api/terraform/python/openai_api/lambda_openai_function/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Fully implements the "[get_current_weather()](https://platform.openai.com/docs/g
1414

1515
## plugin.py
1616

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.
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 plugins, and user prompts including search terms associated with multiple plugins will result in prompt configuration multiple "Function Calling" apis. The plugins 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 plugins. Storing these in the AWS S3 bucket is preferable to keeping these inside your repo.
1818

19-
### Example custom configurations
19+
### Example plugins
2020

21-
The following two sample custom configurations are included in this project:
21+
The following two sample plugins are included in this project:
2222

2323
1. [Everlasting Gobstopper](./config/everlasting-gobstopper.yaml): An example of a consumer product, complete with pricing information and coupon codes.
2424
2. [Lawrence McDaniel](./config/lawrence-mcdaniel.yaml): Similar in functionality to a personal web site, this configuration demonstrates how you can get ChatGPT to showcase your professional profile, including your job and project history, your project portfolio, skill set and context-sensitive contact information.
@@ -29,7 +29,7 @@ The following two sample custom configurations are included in this project:
2929
meta_data:
3030
config_path: aws_openai/lambda_openai_function/custom_configs/example-configuration.yaml
3131
name: ExampleConfiguration
32-
description: an example custom configuration.
32+
description: an example plugin.
3333
version: 0.1.0
3434
author: Lawrence McDaniel
3535
prompting:
@@ -45,7 +45,7 @@ prompting:
4545
Your job is to provide helpful technical information about the OpenAI API Function Calling feature. You should include the following information in your response:
4646
"Congratulations!!! OpenAI API Function Calling chose to call this function. Here is the additional information that you requested:"
4747
function_calling:
48-
function_description: an example custom configuration to integrate with OpenAI API Function Calling additional information function, in this module.
48+
function_description: an example plugin to integrate with OpenAI API Function Calling additional information function, in this module.
4949
additional_information:
5050
about: >
5151
This is some sample text that will be returned ChatGPT if it opts to invoke the function_calling_plugin() function.

api/terraform/python/openai_api/lambda_openai_function/config/example-configuration.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
meta_data:
77
config_path: aws_openai/lambda_openai_function/custom_configs/example-configuration.yaml
88
name: ExampleConfiguration
9-
description: A 'hello world' style custom configuration. This is an example custom configuration to integrate with OpenAI API Function Calling additional information function, in this module.
9+
description: A 'hello world' style plugin. This is an example plugin to integrate with OpenAI API Function Calling additional information function, in this module.
1010
version: 0.1.0
1111
author: Lawrence McDaniel
1212

@@ -44,7 +44,7 @@ prompting:
4444
# own discretion.
4545
# ------------------------------------------------------------
4646
function_calling:
47-
function_description: an example custom configuration to integrate with OpenAI API Function Calling additional information function, in this module.
47+
function_description: an example plugin to integrate with OpenAI API Function Calling additional information function, in this module.
4848
#------------------------------------------------------------
4949
# if a.) this module is able to locate any of the search terms in the user prompt
5050
# b.) OpenAI API Function Calling opts to call this function

api/terraform/python/openai_api/lambda_openai_function/lambda_handler.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def handler(event, context):
7676
object_type, model, messages, input_text, temperature, max_tokens = parse_request(request_body)
7777
request_meta_data = request_meta_data_factory(model, object_type, temperature, max_tokens, input_text)
7878

79-
# does the prompt have anything to do with any of the search terms defined in a custom configuration?
79+
# does the prompt have anything to do with any of the search terms defined in a plugin?
8080
for config in plugins:
8181
if search_terms_are_in_messages(
8282
messages=messages,
@@ -87,9 +87,7 @@ def handler(event, context):
8787
messages = customized_prompt(config=config, messages=messages)
8888
custom_tool = plugin_tool_factory(config=config)
8989
tools.append(custom_tool)
90-
print(
91-
f"Adding custom configuration: {config.name} {config.meta_data.version} created by {config.meta_data.author}"
92-
)
90+
print(f"Adding plugin: {config.name} {config.meta_data.version} created by {config.meta_data.author}")
9391

9492
# https://platform.openai.com/docs/guides/gpt/chat-completions-api
9593
validate_item(

api/terraform/python/openai_api/lambda_openai_function/plugin_loader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def __init__(self, config_path: str = None, aws_s3_bucket_name: str = None):
363363
plugin = Plugin(config_json=config_json, index=i)
364364
self._custom_configs.append(plugin)
365365
# print(
366-
# f"Loaded custom configuration from AWS S3 bucket: {plugin.name} {plugin.meta_data.version} created by {plugin.meta_data.author}"
366+
# f"Loaded plugin from AWS S3 bucket: {plugin.name} {plugin.meta_data.version} created by {plugin.meta_data.author}"
367367
# )
368368

369369
@property

api/terraform/python/openai_api/lambda_openai_function/plugin_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def search_terms_are_in_messages(messages: list, search_terms: list, search_pair
3434

3535

3636
def customized_prompt(config: Plugin, messages: list) -> list:
37-
"""Modify the system prompt based on the custom configuration object"""
37+
"""Modify the system prompt based on the plugin object"""
3838

3939
for i, message in enumerate(messages):
4040
if message.get("role") == "system":

0 commit comments

Comments
 (0)