Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/bots/atlascloud/AtlasCloudAPIBot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import LangChainBot from "@/bots/LangChainBot";
import store from "@/store";
import { ChatOpenAI } from "@langchain/openai";

export default class AtlasCloudAPIBot extends LangChainBot {
static _brandId = "atlasCloudApi";
static _className = "AtlasCloudAPIBot";
static _logoFilename = "default-logo.svg";

constructor() {
super();
}

async _checkAvailability() {
let available = false;

if (store.state.atlasCloudApi.apiKey) {
this.setupModel();
available = true;
}
return available;
}

_setupModel() {
const chatModel = new ChatOpenAI({
configuration: {
baseURL: "https://api.atlascloud.ai/v1",
},
Comment on lines +24 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

In @langchain/openai (which uses the openai SDK v4), the custom API endpoint should be configured using the baseURL parameter instead of basePath. Using basePath will cause the SDK to ignore the custom endpoint and default to the official OpenAI API URL (https://api.openai.com/v1), which will fail for Atlas Cloud.

Suggested change
_setupModel() {
const chatModel = new ChatOpenAI({
configuration: {
basePath: "https://api.atlascloud.ai/v1",
},
_setupModel() {
const chatModel = new ChatOpenAI({
configuration: {
baseURL: "https://api.atlascloud.ai/v1",
},

openAIApiKey: store.state.atlasCloudApi.apiKey,
modelName: this.constructor._model ? this.constructor._model : "",
temperature: store.state.atlasCloudApi.temperature,
maxTokens: store.state.atlasCloudApi.maxTokens,
streaming: true,
});
Comment thread
coderabbitai[bot] marked this conversation as resolved.
return chatModel;
}

getPastRounds() {
return store.state.atlasCloudApi.pastRounds ?? 5;
}
Comment on lines +38 to +40

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using a simple ternary check store.state.atlasCloudApi.pastRounds ? ... will treat 0 as a falsy value. Since 0 is a valid configuration value for pastRounds (allowing users to disable chat history), this check will incorrectly fall back to the default value of 5. Use the nullish coalescing operator (??) to correctly handle 0.

  getPastRounds() {
    return store.state.atlasCloudApi.pastRounds ?? 5;
  }

Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
10 changes: 10 additions & 0 deletions src/bots/atlascloud/AtlasCloudDeepSeekV4ProBot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import AtlasCloudAPIBot from "./AtlasCloudAPIBot";

export default class AtlasCloudDeepSeekV4ProBot extends AtlasCloudAPIBot {
static _className = "AtlasCloudDeepSeekV4ProBot";
static _model = "deepseek-ai/deepseek-v4-pro";

constructor() {
super();
}
}
10 changes: 10 additions & 0 deletions src/bots/atlascloud/AtlasCloudQwen35FlashBot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import AtlasCloudAPIBot from "./AtlasCloudAPIBot";

export default class AtlasCloudQwen35FlashBot extends AtlasCloudAPIBot {
static _className = "AtlasCloudQwen35FlashBot";
static _model = "qwen/qwen3.5-flash";

constructor() {
super();
}
}
6 changes: 6 additions & 0 deletions src/bots/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ import ClaudeAPIHaikuBot from "./anthropic/ClaudeAPIHaikuBot";
import Grok2APIBot from "./xai/Grok2APIBot";
import Grok3APIBot from "./xai/Grok3APIBot";
import Grok3MiniAPIBot from "./xai/Grok3MiniAPIBot";
import AtlasCloudQwen35FlashBot from "./atlascloud/AtlasCloudQwen35FlashBot";
import AtlasCloudDeepSeekV4ProBot from "./atlascloud/AtlasCloudDeepSeekV4ProBot";

const all = [
Qihoo360AIBrainBot.getInstance(),
Expand Down Expand Up @@ -134,6 +136,8 @@ const all = [
Grok2APIBot.getInstance(),
Grok3APIBot.getInstance(),
Grok3MiniAPIBot.getInstance(),
AtlasCloudQwen35FlashBot.getInstance(),
AtlasCloudDeepSeekV4ProBot.getInstance(),
];

const disabled = ["HuggingChatBot"];
Expand Down Expand Up @@ -230,6 +234,8 @@ export const botTags = {
bots.getBotByClassName("Grok2APIBot"),
bots.getBotByClassName("Grok3APIBot"),
bots.getBotByClassName("Grok3MiniAPIBot"),
bots.getBotByClassName("AtlasCloudQwen35FlashBot"),
bots.getBotByClassName("AtlasCloudDeepSeekV4ProBot"),
],
madeInChina: [
bots.getBotByClassName("Qihoo360AIBrainBot"),
Expand Down
75 changes: 75 additions & 0 deletions src/components/BotSettings/AtlasCloudAPIBotSettings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<template>
<CommonBotSettings
:settings="settings"
:brand-id="brandId"
mutation-type="setAtlasCloudApi"
:watcher="watcher"
/>
</template>
Comment on lines +1 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The template has inconsistent indentation and a split closing tag ></CommonBotSettings\n >. Clean up the formatting and use a self-closing tag for better readability and consistency with Vue style guidelines.

<template>
  <CommonBotSettings
    :settings="settings"
    :brand-id="brandId"
    mutation-type="setAtlasCloudApi"
    :watcher="watcher"
  />
</template>


<script>
import _bots from "@/bots";
import Bot from "@/bots/atlascloud/AtlasCloudAPIBot";
import CommonBotSettings from "@/components/BotSettings/CommonBotSettings.vue";
import { Type } from "./settings.const";

const settings = [
{
type: Type.Text,
name: "apiKey",
title: "common.apiKey",
description: "settings.secretPrompt",
placeholder: "ak-...",
},
{
type: Type.Slider,
name: "temperature",
title: "openaiApi.temperature",
description: "openaiApi.temperaturePrompt",
min: 0,
max: 2,
step: 0.1,
ticks: {
0: "openaiApi.temperature0",
2: "openaiApi.temperature2",
},
},
{
type: Type.Slider,
name: "maxTokens",
title: "claudeApi.maxTokens",
description: "claudeApi.maxTokensPrompt",
min: 512,
max: 8192,
step: 512,
},
{
type: Type.Slider,
name: "pastRounds",
title: "bot.pastRounds",
description: "bot.pastRoundsPrompt",
min: 0,
max: 10,
step: 1,
},
];
export default {
components: {
CommonBotSettings,
},
data() {
return {
settings: settings,
brandId: Bot._brandId,
};
},
methods: {
watcher() {
_bots.all
.filter((bot) => bot instanceof Bot)
.forEach((bot) => bot.setupModel());
},
Comment on lines +67 to +71

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using .map() solely for side effects (calling bot.setupModel()) is an anti-pattern because .map() is intended to construct and return a new array. Use .forEach() instead to clearly signal that this operation is performed for its side effects.

    watcher() {
      _bots.all
        .filter((bot) => bot instanceof Bot)
        .forEach((bot) => bot.setupModel());
    },

},
};
</script>

2 changes: 2 additions & 0 deletions src/components/SettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ import { resolveTheme, applyTheme, Mode } from "../theme";
import ClaudeAPIBotSettings from "./BotSettings/ClaudeAPIBotSettings.vue";
import GroqAPIBotSettings from "./BotSettings/GroqAPIBotSettings.vue";
import xAIAPIBotSettings from "./BotSettings/xAIAPIBotSettings.vue";
import AtlasCloudAPIBotSettings from "./BotSettings/AtlasCloudAPIBotSettings.vue";

const { ipcRenderer } = window.require("electron");
const { t: $t, locale } = useI18n();
Expand All @@ -142,6 +143,7 @@ const tab = ref(null);
const botSettings = [
{ brand: "360AiBrain", component: Qihoo360AIBrainBotSettings },
{ brand: "azureOpenaiApi", component: AzureOpenAIAPIBotSettings },
{ brand: "atlasCloudApi", component: AtlasCloudAPIBotSettings },
{ brand: "bard", component: BardBotSettings },
{ brand: "bingChat", component: BingChatBotSettings },
{ brand: "characterAI", component: CharacterAIBotSettings },
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/zhtw.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
"gemma-7b-it": "Gemma 7b",
"gemma2-9b-it": "Gemma2 9b"
},
"atlasCloudApi": {
"name": "Atlas Cloud API",
"qwenqwen35-flash": "Qwen3.5 Flash",
"deepseek-aideepseek-v4-pro": "DeepSeek V4 Pro"
},
"xaiApi": {
"name": "xAI API",
"grok-2-latest": "Grok-2",
Expand Down
2 changes: 2 additions & 0 deletions src/store/chats.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Chats {
{ classname: "Grok3MiniAPIBot", selected: false },
{ classname: "Llama4ScoutGroqAPIBot", selected: false },
{ classname: "Llama4MaverickGroqAPIBot", selected: false },
{ classname: "AtlasCloudQwen35FlashBot", selected: false },
{ classname: "AtlasCloudDeepSeekV4ProBot", selected: false },
{ classname: "OpenAIAPI41Bot", selected: false },
{ classname: "OpenAIAPI41MiniBot", selected: false },
{ classname: "OpenAIAPI41NanoBot", selected: false },
Expand Down
9 changes: 9 additions & 0 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ export default createStore({
apiKey: "",
pastRounds: 5,
},
atlasCloudApi: {
apiKey: "",
temperature: 0.7,
maxTokens: 1024,
pastRounds: 5,
},
currentChatIndex: 0,
updateCounter: 0,
theme: undefined,
Expand Down Expand Up @@ -277,6 +283,9 @@ export default createStore({
setXaiApi(state, values) {
state.xaiApi = { ...state.xaiApi, ...values };
},
setAtlasCloudApi(state, values) {
state.atlasCloudApi = { ...state.atlasCloudApi, ...values };
},
setLatestPromptIndex(state, promptIndex) {
Chats.table.update(state.currentChatIndex, {
latestPromptIndex: promptIndex,
Expand Down