mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 00:16:46 +00:00
feat: update docs
This commit is contained in:
1 parent
795e39a6bc
commit
72652814c0
6 files changed
+132
-9
No files matched your search
@@ -2,7 +2,7 @@
|
||||
title: Integrate DocsGPT Chat Widget into Your Web Application
|
||||
description: Embed the DocsGPT Widget in your React, HTML, or Nextra projects to provide AI-powered chat functionality to your users.
|
||||
---
|
||||
import { Tabs } from 'nextra/components'
|
||||
import { Callout, Tabs } from 'nextra/components'
|
||||
|
||||
# Integrating DocsGPT Chat Widget
|
||||
|
||||
@@ -32,12 +32,21 @@ In your React component file, import the `DocsGPTWidget` component:
|
||||
import { DocsGPTWidget } from "docsgpt";
|
||||
```
|
||||
|
||||
<Callout type="info" emoji="🔗">
|
||||
**Which `apiHost`?** It is the URL of the DocsGPT **API**, not the app you log
|
||||
into. For DocsGPT Cloud that is `https://gptcloud.arc53.com` — which is also the widget's
|
||||
built-in default, so you can omit the prop entirely. Self-hosting? Use your
|
||||
own API URL (`http://localhost:7091` by default), not the frontend URL. A
|
||||
`Network Error` or a CORS message in the console almost always means this is
|
||||
pointing at the frontend instead of the API.
|
||||
</Callout>
|
||||
|
||||
Now, you can embed the widget within your React component's JSX:
|
||||
|
||||
```jsx
|
||||
<DocsGPTWidget
|
||||
apiHost="https://your-docsgpt-api.com"
|
||||
apiKey=""
|
||||
apiHost="https://gptcloud.arc53.com"
|
||||
apiKey="your-agent-api-key"
|
||||
avatar="https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png"
|
||||
title="Get AI assistance"
|
||||
description="DocsGPT's AI Chatbot is here to help"
|
||||
@@ -79,8 +88,8 @@ Then, in a `<script type="module">` block, use the `renderDocsGPTWidget` functio
|
||||
<script type="module">
|
||||
window.onload = function() {
|
||||
renderDocsGPTWidget('app', {
|
||||
apiHost: 'http://localhost:7001', // Replace with your API Host
|
||||
apiKey:"",
|
||||
apiHost: 'https://gptcloud.arc53.com', // self-hosted: your API URL, e.g. http://localhost:7091
|
||||
apiKey: "your-agent-api-key",
|
||||
avatar: 'https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png',
|
||||
title: 'Get AI assistance',
|
||||
description: "DocsGPT's AI Chatbot is here to help",
|
||||
|
||||
@@ -39,7 +39,7 @@ Now, you can embed the widget within your React component's JSX:
|
||||
```jsx
|
||||
<SearchBar
|
||||
apiKey="your-api-key"
|
||||
apiHost="https://your-docsgpt-api.com"
|
||||
apiHost="https://gptcloud.arc53.com"
|
||||
theme="light"
|
||||
placeholder="Search or Ask AI..."
|
||||
width="300px"
|
||||
@@ -76,7 +76,7 @@ Then, in a `<script type="module">` block, use the `renderSearchBar` function to
|
||||
window.onload = function() {
|
||||
renderSearchBar('search-bar-container', {
|
||||
apiKey: 'your-api-key-here',
|
||||
apiHost: 'https://your-api-host.com',
|
||||
apiHost: 'https://gptcloud.arc53.com',
|
||||
theme: 'light',
|
||||
placeholder: 'Search here...',
|
||||
width: '300px'
|
||||
|
||||
Reference in new issue
Block a user