Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 036e9e6

Browse files
committed
feat: Add support for various AI model providers and enhance documentation
- Introduced integration with WeChat Official Account for AstrBot. - Added 302.AI as a new service provider with setup instructions. - Created documentation for Agent Executors, including built-in and third-party options like Dify, Coze, and Alibaba Cloud. - Added detailed setup guides for Coze, Alibaba Cloud, Dify, AIHubMix, PPIO, and TokenPony. - Updated the main documentation to provide an overview of AstrBot's capabilities and deployment instructions. - Deprecated old provider pages and redirected to new documentation. - Enhanced the user experience with clear instructions for configuring AI models and service providers.
1 parent aa0ef40 commit 036e9e6

File tree

111 files changed

+1735
-1237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1735
-1237
lines changed

.vitepress/config.mjs

Lines changed: 175 additions & 185 deletions
Large diffs are not rendered by default.
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<script setup>
2+
import { useRoute } from 'vitepress'
3+
import { computed, provide, useSlots, watch } from 'vue'
4+
import VPBackdrop from 'vitepress/dist/client/theme-default/components/VPBackdrop.vue'
5+
import VPContent from 'vitepress/dist/client/theme-default/components/VPContent.vue'
6+
import VPFooter from 'vitepress/dist/client/theme-default/components/VPFooter.vue'
7+
import VPLocalNav from 'vitepress/dist/client/theme-default/components/VPLocalNav.vue'
8+
import VPNav from 'vitepress/dist/client/theme-default/components/VPNav.vue'
9+
import VPSidebar from 'vitepress/dist/client/theme-default/components/VPSidebar.vue'
10+
import VPSkipLink from 'vitepress/dist/client/theme-default/components/VPSkipLink.vue'
11+
import { useData } from 'vitepress/dist/client/theme-default/composables/data'
12+
import { useCloseSidebarOnEscape, useSidebar } from 'vitepress/dist/client/theme-default/composables/sidebar'
13+
import SectionTabs from './SectionTabs.vue'
14+
15+
const {
16+
isOpen: isSidebarOpen,
17+
open: openSidebar,
18+
close: closeSidebar
19+
} = useSidebar()
20+
21+
const route = useRoute()
22+
watch(() => route.path, closeSidebar)
23+
24+
useCloseSidebarOnEscape(isSidebarOpen, closeSidebar)
25+
26+
const { frontmatter } = useData()
27+
28+
const sidebarScopeClass = computed(() => {
29+
const path = route.path
30+
const normalizedPath = path
31+
.replace(/\.html$/, '')
32+
.replace(/\/$/, '') || '/'
33+
34+
if (
35+
normalizedPath === '/what-is-astrbot' || normalizedPath === '/community' || normalizedPath === '/faq'
36+
|| path.startsWith('/deploy/') || path.startsWith('/others/') || path.startsWith('/ospp/')
37+
|| normalizedPath === '/en/what-is-astrbot' || normalizedPath === '/en/community' || normalizedPath === '/en/faq'
38+
|| path.startsWith('/en/deploy/') || path.startsWith('/en/others/') || path.startsWith('/en/ospp/')
39+
)
40+
return 'sidebar-scope-intro-deploy'
41+
42+
if (path.startsWith('/platform/') || path.startsWith('/en/platform/'))
43+
return 'sidebar-scope-platform'
44+
45+
if (path.startsWith('/providers/') || path.startsWith('/en/providers/'))
46+
return 'sidebar-scope-providers'
47+
48+
if (path.startsWith('/use/') || path.startsWith('/en/use/'))
49+
return 'sidebar-scope-use'
50+
51+
if (path.startsWith('/dev/') || path.startsWith('/en/dev/'))
52+
return 'sidebar-scope-dev'
53+
54+
return ''
55+
})
56+
57+
const slots = useSlots()
58+
const heroImageSlotExists = computed(() => !!slots['home-hero-image'])
59+
60+
provide('hero-image-slot-exists', heroImageSlotExists)
61+
</script>
62+
63+
<template>
64+
<div
65+
v-if="frontmatter.layout !== false"
66+
class="Layout"
67+
:class="[frontmatter.pageClass, sidebarScopeClass]"
68+
>
69+
<slot name="layout-top" />
70+
<VPSkipLink />
71+
<VPBackdrop class="backdrop" :show="isSidebarOpen" @click="closeSidebar" />
72+
<VPNav>
73+
<template #nav-bar-title-before><slot name="nav-bar-title-before" /></template>
74+
<template #nav-bar-title-after><slot name="nav-bar-title-after" /></template>
75+
<template #nav-bar-content-before><slot name="nav-bar-content-before" /></template>
76+
<template #nav-bar-content-after><slot name="nav-bar-content-after" /></template>
77+
<template #nav-screen-content-before><slot name="nav-screen-content-before" /></template>
78+
<template #nav-screen-content-after><slot name="nav-screen-content-after" /></template>
79+
</VPNav>
80+
81+
<SectionTabs />
82+
83+
<VPLocalNav :open="isSidebarOpen" @open-menu="openSidebar" />
84+
85+
<VPSidebar :open="isSidebarOpen">
86+
<template #sidebar-nav-before><slot name="sidebar-nav-before" /></template>
87+
<template #sidebar-nav-after><slot name="sidebar-nav-after" /></template>
88+
</VPSidebar>
89+
90+
<VPContent>
91+
<template #page-top><slot name="page-top" /></template>
92+
<template #page-bottom><slot name="page-bottom" /></template>
93+
94+
<template #not-found><slot name="not-found" /></template>
95+
<template #home-hero-before><slot name="home-hero-before" /></template>
96+
<template #home-hero-info-before><slot name="home-hero-info-before" /></template>
97+
<template #home-hero-info><slot name="home-hero-info" /></template>
98+
<template #home-hero-info-after><slot name="home-hero-info-after" /></template>
99+
<template #home-hero-actions-after><slot name="home-hero-actions-after" /></template>
100+
<template #home-hero-image><slot name="home-hero-image" /></template>
101+
<template #home-hero-after><slot name="home-hero-after" /></template>
102+
<template #home-features-before><slot name="home-features-before" /></template>
103+
<template #home-features-after><slot name="home-features-after" /></template>
104+
105+
<template #doc-footer-before><slot name="doc-footer-before" /></template>
106+
<template #doc-before><slot name="doc-before" /></template>
107+
<template #doc-after><slot name="doc-after" /></template>
108+
<template #doc-top><slot name="doc-top" /></template>
109+
<template #doc-bottom><slot name="doc-bottom" /></template>
110+
111+
<template #aside-top><slot name="aside-top" /></template>
112+
<template #aside-bottom><slot name="aside-bottom" /></template>
113+
<template #aside-outline-before><slot name="aside-outline-before" /></template>
114+
<template #aside-outline-after><slot name="aside-outline-after" /></template>
115+
<template #aside-ads-before><slot name="aside-ads-before" /></template>
116+
<template #aside-ads-after><slot name="aside-ads-after" /></template>
117+
</VPContent>
118+
119+
<VPFooter />
120+
<slot name="layout-bottom" />
121+
</div>
122+
<Content v-else />
123+
</template>
124+
125+
<style scoped>
126+
.Layout {
127+
display: flex;
128+
flex-direction: column;
129+
min-height: 100vh;
130+
}
131+
</style>
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<script setup>
2+
import { computed } from 'vue'
3+
import { useData, useRoute } from 'vitepress'
4+
5+
const route = useRoute()
6+
const { frontmatter } = useData()
7+
8+
const isEnglish = computed(() => route.path.startsWith('/en/'))
9+
10+
const zhTabs = [
11+
{
12+
text: '简介和部署',
13+
link: '/what-is-astrbot',
14+
matchers: ['/what-is-astrbot', '/community', '/faq', '/deploy/', '/others/', '/ospp/']
15+
},
16+
{ text: '接入消息平台', link: '/platform/start', matchers: ['/platform/'] },
17+
{ text: '接入 AI', link: '/providers/start', matchers: ['/providers/'] },
18+
{ text: '使用', link: '/use/webui', matchers: ['/use/'] },
19+
{ text: '开发', link: '/dev/star/plugin-new', matchers: ['/dev/'] }
20+
]
21+
22+
const enTabs = [
23+
{
24+
text: 'Intro & Deploy',
25+
link: '/en/what-is-astrbot',
26+
matchers: ['/en/what-is-astrbot', '/en/community', '/en/faq', '/en/deploy/', '/en/others/', '/en/ospp/']
27+
},
28+
{ text: 'Messaging Platforms', link: '/en/platform/start', matchers: ['/en/platform/'] },
29+
{ text: 'AI Integration', link: '/en/providers/start', matchers: ['/en/providers/'] },
30+
{ text: 'Usage', link: '/en/use/webui', matchers: ['/en/use/'] },
31+
{ text: 'Development', link: '/en/dev/star/plugin-new', matchers: ['/en/dev/'] }
32+
]
33+
34+
const tabs = computed(() => (isEnglish.value ? enTabs : zhTabs))
35+
36+
const isHome = computed(() => route.path === '/' || route.path === '/en/')
37+
38+
const shouldShow = computed(() => frontmatter.value.layout !== false && frontmatter.value.layout !== 'home' && !isHome.value)
39+
40+
function isActive(tab) {
41+
return tab.matchers.some(prefix => route.path.startsWith(prefix))
42+
}
43+
</script>
44+
45+
<template>
46+
<template v-if="shouldShow">
47+
<div class="VPSectionTabsPlaceholder" aria-hidden="true" />
48+
<div class="VPSectionTabs">
49+
<div class="container">
50+
<a
51+
v-for="tab in tabs"
52+
:key="tab.link"
53+
class="tab"
54+
:class="{ active: isActive(tab) }"
55+
:href="tab.link"
56+
>
57+
{{ tab.text }}
58+
</a>
59+
</div>
60+
</div>
61+
</template>
62+
</template>
63+
64+
<style scoped>
65+
.VPSectionTabs {
66+
display: none;
67+
}
68+
69+
.VPSectionTabsPlaceholder {
70+
display: none;
71+
}
72+
73+
@media (min-width: 1280px) {
74+
.VPSectionTabsPlaceholder {
75+
display: block;
76+
height: var(--vp-section-tabs-height, 44px);
77+
}
78+
79+
.VPSectionTabs {
80+
display: block;
81+
position: fixed;
82+
left: 0;
83+
right: 0;
84+
top: calc(var(--vp-layout-top-height, 0px) + var(--vp-nav-height));
85+
z-index: 26;
86+
border-bottom: 1px solid var(--vp-c-gutter);
87+
background-color: var(--vp-nav-bg-color);
88+
}
89+
90+
.container {
91+
margin: 0 auto;
92+
max-width: var(--vp-layout-max-width);
93+
display: flex;
94+
align-items: flex-end;
95+
gap: 10px;
96+
box-sizing: border-box;
97+
height: var(--vp-section-tabs-height, 44px);
98+
padding: 0 32px 8px;
99+
}
100+
101+
.tab {
102+
border-radius: 999px;
103+
padding: 6px 12px;
104+
font-size: 13px;
105+
line-height: 20px;
106+
color: var(--vp-c-text-2);
107+
white-space: nowrap;
108+
transition: color 0.2s ease, background-color 0.2s ease;
109+
}
110+
111+
.tab:hover {
112+
color: var(--vp-c-text-1);
113+
background-color: var(--vp-c-default-soft);
114+
}
115+
116+
.tab.active {
117+
color: var(--vp-c-brand-1);
118+
background-color: var(--vp-c-brand-soft);
119+
}
120+
}
121+
</style>

.vitepress/theme/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import DefaultTheme from 'vitepress/theme'
44
import './styles/style.css'
55
import './styles/custom-block.css'
66
import './styles/font.css'
7+
import Layout from './components/Layout.vue'
78
import ArticleShare from './components/ArticleShare.vue'
89
import NotFound from './components/NotFound.vue'
910

1011
/** @type {import('vitepress').Theme} */
1112
export default {
1213
extends: DefaultTheme,
1314
Layout() {
14-
return h(DefaultTheme.Layout, null, {
15+
return h(Layout, null, {
1516
// https://vitepress.dev/guide/extending-default-theme#layout-slots
1617
'aside-outline-after': () => h(ArticleShare),
1718
'not-found': () => h(NotFound)

0 commit comments

Comments
 (0)