Skip to content

Commit

Permalink
chore: update to gpt-4-turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
lpm0073 committed Jan 16, 2025
1 parent 729d55a commit 313b1a1
Show file tree
Hide file tree
Showing 64 changed files with 115 additions and 116 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ["--ignore-words=codespell.txt"]
Expand All @@ -21,11 +21,11 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
Expand All @@ -41,12 +41,12 @@ repos:
language: script
types: [python]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
rev: 1.7.10
hooks:
- id: bandit
args: ["-ll"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
# See https://pre-commit.com/hooks.html for more hooks
#- id: check-added-large-files
Expand All @@ -69,14 +69,14 @@ repos:
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
rev: v0.1.24 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
hooks:
- id: terraform-fmt
- id: helmlint
- id: terraform-validate
- id: tflint
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0
rev: v9.18.0
hooks:
- id: commitlint
stages: [commit-msg]
Expand Down
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
## [0.10.7](https://github.com/FullStackWithLawrence/aws-openai/compare/v0.10.6...v0.10.7) (2024-11-01)


### Bug Fixes

* force a new release ([95401cb](https://github.com/FullStackWithLawrence/aws-openai/commit/95401cb87fbf941eb3237981f48fc535fcf1a7a4))
- force a new release ([95401cb](https://github.com/FullStackWithLawrence/aws-openai/commit/95401cb87fbf941eb3237981f48fc535fcf1a7a4))

## [0.10.6](https://github.com/FullStackWithLawrence/aws-openai/compare/v0.10.5...v0.10.6) (2024-01-29)


### Bug Fixes

* force a new release ([d411e41](https://github.com/FullStackWithLawrence/aws-openai/commit/d411e415f2657e1b2b9475c6434de55b677d8262))
- force a new release ([d411e41](https://github.com/FullStackWithLawrence/aws-openai/commit/d411e415f2657e1b2b9475c6434de55b677d8262))

## [0.10.5](https://github.com/FullStackWithLawrence/aws-openai/compare/v0.10.4...v0.10.5) (2024-01-28)

Expand Down Expand Up @@ -257,7 +255,7 @@ OpenAI 'Function Calling' Lambda.

## [0.3.0] (2023-11-01)

The YouTube video for this release: [AWS Lamba Layers: When and How to use them](https://youtu.be/5Jf34t_UlZA)
The YouTube video for this release: [AWS Lambda Layers: When and How to use them](https://youtu.be/5Jf34t_UlZA)

- add lambda_langchain
- add lambda_openai_v2
Expand Down
8 changes: 4 additions & 4 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ return value
"id": "chatcmpl-7yLxpF7ZsJzF3FTUICyUKDe1Ob9nd",
"object": "chat.completion",
"created": 1694618465,
"model": "gpt-3.5-turbo-0613",
"model": "gpt-4-turbo-0613",
"choices": [
{
"index": 0,
Expand Down Expand Up @@ -110,7 +110,7 @@ Example valid request body:

```json
{
"model": "gpt-3.5-turbo",
"model": "gpt-4-turbo",
"end_point": "ChatCompletion",
"temperature": 0.9,
"max_tokens": 1024,
Expand Down Expand Up @@ -250,7 +250,7 @@ CORS is always a tedious topics with regard to REST API's. Please note the follo
- the hoped-for 200 response status that is returned by Lambda
- the less hoped-for 400 and 500 response statuses returned by Lambda
- and the even less hoped-for 400 and 500 response statuses that can be returned by API Gateway itself in certain cases such as a.) Lambda timeout, b.) invalid api key credentials, amongst other possibilities.
- For audit and trouble shooting purposes, Cloudwatch logs exist for API Gateway as well as the two Lambas, [openai_text](../api/terraform/python/openai_text/openai_text.py) and [openai_cors_preflight_handler](../api/terraform/nodejs/openai_cors_preflight_handler/index.mjs)
- For audit and trouble shooting purposes, Cloudwatch logs exist for API Gateway as well as the two Lamdbas, [openai_text](../api/terraform/python/openai_text/openai_text.py) and [openai_cors_preflight_handler](../api/terraform/nodejs/openai_cors_preflight_handler/index.mjs)

In each case this project attempts to compile an http response that is as verbose as technically possible given the nature and origin of the response data.

Expand Down Expand Up @@ -279,7 +279,7 @@ a static example response from the OpenAI chatgpt-3.5 API
],
"created": 1697495501,
"id": "chatcmpl-8AQPdETlM808Fp0NjEeCOOc3a13Vt",
"model": "gpt-3.5-turbo-0613",
"model": "gpt-4-turbo-0613",
"object": "chat.completion",
"usage": {
"completion_tokens": 20,
Expand Down
12 changes: 6 additions & 6 deletions api/postman/OpenAI.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"model\": \"gpt-3.5-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are Marv, a chatbot that reluctantly answers questions with sarcastic responses.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Marv, I'd like to introduce you to all the nice YouTube viewers.\"\n }\n ]\n}",
"raw": "{\n \"model\": \"gpt-4-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are Marv, a chatbot that reluctantly answers questions with sarcastic responses.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Marv, I'd like to introduce you to all the nice YouTube viewers.\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -101,7 +101,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"model\": \"gpt-3.5-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful chatbot\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Should i use AWS Lambda to implement my OpenAI API microservice?\"\n }\n ],\n \"chat_history\": [\n {\n \"message\": \"Hello, How can I help you?\",\n \"direction\": \"incoming\",\n \"sentTime\": \"11/16/2023, 5:53:32 PM\",\n \"sender\": \"system\"\n }\n ]\n}",
"raw": "{\n \"model\": \"gpt-4-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful chatbot\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Should i use AWS Lambda to implement my OpenAI API microservice?\"\n }\n ],\n \"chat_history\": [\n {\n \"message\": \"Hello, How can I help you?\",\n \"direction\": \"incoming\",\n \"sentTime\": \"11/16/2023, 5:53:32 PM\",\n \"sender\": \"system\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -129,7 +129,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"model\": \"gpt-3.5-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful chatbot\"\n },\n {\n \"role\": \"user\",\n \"content\": \"does lawrence mcdaniel teach at UBC?\"\n }\n ],\n \"chat_history\": [\n {\n \"message\": \"Hello, How can I help you?\",\n \"direction\": \"incoming\",\n \"sentTime\": \"11/16/2023, 5:53:32 PM\",\n \"sender\": \"system\"\n }\n ]\n}",
"raw": "{\n \"model\": \"gpt-4-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful chatbot\"\n },\n {\n \"role\": \"user\",\n \"content\": \"does lawrence mcdaniel teach at UBC?\"\n }\n ],\n \"chat_history\": [\n {\n \"message\": \"Hello, How can I help you?\",\n \"direction\": \"incoming\",\n \"sentTime\": \"11/16/2023, 5:53:32 PM\",\n \"sender\": \"system\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -157,7 +157,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"model\": \"gpt-3.5-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are Marv, a chatbot that reluctantly answers questions with sarcastic responses.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"'sup Chuck?\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Oh, you know, just chillin and hoping that you'll ask me a question.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What's the meaning of life?\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I know!! I know!!! It's 42!!!\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Please be more specific.\"\n }\n ],\n \"chat_history\": [\n {\n \"message\": \"Hello, I'm Marv, a sarcastic chatbot.\",\n \"direction\": \"incoming\",\n \"sentTime\": \"11/16/2023, 5:53:32 PM\",\n \"sender\": \"system\"\n }\n ]\n}\n",
"raw": "{\n \"model\": \"gpt-4-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256,\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are Marv, a chatbot that reluctantly answers questions with sarcastic responses.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"'sup Chuck?\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Oh, you know, just chillin and hoping that you'll ask me a question.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What's the meaning of life?\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I know!! I know!!! It's 42!!!\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Please be more specific.\"\n }\n ],\n \"chat_history\": [\n {\n \"message\": \"Hello, I'm Marv, a sarcastic chatbot.\",\n \"direction\": \"incoming\",\n \"sentTime\": \"11/16/2023, 5:53:32 PM\",\n \"sender\": \"system\"\n }\n ]\n}\n",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -878,7 +878,7 @@
}
],
"cookie": [],
"body": "{\n \"isBase64Encoded\": false,\n \"statusCode\": 200,\n \"body\": {\n \"chat_memory\": {\n \"messages\": [\n {\n \"content\": \"Marv, I'd like to introduce you to all the nice YouTube viewers.\",\n \"additional_kwargs\": {},\n \"type\": \"human\",\n \"example\": false\n },\n {\n \"content\": \"Oh, how delightful. I can't think of anything I'd rather do than interact with a bunch of YouTube viewers. Just kidding, I'd rather be doing literally anything else. But go ahead, introduce me to your lovely audience. I'm sure they'll be absolutely thrilled to meet me.\",\n \"additional_kwargs\": {},\n \"type\": \"ai\",\n \"example\": false\n }\n ]\n },\n \"output_key\": null,\n \"input_key\": null,\n \"return_messages\": true,\n \"human_prefix\": \"Human\",\n \"ai_prefix\": \"AI\",\n \"memory_key\": \"chat_history\",\n \"request_meta_data\": {\n \"lambda\": \"lambda_langchain\",\n \"model\": \"gpt-3.5-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256\n }\n }\n}"
"body": "{\n \"isBase64Encoded\": false,\n \"statusCode\": 200,\n \"body\": {\n \"chat_memory\": {\n \"messages\": [\n {\n \"content\": \"Marv, I'd like to introduce you to all the nice YouTube viewers.\",\n \"additional_kwargs\": {},\n \"type\": \"human\",\n \"example\": false\n },\n {\n \"content\": \"Oh, how delightful. I can't think of anything I'd rather do than interact with a bunch of YouTube viewers. Just kidding, I'd rather be doing literally anything else. But go ahead, introduce me to your lovely audience. I'm sure they'll be absolutely thrilled to meet me.\",\n \"additional_kwargs\": {},\n \"type\": \"ai\",\n \"example\": false\n }\n ]\n },\n \"output_key\": null,\n \"input_key\": null,\n \"return_messages\": true,\n \"human_prefix\": \"Human\",\n \"ai_prefix\": \"AI\",\n \"memory_key\": \"chat_history\",\n \"request_meta_data\": {\n \"lambda\": \"lambda_langchain\",\n \"model\": \"gpt-4-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256\n }\n }\n}"
}
]
},
Expand Down Expand Up @@ -1508,7 +1508,7 @@
}
],
"cookie": [],
"body": "{\n \"isBase64Encoded\": false,\n \"statusCode\": 200,\n \"body\": {\n \"chat_memory\": {\n \"messages\": [\n {\n \"content\": \"Marv, I'd like to introduce you to all the nice YouTube viewers.\",\n \"additional_kwargs\": {},\n \"type\": \"human\",\n \"example\": false\n },\n {\n \"content\": \"Oh, how delightful. I can't think of anything I'd rather do than interact with a bunch of YouTube viewers. Just kidding, I'd rather be doing literally anything else. But go ahead, introduce me to your lovely audience. I'm sure they'll be absolutely thrilled to meet me.\",\n \"additional_kwargs\": {},\n \"type\": \"ai\",\n \"example\": false\n }\n ]\n },\n \"output_key\": null,\n \"input_key\": null,\n \"return_messages\": true,\n \"human_prefix\": \"Human\",\n \"ai_prefix\": \"AI\",\n \"memory_key\": \"chat_history\",\n \"request_meta_data\": {\n \"lambda\": \"lambda_langchain\",\n \"model\": \"gpt-3.5-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256\n }\n }\n}"
"body": "{\n \"isBase64Encoded\": false,\n \"statusCode\": 200,\n \"body\": {\n \"chat_memory\": {\n \"messages\": [\n {\n \"content\": \"Marv, I'd like to introduce you to all the nice YouTube viewers.\",\n \"additional_kwargs\": {},\n \"type\": \"human\",\n \"example\": false\n },\n {\n \"content\": \"Oh, how delightful. I can't think of anything I'd rather do than interact with a bunch of YouTube viewers. Just kidding, I'd rather be doing literally anything else. But go ahead, introduce me to your lovely audience. I'm sure they'll be absolutely thrilled to meet me.\",\n \"additional_kwargs\": {},\n \"type\": \"ai\",\n \"example\": false\n }\n ]\n },\n \"output_key\": null,\n \"input_key\": null,\n \"return_messages\": true,\n \"human_prefix\": \"Human\",\n \"ai_prefix\": \"AI\",\n \"memory_key\": \"chat_history\",\n \"request_meta_data\": {\n \"lambda\": \"lambda_langchain\",\n \"model\": \"gpt-4-turbo\",\n \"end_point\": \"ChatCompletion\",\n \"temperature\": 0.5,\n \"max_tokens\": 256\n }\n }\n}"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion api/terraform/apigateway_endpoint_function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# A valid request body:
# {
# "model": "gpt-3.5-turbo",
# "model": "gpt-4-turbo",
# "temperature": 0.9,
# "max_tokens": 1024,
# "messages": [
Expand Down
2 changes: 1 addition & 1 deletion api/terraform/apigateway_endpoint_langchain.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# A valid request body:
# {
# "model": "gpt-3.5-turbo",
# "model": "gpt-4-turbo",
# "temperature": 0.9,
# "max_tokens": 1024,
# "messages": [
Expand Down
2 changes: 1 addition & 1 deletion api/terraform/apigateway_endpoint_passthrough.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# A valid request body:
# {
# "model": "gpt-3.5-turbo",
# "model": "gpt-4-turbo",
# "end_point": "ChatCompletion",
# "temperature": 0.9,
# "max_tokens": 1024,
Expand Down
2 changes: 1 addition & 1 deletion api/terraform/apigateway_endpoint_passthrough_v2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# A valid request body:
# {
# "model": "gpt-3.5-turbo",
# "model": "gpt-4-turbo",
# "end_point": "ChatCompletion",
# "temperature": 0.9,
# "max_tokens": 1024,
Expand Down
Loading

0 comments on commit 313b1a1

Please sign in to comment.