Spaces:
Running
Running
Updated space.
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: π
|
4 |
colorFrom: green
|
5 |
colorTo: purple
|
@@ -13,7 +13,7 @@ short_description: A OpenAI API proxy.
|
|
13 |
---
|
14 |
|
15 |
# A OpenAI API proxy.
|
16 |
-
Welcome to
|
17 |
|
18 |
### Key Parts:
|
19 |
- **app.py**: Handles API requests and responses.
|
@@ -21,7 +21,7 @@ Welcome to GPT-4O-mini! This space acts as a proxy to the OpenAI API, letting yo
|
|
21 |
- **FastAPI**: Fast web framework for building APIs.
|
22 |
|
23 |
### Features:
|
24 |
-
- **Model Selection**: Pick from GPT-4, GPT-4-turbo,
|
25 |
- **Image Generation**: Create images with DALL-E-3.
|
26 |
- **Math Calculations**: Do math with the fakeTool.
|
27 |
- **Moderation**: Automated content checks.
|
@@ -48,4 +48,4 @@ Welcome to GPT-4O-mini! This space acts as a proxy to the OpenAI API, letting yo
|
|
48 |
- **API Documentation**: [here](/api/v1/docs).
|
49 |
- **Latest Update**: Added math faketool.
|
50 |
|
51 |
-
Enjoy exploring
|
|
|
1 |
---
|
2 |
+
title: O1-preview
|
3 |
emoji: π
|
4 |
colorFrom: green
|
5 |
colorTo: purple
|
|
|
13 |
---
|
14 |
|
15 |
# A OpenAI API proxy.
|
16 |
+
Welcome to O1-preview! This space acts as a proxy to the OpenAI API, letting you interact with models to generate responses, images, and more. Here's a quick rundown:
|
17 |
|
18 |
### Key Parts:
|
19 |
- **app.py**: Handles API requests and responses.
|
|
|
21 |
- **FastAPI**: Fast web framework for building APIs.
|
22 |
|
23 |
### Features:
|
24 |
+
- **Model Selection**: Pick from GPT-4, GPT-4-turbo, GPT-4O, and O1-preview.
|
25 |
- **Image Generation**: Create images with DALL-E-3.
|
26 |
- **Math Calculations**: Do math with the fakeTool.
|
27 |
- **Moderation**: Automated content checks.
|
|
|
48 |
- **API Documentation**: [here](/api/v1/docs).
|
49 |
- **Latest Update**: Added math faketool.
|
50 |
|
51 |
+
Enjoy exploring O1-preview!
|
app.py
CHANGED
@@ -26,6 +26,9 @@ API_BASE = "env"# or "openai"
|
|
26 |
api_key = os.environ['API_API_KEY']
|
27 |
oai_api_key = os.environ['OPENAI_API_KEY']
|
28 |
base_url = os.environ.get('OPENAI_BASE_URL', "https://api.openai.com/v1")
|
|
|
|
|
|
|
29 |
def_models = '["gpt-4", "gpt-4-0125-preview", "gpt-4-0314", "gpt-4-0613", "gpt-4-1106-preview", "gpt-4-1106-vision-preview", "gpt-4-32k-0314", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-vision-preview", "chatgpt-4o-latest", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-mini", "gpt-4o-mini-2024-07-18"]'
|
30 |
fakeToolPrompt = """[System: You have ability to generate images, via tools provided to you by system.
|
31 |
To call a tool you need to write a json in a empty line; like writing it at the end of message.
|
|
|
26 |
api_key = os.environ['API_API_KEY']
|
27 |
oai_api_key = os.environ['OPENAI_API_KEY']
|
28 |
base_url = os.environ.get('OPENAI_BASE_URL', "https://api.openai.com/v1")
|
29 |
+
# Will not add O1-mini, and O1-preview into the default, as it requeires TIER-5 sub on OpenAI's API.
|
30 |
+
# But if you wanna add O1 just remove this comment line and comment the other
|
31 |
+
# def_models = '["gpt-4", "gpt-4-0125-preview", "gpt-4-0314", "gpt-4-0613", "gpt-4-1106-preview", "gpt-4-1106-vision-preview", "gpt-4-32k-0314", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-vision-preview", "chatgpt-4o-latest", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "o1-mini", "o1-mini-2024-09-12", "o1-preview", "o1-preview-2024-09-12"]'
|
32 |
def_models = '["gpt-4", "gpt-4-0125-preview", "gpt-4-0314", "gpt-4-0613", "gpt-4-1106-preview", "gpt-4-1106-vision-preview", "gpt-4-32k-0314", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-vision-preview", "chatgpt-4o-latest", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-mini", "gpt-4o-mini-2024-07-18"]'
|
33 |
fakeToolPrompt = """[System: You have ability to generate images, via tools provided to you by system.
|
34 |
To call a tool you need to write a json in a empty line; like writing it at the end of message.
|