Skip to content

Commit

Permalink
docs: update website
Browse files Browse the repository at this point in the history
  • Loading branch information
2214962083 committed Aug 15, 2024
1 parent 7099e3a commit 072d54b
Show file tree
Hide file tree
Showing 9 changed files with 371 additions and 28 deletions.
7 changes: 7 additions & 0 deletions website/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { NolebaseInlineLinkPreviewPlugin } from '@nolebase/vitepress-plugin-inline-link-preview/client'
import DefaultTheme from 'vitepress/theme'
import type { App } from 'vue'
import { h } from 'vue'

import '@nolebase/vitepress-plugin-inline-link-preview/client/style.css'

import AideModelPrice from '../../components/AideModels/AideModelPrice/index.vue'
import AidePay from '../../components/AideModels/AidePay.vue'
import ChatBotButton from '../../components/ChatBotButton.vue'
import Image from '../../components/Image.vue'
import Video from '../../components/Video.vue'

Expand All @@ -14,6 +16,11 @@ import './style.css'

export default {
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
'layout-bottom': () => h(ChatBotButton)
})
},
enhanceApp({ app }: { app: App }) {
app.component('Image', Image)
app.component('Video', Video)
Expand Down
105 changes: 78 additions & 27 deletions website/components/AideModels/AideModelPrice/index.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,67 @@
<template>
<div>
<template v-if="!onlyShowAllModels">
<h3>
<template v-if="!onlyShowAllModels && !onlyShowMonthlyModels">
<b>
推荐使用模型(单位:{{ currency }})
<button class="aide-button" @click="toggleCurrency">
切换单位到 -> {{ currency === '虚拟美元' ? '现实人民币' : '虚拟美元' }}
</button>
</h3>
</b>

<PriceTable :models="recommendedModels" :model-price-data="modelPriceData" :currency="currency"
:format-currency="formatCurrency" :model-recommend="modelRecommend" />
</template>

<h3 v-if="!onlyShowAllModels">浏览所有支持的模型</h3>
<details class="details custom-block">
<summary>所有支持的模型价格列表</summary>

<h3>
按量付费模型(单位:{{ currency }})
<button class="aide-button" @click="toggleCurrency">
切换单位到 -> {{ currency === '虚拟美元' ? '现实人民币' : '虚拟美元' }}
</button>
</h3>

<PriceTable :models="tokenPriceModels" :model-price-data="modelPriceData" :currency="currency"
:format-currency="formatCurrency" />

<h3>
按次付费模型(单位:{{ currency }})
<button class="aide-button" @click="toggleCurrency">
切换单位到 -> {{ currency === '虚拟美元' ? '现实人民币' : '虚拟美元' }}
</button>
</h3>
<template v-if="!onlyShowMonthlyModels">
<details class="details custom-block">
<summary>浏览按需付费支持的模型</summary>

<h3>
按量付费模型(单位:{{ currency }})
<button class="aide-button" @click="toggleCurrency">
切换单位到 -> {{ currency === '虚拟美元' ? '现实人民币' : '虚拟美元' }}
</button>
</h3>

<PriceTable :models="tokenPriceModels" :model-price-data="modelPriceData" :currency="currency"
:format-currency="formatCurrency" />

<h3>
按次付费模型(单位:{{ currency }})
<button class="aide-button" @click="toggleCurrency">
切换单位到 -> {{ currency === '虚拟美元' ? '现实人民币' : '虚拟美元' }}
</button>
</h3>

<PriceTable :models="fixedPriceModels" :model-price-data="modelPriceData" :currency="currency"
:format-currency="formatCurrency" :is-fixed-price="true" />
</details>
</template>

<PriceTable :models="fixedPriceModels" :model-price-data="modelPriceData" :currency="currency"
:format-currency="formatCurrency" :is-fixed-price="true" />
</details>
<template v-if="onlyShowMonthlyModels">
<details class="details custom-block" v-if="onlyShowMonthlyModels">
<summary>浏览月卡支持的模型</summary>

<table>
<thead>
<tr>
<th>模型名称</th>
<th>包月调用(超过一定次数会降速)</th>
<th>是否推荐</th>
<th>推荐原因</th>
</tr>
</thead>
<tbody>
<tr v-for="modelName in monthlyModels" :key="modelName">
<td><code>{{ modelName }}</code></td>
<td>无限次</td>
<td>{{ modelRecommend[modelName] ? '是' : '' }}</td>
<td>{{ modelRecommend[modelName] || '' }}</td>
</tr>
</tbody>
</table>
</details>
</template>
</div>
</template>

Expand All @@ -50,6 +76,10 @@ defineProps({
'type': Boolean,
'default': false,
},
onlyShowMonthlyModels: {
'type': Boolean,
'default': false,
},
})
const groupRatio = modelData.data.GroupRatio.default
Expand All @@ -60,9 +90,30 @@ const modelRecommend: Record<string, string> = {
'gpt-4o': '智商高,便宜好用,支持读图和 function_call',
'gpt-4o-2024-08-06': '智商中上,很便宜,支持读图和 function_call',
'gpt-4o-mini': '智商中等,非常非常便宜,支持读图和 function_call',
'claude-3-5-sonnet-20240620': '智商高,支持读图,转发 API 目前不支持 function_call',
'claude-3-5-sonnet-20240620': '智商高,支持读图,支持 function_call',
}
const monthlyModels = [
"claude-3-5-sonnet-20240620",
"claude-3-haiku-20240307",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"gemini-1.5-flash-latest",
"gemini-1.5-pro",
"gemini-1.5-flash",
"gemini-1.5-pro-latest",
"gpt-3.5-turbo",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106",
"gpt-4-turbo",
"gpt-4",
"gpt-4o",
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18"
]
const modelPriceData = ref<ModelPrice>(convertModelPrice(modelData))
const recommendedModels = computed(() => Object.keys(modelRecommend))
Expand Down
157 changes: 157 additions & 0 deletions website/components/ChatBotButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<template>
<div>
<!-- floating button -->
<button @click="toggleWindow" class="floating-button" :class="{ 'opacity-50': !isWindowOpen }" :style="buttonStyle">
<div class="floating-button-icon">
<img src="/logo.svg" alt="logo" />
</div>
</button>

