Skip to content

Commit

Permalink
Clean up provider.js
Browse files Browse the repository at this point in the history
  • Loading branch information
XInTheDark committed Nov 13, 2024
1 parent c988d60 commit 0e4d324
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/api/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

import { Preferences } from "./preferences.js";

/// For user-friendly names
import { preferences } from "../../package.json";

/// Provider modules
import { NexraProvider } from "./Providers/nexra.js";
import { DeepInfraProvider } from "./Providers/deepinfra.js";
Expand Down Expand Up @@ -81,12 +78,6 @@ export const providers_info = {
CustomOpenAI: { provider: CustomOpenAIProvider, stream: true },
};

/// Chat providers (user-friendly names)
// fetched from package.json for consistency and to avoid duplicate code
export const chat_providers_names = preferences
.find((x) => x.name === "gptProvider")
.data.map((x) => [x.title, x.value]);

/// Providers that support file uploads
export const file_supported_providers = [GeminiProvider, DeepInfraProvider];

Expand Down
8 changes: 7 additions & 1 deletion src/api/providers_react.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Form } from "@raycast/api";
import { chat_providers_names } from "./providers.js";

/// For user-friendly names
import { preferences } from "../../package.json";

/// Chat providers (user-friendly names)
// fetched from package.json for consistency and to avoid duplicate code
const chat_providers_names = preferences.find((x) => x.name === "gptProvider").data.map((x) => [x.title, x.value]);

export const ChatProvidersReact = (() => {
// Display custom APIs in a separate section for organization
Expand Down

0 comments on commit 0e4d324

Please sign in to comment.