Skip to content

Commit

Permalink
Move providers data to data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
XInTheDark committed Dec 28, 2024
1 parent ef3ba88 commit b92bf5b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/aiChat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { format_chat_to_prompt, MessagePair, pairs_to_messages } from "./classes

import { getChatResponse, getChatResponseSync } from "./api/gpt.jsx";
import * as providers from "./api/providers.js";
import { ChatProvidersReact } from "./api/providers_react.jsx";
import { ChatProvidersReact } from "./api/data/providers_react.jsx";

import { getAIPresets, getPreset } from "./helpers/presets.jsx";

Expand Down
32 changes: 16 additions & 16 deletions src/api/providers_info.js → src/api/data/providers_info.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/// This module contains all the information (i.e. constants) about the providers.

/// Provider modules
import { NexraProvider } from "./Providers/nexra.js";
import { DeepInfraProvider } from "./Providers/deepinfra.js";
import { BlackboxProvider } from "./Providers/blackbox.js";
import { DuckDuckGoProvider } from "./Providers/duckduckgo.js";
import { BestIMProvider } from "./Providers/bestim.js";
import { RocksProvider } from "./Providers/rocks.js";
import { ChatgptFreeProvider } from "./Providers/chatgptfree.js";
import { AI4ChatProvider } from "./Providers/ai4chat.js";
import { DarkAIProvider } from "./Providers/darkai.js";
import { MhysticalProvider } from "./Providers/mhystical.js";
import { PizzaGPTProvider } from "./Providers/pizzagpt.js";
import { MetaAIProvider } from "./Providers/metaAI.js";
import { ReplicateProvider } from "./Providers/replicate.js";
import { PhindProvider } from "./Providers/phind.js";
import { GeminiProvider } from "./Providers/google_gemini.js";
import { NexraProvider } from "../Providers/nexra.js";
import { DeepInfraProvider } from "../Providers/deepinfra.js";
import { BlackboxProvider } from "../Providers/blackbox.js";
import { DuckDuckGoProvider } from "../Providers/duckduckgo.js";
import { BestIMProvider } from "../Providers/bestim.js";
import { RocksProvider } from "../Providers/rocks.js";
import { ChatgptFreeProvider } from "../Providers/chatgptfree.js";
import { AI4ChatProvider } from "../Providers/ai4chat.js";
import { DarkAIProvider } from "../Providers/darkai.js";
import { MhysticalProvider } from "../Providers/mhystical.js";
import { PizzaGPTProvider } from "../Providers/pizzagpt.js";
import { MetaAIProvider } from "../Providers/metaAI.js";
import { ReplicateProvider } from "../Providers/replicate.js";
import { PhindProvider } from "../Providers/phind.js";
import { GeminiProvider } from "../Providers/google_gemini.js";

/// Special or unused providers
import { OpenAIProvider } from "./Providers/openai.js";
import { OpenAIProvider } from "../Providers/openai.js";

/// All providers info
// { provider internal name, {provider object, model, stream, extra options} }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Form } from "@raycast/api";
import { useMemo } from "react";

import { isCustomAPI } from "./providers_custom.js";
import { isCustomAPI } from "../providers_custom.js";

/// Chat providers (user-friendly names)
// fetched from package.json for consistency and to avoid duplicate code
Expand Down
4 changes: 2 additions & 2 deletions src/api/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

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

import { providers_info } from "./providers_info.js";
export * from "./providers_info.js";
import { providers_info } from "./data/providers_info.js";
export * from "./data/providers_info.js";

// Additional options
export const additional_provider_options = (provider, chatOptions = null) => {
Expand Down
4 changes: 2 additions & 2 deletions src/api/providers_custom.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { removePrefix } from "#root/src/helpers/helper.js";
import { Storage } from "#root/src/api/storage.js";

import { providers_info } from "#root/src/api/providers_info.js";
import { chat_providers_names } from "#root/src/api/providers_react.jsx";
import { providers_info } from "#root/src/api/data/providers_info.js";
import { chat_providers_names } from "#root/src/api/data/providers_react.jsx";

import { CustomOpenAIProvider } from "#root/src/api/Providers/special/custom_openai.js";

Expand Down
2 changes: 1 addition & 1 deletion src/components/preferences/manageAIPresets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { help_action } from "../../helpers/helpPage.jsx";
import { AIPreset, getAIPresets, getSubtitle, setAIPresets } from "../../helpers/presets.jsx";

import * as providers from "../../api/providers.js";
import { ChatProvidersReact } from "../../api/providers_react.jsx";
import { ChatProvidersReact } from "../../api/data/providers_react.jsx";
import { Preferences } from "../../api/preferences.js";

export const ManageAIPresets = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/preferences/options/defaultProvider.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatProvidersReact } from "#root/src/api/providers_react.jsx";
import { ChatProvidersReact } from "#root/src/api/data/providers_react.jsx";
import { ValueDropdown } from "#root/src/components/preferences/base/valueDropdown.jsx";

export const DefaultProvider = () => {
Expand Down

0 comments on commit b92bf5b

Please sign in to comment.