<!-- floating window -->
<div v-show="isWindowOpen" class="iframe-container" ref="iframeContainer" :style="containerStyle">
<div class="iframe-bg"></div>
<iframe ref="iframe" :src="link" class="rounded-2xl overflow-auto w-full bg-white h-full" border="0"
frameborder="0" scrolling="yes" seamless
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowtransparency
allowfullscreen></iframe>
</div>
</div>
</template>

<script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted } from 'vue';
const isWindowOpen = ref(false);
const link = "https://base.openai-next.com/chat/share?shareId=9anwaxmtoagnb2x83afymkjv"
// button size variables
const buttonWidth = ref(50);
const buttonHeight = ref(50);
// distance variables
const buttonRightDistance = ref(20);
const buttonBottomDistance = ref(20);
// window size
const windowWidth = ref(window.innerWidth);
const windowHeight = ref(window.innerHeight);
// update window size and buttonRightDistance
const updateWindowSize = () => {
windowWidth.value = window.innerWidth;
windowHeight.value = window.innerHeight;
buttonBottomDistance.value = windowWidth.value >= 640 ? 20 : 40;
};
// listen to window resize
onMounted(() => {
window.addEventListener('resize', updateWindowSize);
updateWindowSize(); // Initial call to set correct values
});
onUnmounted(() => {
window.removeEventListener('resize', updateWindowSize);
});
const toggleWindow = () => {
isWindowOpen.value = !isWindowOpen.value;
};
// calculate button style
const buttonStyle = computed(() => ({
right: `${buttonRightDistance.value}px`,
bottom: `${buttonBottomDistance.value}px`,
width: `${buttonWidth.value}px`,
height: `${buttonHeight.value}px`
}));
// calculate container style
const containerStyle = computed(() => ({
right: `${buttonRightDistance.value}px`,
bottom: `${buttonBottomDistance.value + buttonHeight.value + 10}px`,
maxWidth: `${windowWidth.value - 2 * buttonRightDistance.value}px`,
maxHeight: `${windowHeight.value - buttonBottomDistance.value - buttonHeight.value - 20}px`,
width: '400px',
height: `${windowHeight.value - buttonBottomDistance.value - buttonHeight.value - 20 - 64}px`
}));
</script>

