Skip to content

Commit

Permalink
Adjusted IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaki-1052 committed Feb 5, 2024
1 parent 196727b commit ccf10b4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ OPENAI_API_KEY=your_api_key_here
USER_USERNAME=Username
USER_PASSWORD=Password
GOOGLE_API_KEY=your_google_ai_key_here
MISTRAL_KEY=your_mistral_ai_key_here
MISTRAL_API_KEY=your_mistral_ai_key_here
# Remember to either rename this file to `.env`
# or create a new `.env` file with these variables.
# An OpenAI Key is required for GPT; if unchanged,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ https://github.com/Zaki-1052/GPTPortal/assets/134018102/de7cb401-54f3-4cdd-a041-
USER_USERNAME=Username
USER_PASSWORD=Password
GOOGLE_API_KEY=your_google_ai_key_here
MISTRAL_KEY=your_mistral_ai_key_here
MISTRAL_API_KEY=your_mistral_ai_key_here
```
5. **Start the Server**:
Expand Down Expand Up @@ -346,7 +346,7 @@ Lastly, if you have uploaded an image and are working with the Vision model, you
- The [Mistral **Documentation**](https://docs.mistral.ai/redocusaurus/plugin-redoc-0.yaml) for **Chat Completions** is linked [**here**](https://docs.mistral.ai/api/#operation/createChatCompletion) as well.
- Please follow the same steps for inserting your **API Key** into the `.env` file.
- See the above instructions, applied to "`your_mistral_ai_key_here`".
- *Create a New Key*, and insert it into the correct **`MISTRAL_KEY`**.
- *Create a New Key*, and insert it into the correct **`MISTRAL_API_KEY`**.
- The largest *Mistral Model* is said to **beat** *Gemini Pro* at *most tasks*!

## Relevant [Links](https://arc.net/folder/B777A318-2A95-4C36-86AA-156166895CC2)
Expand Down
2 changes: 1 addition & 1 deletion public/portal.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<button id="model-gpt-4-vision" data-value="gpt-4-vision-preview">GPT-4-Vision</button>
<button id="model-gpt-4-32k" data-value="gpt-4-32k">GPT-4-32k</button>
<button id="model-gpt-4-turbo" data-value="gpt-4-turbo-preview">GPT-4-Turbo</button>
<button id="model-gpt-3.5" data-value="gpt-3.5-turbo">GPT-3.5-Turbo</button>
<button id="model-gpt-3.5" data-value="gpt-3.5-turbo-0125">GPT-3.5-Turbo</button>
<button id="model-gemini-pro" data-value="gemini-pro">Gemini Pro</button>
<button id="model-gemini-pro-vision" data-value="gemini-pro-vision">Gemini Pro Vision</button>
<button id="model-mistral-tiny" data-value="mistral-tiny">Mistral Tiny</button>
Expand Down
10 changes: 5 additions & 5 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"GPT-4-Vision": "gpt-4-vision-preview",
"GPT-4-32k": "gpt-4-32k",
"GPT-4-Turbo": "gpt-4-turbo-preview",
"GPT-3.5-Turbo": "gpt-3.5-turbo",
"GPT-3.5-Turbo": "gpt-3.5-turbo-0125",
"Gemini-Pro": "gemini-pro",
"Gemini-Pro-Vision": "gemini-pro-vision",
"Mistral-Tiny": "mistral-tiny",
Expand All @@ -28,7 +28,7 @@
"gpt-4-vision-preview": "GPT-4-Vision",
"gpt-4-32k": "GPT-4-32k",
"gpt-4-turbo-preview": "GPT-4-Turbo",
"gpt-3.5-turbo": "GPT-3.5-Turbo",
"gpt-3.5-turbo-0125": "GPT-3.5-Turbo",
"gemini-pro": "Gemini-Pro",
"gemini-pro-vision": "Gemini-Pro-Vision",
"mistral-tiny": "Mistral-Tiny",
Expand Down Expand Up @@ -184,7 +184,7 @@ const selectedModelDisplayName = document.getElementById('selected-model').textC
"gpt-4-vision-preview": "GPT-4-Vision: View & Analyze Images",
"gpt-4-32k": "GPT-4-32k: Longer Context Window — Higher Price",
"gpt-4-turbo-preview": "GPT-4-Turbo: ChatGPT-Plus Model — 128k Tokens",
"gpt-3.5-turbo": "GPT-3.5-Turbo: Cheapest Option Available",
"gpt-3.5-turbo-0125": "GPT-3.5-Turbo: Cheapest Option Available",
"gemini-pro": "Gemini-Pro: Google Bard Model — 3.5 Equivalent",
"gemini-pro-vision": "Gemini-Vision: View Images — One-Time Use",
"mistral-tiny": "Mistral-Tiny: Cheapest Model — English Proficient",
Expand Down Expand Up @@ -250,14 +250,14 @@ document.getElementById('model-gpt-4').addEventListener('click', () => selectMod
document.getElementById('model-gpt-4-vision').addEventListener('click', () => selectModel('gpt-4-vision-preview'));
document.getElementById('model-gpt-4-32k').addEventListener('click', () => selectModel('gpt-4-32k'));
document.getElementById('model-gpt-4-turbo').addEventListener('click', () => selectModel('gpt-4-turbo-preview'));
document.getElementById('model-gpt-3.5').addEventListener('click', () => selectModel('gpt-3.5-turbo'));
document.getElementById('model-gpt-3.5').addEventListener('click', () => selectModel('gpt-3.5-turbo-0125'));

// Event listeners for showing GPT model descriptions on hover
document.getElementById('model-gpt-4').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gpt-4"], event.currentTarget));
document.getElementById('model-gpt-4-vision').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gpt-4-vision-preview"], event.currentTarget));
document.getElementById('model-gpt-4-32k').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gpt-4-32k"], event.currentTarget));
document.getElementById('model-gpt-4-turbo').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gpt-4-turbo-preview"], event.currentTarget));
document.getElementById('model-gpt-3.5').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gpt-3.5-turbo"], event.currentTarget));
document.getElementById('model-gpt-3.5').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gpt-3.5-turbo-0125"], event.currentTarget));

// Event listeners for selecting Gemini models
document.getElementById('model-gemini-pro').addEventListener('click', () => selectModel('gemini-pro'));
Expand Down
3 changes: 1 addition & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,15 +753,14 @@ conversationHistory.push(user_input);
apiUrl = 'https://api.openai.com/v1/chat/completions';
} else if (modelID.startsWith('mistral')) {
headers = {
'Authorization': `Bearer ${process.env.MISTRAL_KEY}`,
'Authorization': `Bearer ${process.env.MISTRAL_API_KEY}`,
// Add any Mistral-specific headers here if necessary
};
apiUrl = 'https://api.mistral.ai/v1/chat/completions';
}

// Log the data payload just before sending it to the chosen API
console.log("API URL", apiUrl);
console.log("Headers", headers);
console.log(`Sending to ${modelID.startsWith('gpt') ? 'OpenAI' : 'Mistral'} API:`, JSON.stringify(data, null, 2));

try {
Expand Down

0 comments on commit ccf10b4

Please sign in to comment.