Skip to content

Commit

Permalink
fix: gpt 3.5 not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-hoenicke committed Apr 12, 2023
1 parent 52742e1 commit ed5bcf8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 50 deletions.
104 changes: 54 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,59 +67,11 @@ jc list # get the microservice id
jc delete <microservice id>
```

## Overview
The graphic below illustrates the process of creating a microservice and deploying it to the cloud elaboration two different implementation strategies.

```mermaid
graph TB
description[description: generate QR code from URL] --> make_strat{think a}
test[test: https://www.example.com] --> make_strat[generate strategies]
make_strat --> implement1[implement strategy 1]
implement1 --> build1{build image}
build1 -->|error message| implement1
build1 -->|failed 10 times| implement2[implement strategy 2]
build1 -->|success| registry[push docker image to registry]
implement2 --> build2{build image}
build2 -->|error message| implement2
build2 -->|failed 10 times| all_failed[all strategies failed]
build2 -->|success| registry[push docker image to registry]
registry --> deploy[deploy microservice]
deploy --> streamlit[create streamlit playground]
streamlit --> user_run[user tests microservice]
```

1. GPT Deploy identifies several strategies to implement your task.
2. It tests each strategy until it finds one that works.
3. For each strategy, it creates the following files:
- executor.py: This is the main implementation of the microservice.
- test_executor.py: These are test cases to ensure the microservice works as expected.
- requirements.txt: This file lists the packages needed by the microservice and its tests.
- Dockerfile: This file is used to run the microservice in a container and also runs the tests when building the image.
4. GPT Deploy attempts to build the image. If the build fails, it uses the error message to apply a fix and tries again to build the image.
5. Once it finds a successful strategy, it:
- Pushes the Docker image to the registry.
- Deploys the microservice.
- Creates a Streamlit playground where you can test the microservice.
6. If it fails 10 times in a row, it moves on to the next approach.

## Examples

<img src="res/teaser.png" alt="QR Code Generator" width="600" />

### Animal Detector
```bash

Expand Down Expand Up @@ -398,6 +350,58 @@ gptdeploy create --description "Visualize the Mandelbrot set with custom paramet

[//]: # (```)

## Technical Insights
The graphic below illustrates the process of creating a microservice and deploying it to the cloud elaboration two different implementation strategies.

```mermaid
graph TB
description[description: generate QR code from URL] --> make_strat{think a}
test[test: https://www.example.com] --> make_strat[generate strategies]
make_strat --> implement1[implement strategy 1]
implement1 --> build1{build image}
build1 -->|error message| implement1
build1 -->|failed 10 times| implement2[implement strategy 2]
build1 -->|success| registry[push docker image to registry]
implement2 --> build2{build image}
build2 -->|error message| implement2
build2 -->|failed 10 times| all_failed[all strategies failed]
build2 -->|success| registry[push docker image to registry]
registry --> deploy[deploy microservice]
deploy --> streamlit[create streamlit playground]
streamlit --> user_run[user tests microservice]
```

1. GPT Deploy identifies several strategies to implement your task.
2. It tests each strategy until it finds one that works.
3. For each strategy, it creates the following files:
- executor.py: This is the main implementation of the microservice.
- test_executor.py: These are test cases to ensure the microservice works as expected.
- requirements.txt: This file lists the packages needed by the microservice and its tests.
- Dockerfile: This file is used to run the microservice in a container and also runs the tests when building the image.
4. GPT Deploy attempts to build the image. If the build fails, it uses the error message to apply a fix and tries again to build the image.
5. Once it finds a successful strategy, it:
- Pushes the Docker image to the registry.
- Deploys the microservice.
- Creates a Streamlit playground where you can test the microservice.
6. If it fails 10 times in a row, it moves on to the next approach.


## 🔮 vision
Use natural language interface to create, deploy and update your microservice infrastructure.

Expand Down
Binary file added res/teaser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self):
self.pricing_prompt = PRICING_GPT4_PROMPT
self.pricing_generation = PRICING_GPT4_GENERATION
else:
raise Exception('The OPENAI_API_KEY does not have access to GPT-4. We are working on 3.5-turbo - support')
self.supported_model = 'gpt-3.5-turbo'
self.pricing_prompt = PRICING_GPT3_5_TURBO_PROMPT
self.pricing_generation = PRICING_GPT3_5_TURBO_GENERATION
Expand Down

0 comments on commit ed5bcf8

Please sign in to comment.