<style scoped>
.floating-button {
position: fixed;
border-radius: 50%;
border: none;
cursor: pointer;
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
background-color: var(--vp-c-bg);
}
.floating-button::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
filter: blur(15px);
background-image: linear-gradient(-45deg, #8c6bef 50%, #ef7b95 50%);
animation: rotate 4s linear infinite;
}
.floating-button-icon {
position: relative;
z-index: 2;
color: #fff;
width: 75%;
height: 75%;
border-radius: 50%;
overflow: hidden;
}
@keyframes rotate {
100% {
transform: rotate(1turn);
}
}
.iframe-container {
position: fixed;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 999;
padding: 0.5rem;
overflow: hidden;
border-radius: 1rem;
display: flex;
flex-direction: column;
background-color: var(--vp-c-bg);
}
.iframe-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
margin: 2rem;
z-index: -1;
background-image: linear-gradient(-45deg, #8c6bef 50%, #ef7b95 50%);
filter: blur(44px);
animation: rotate 6s linear infinite;
}
@media (min-width: 640px) {
.iframe-bg {
filter: blur(56px);
}
}
@media (min-width: 960px) {
.iframe-bg {
filter: blur(68px);
}
}
</style>
8 changes: 8 additions & 0 deletions website/en/guide/configuration/convert-language-pairs.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ Your language names should follow the [==VSCode Language Identifiers==](https://

:::

::: warning

==VSCode== has two settings.json files: one for global settings, located in the user folder, and another for project settings, located in the .vscode/settings.json file within the project folder.

The current configuration by default is stored in the .vscode/settings.json file in your project folder, so be sure to change the correct location.

:::

::: tip
If you can't find your language in the list, you can freely customize your language identifier. However, this means you might not get syntax highlighting, that's all.
:::
50 changes: 50 additions & 0 deletions website/en/guide/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,53 @@ For more details, see [GitHub Issue #17](https://github.com/nicepkg/aide/issues/

- Try restarting ==VSCode==.
- If the issue persists, try reinstalling ==Aide==.

## ==Code Convert== Doesn't Open Language Selection Box, Always Uses Previous Settings

**Problem Description**: When using the [Code Convert](../features/code-convert.md) feature for the first time, the language was set to convert from `C` to `C++`. On subsequent attempts to convert `C` files, it defaults to `C++`. The language selection box does not appear, preventing new conversion settings.

**Solution**:

1. **Disable Memory Function**: In the current project's `.vscode/settings.json`, set [`aide.autoRememberConvertLanguagePairs`](../configuration/auto-remember-convert-language-pairs.md) to `false`.
2. **Clear Existing Convert Mapping Memory**: Remove the [`aide.convertLanguagePairs`](../configuration/convert-language-pairs.md) configuration from `.vscode/settings.json` in the current project.
3. **Ensure Correct Settings**: VSCode has both global and project-level `settings.json` files. Memory is saved in the project-level configuration by default. Check the `.vscode/settings.json` file in the project folder carefully.

For more details, see [GitHub Issue #92](https://github.com/nicepkg/aide/issues/92).

## ==Smart Paste== Shows Clipboard Empty When Pasting Images

**Problem Description**: When using the [Smart Paste](../features/smart-paste.md) feature, it prompts `Clipboard is empty`.

**Solution**:

1. [**Open VSCode Settings**](./customize-configuration.md)
2. **Enable Clipboard Image Reading**: Search for and enable [`aide.readClipboardImage`](../configuration/read-clipboard-image.md) in the settings.
3. **Other Errors Occur**: If other errors appear after enabling, it means your AI model doesn't support reading images, so you can disable it.

## ==No tools_call in message== Error

**Problem Description**: When using certain features of ==Aide==, the error `No tools_call in message` is prompted.

**Solution**:

1. **Check if the AI model supports the `function_call` feature**:

- Inquire with the AI model provider whether the `function_call` feature is supported.
- Choose an AI model that supports the `function_call` feature.

2. **Switch to an AI model that supports the `function_call` feature**:

- For international models, consider the [OpenAI](../use-another-llm/openai.md) gpt-4o model.
- For Chinese models, consider the [deepseek](../use-another-llm/deepseek.md) deepseek-coder model.

## ==Consider Supporting Other IDEs==

**Problem Description**: Will ==Aide== consider supporting other IDEs, such as ==JetBrains== and ==Visual Studio==?

**Solution**:

1. **Limited Support for ==Visual Studio==**: Due to limited resources, ==Visual Studio== may never be supported.

2. **Possibility of ==JetBrains== Support**: There is strong community demand for ==JetBrains== support, but this requires someone skilled in Kotlin, as ==JetBrains== plugins are developed in Kotlin. Currently, I lack the necessary skills to implement this. I may consider learning Kotlin and using AI to assist in migrating to ==JetBrains== after ==Aide's== main features are complete.

3. **Community Contributions Welcome**: If you have the ability to develop a ==JetBrains== version, contributions are welcome. Please reach out via [GitHub](https://github.com/nicepkg/aide/issues/91) if interested.
1 change: 0 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"license": "ISC",
"devDependencies": {
"@iconify-json/bx": "^1.1.11",
"@iconify-json/fluent-emoji": "^1.1.19",
"@iconify-json/logos": "^1.1.44",
"@nolebase/vitepress-plugin-inline-link-preview": "^2.4.0",
"@unocss/preset-icons": "^0.61.9",
Expand Down
Loading

0 comments on commit 072d54b

Please sign in to comment.