Skip to content

Commit

Permalink
Update README, reorder providers
Browse files Browse the repository at this point in the history
  • Loading branch information
XInTheDark committed May 3, 2024
1 parent ca504af commit 5b3d36b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
"value": "Bing"
},
{
"title": "Replicate (meta-llama-3-70b)",
"value": "ReplicateLlama3"
"title": "DeepInfra (Mixtral-8x22B)",
"value": "DeepInfraMixtral_8x22B"
},
{
"title": "DeepInfra (meta-llama-3-8b)",
Expand All @@ -170,14 +170,14 @@
"title": "DeepInfra (meta-llama-3-70b)",
"value": "DeepInfraLlama3_70B"
},
{
"title": "DeepInfra (Mixtral-8x22B)",
"value": "DeepInfraMixtral_8x22B"
},
{
"title": "Blackbox (custom-model)",
"value": "Blackbox"
},
{
"title": "Replicate (meta-llama-3-70b)",
"value": "ReplicateLlama3"
},
{
"title": "Google Gemini (requires API Key)",
"value": "GoogleGemini"
Expand Down
4 changes: 2 additions & 2 deletions src/aiChat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ export default function Chat({ launchContext }) {
<Form.Dropdown.Item title="ChatGPT (gpt-4-32k)" value="GPT4" />
<Form.Dropdown.Item title="ChatGPT (gpt-3.5-turbo)" value="GPT35" />
<Form.Dropdown.Item title="Bing (gpt-4)" value="Bing" />
<Form.Dropdown.Item title="Replicate (meta-llama-3-70b)" value="ReplicateLlama3" />
<Form.Dropdown.Item title="DeepInfra (Mixtral-8x22B)" value="DeepInfraMixtral_8x22B" />
<Form.Dropdown.Item title="DeepInfra (meta-llama-3-8b)" value="DeepInfraLlama3_8B" />
<Form.Dropdown.Item title="DeepInfra (meta-llama-3-70b)" value="DeepInfraLlama3_70B" />
<Form.Dropdown.Item title="DeepInfra (Mixtral-8x22B)" value="DeepInfraMixtral_8x22B" />
<Form.Dropdown.Item title="Blackbox (custom-model)" value="Blackbox" />
<Form.Dropdown.Item title="Replicate (meta-llama-3-70b)" value="ReplicateLlama3" />
<Form.Dropdown.Item title="Google Gemini (requires API Key)" value="GoogleGemini" />
</Form.Dropdown>
</Form>
Expand Down
30 changes: 15 additions & 15 deletions src/api/gpt.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ import { useEffect, useState } from "react";
import * as G4F from "g4f";
const g4f = new G4F.G4F();

// Google Gemini module
import { GeminiProvider, getGoogleGeminiResponse } from "./Providers/google_gemini";

// Replicate Llama 3 module
import { ReplicateProvider, getReplicateResponse } from "./Providers/replicate";

// DeepInfra Llama 3 module
import { DeepInfraProvider, getDeepInfraResponse } from "./Providers/deepinfra";

// Blackbox module
import { BlackboxProvider, getBlackboxResponse } from "./Providers/blackbox";

// Replicate Llama 3 module
import { ReplicateProvider, getReplicateResponse } from "./Providers/replicate";

// Google Gemini module
import { GeminiProvider, getGoogleGeminiResponse } from "./Providers/google_gemini";

import fs from "fs";

// Providers
Expand All @@ -39,11 +39,11 @@ export const providers = {
GPT4: [g4f.providers.GPT, "gpt-4-32k", false],
GPT35: [g4f.providers.GPT, "gpt-3.5-turbo", false],
Bing: [g4f.providers.Bing, "gpt-4", true],
ReplicateLlama3: [ReplicateProvider, "", true],
DeepInfraMixtral_8x22B: [DeepInfraProvider, "mistralai/Mixtral-8x22B-Instruct-v0.1", true],
DeepInfraLlama3_8B: [DeepInfraProvider, "meta-llama/Meta-Llama-3-8B-Instruct", true],
DeepInfraLlama3_70B: [DeepInfraProvider, "meta-llama/Meta-Llama-3-70B-Instruct", true],
DeepInfraMixtral_8x22B: [DeepInfraProvider, "mistralai/Mixtral-8x22B-Instruct-v0.1", true],
Blackbox: [BlackboxProvider, "", true],
ReplicateLlama3: [ReplicateProvider, "", true],
GoogleGemini: [GeminiProvider, "", false],
};

Expand Down Expand Up @@ -221,18 +221,18 @@ export default (props, { context = undefined, allowPaste = false, useSelected =
export const chatCompletion = async (chat, options) => {
let response;
const provider = options.provider;
if (provider === ReplicateProvider) {
// Meta Llama 3
response = await getReplicateResponse(chat);
} else if (provider === DeepInfraProvider) {
if (provider === DeepInfraProvider) {
// Deep Infra Llama 3
response = await getDeepInfraResponse(chat, options.model);
} else if (provider === GeminiProvider) {
// Google Gemini
response = await getGoogleGeminiResponse(chat);
} else if (provider === BlackboxProvider) {
// Blackbox
response = await getBlackboxResponse(chat);
} else if (provider === ReplicateProvider) {
// Meta Llama 3
response = await getReplicateResponse(chat);
} else if (provider === GeminiProvider) {
// Google Gemini
response = await getGoogleGeminiResponse(chat);
} else {
// GPT
response = await g4f.chatCompletion(chat, options);
Expand Down

0 comments on commit 5b3d36b

Please sign in to comment.