From 2c15fd3c0f5b374294e5e6ec1e3dd3e673d6e3d3 Mon Sep 17 00:00:00 2001 From: Salmen Hichri Date: Wed, 26 Jun 2024 10:19:56 +0100 Subject: [PATCH] Updated some docs --- docs/docs/reference/003-api/001-ai-chat.mdx | 76 ------------------- docs/docs/reference/003-api/001-usage.mdx | 43 +++++++++++ .../usage => 001-usage/_001-usage}/#js.mdx | 0 .../setup => 001-usage/_001-usage}/#react.mdx | 0 .../_002-api-calls}/#js.mdx | 0 .../_002-api-calls}/#react.mdx | 0 .../_003-lifecycle}/#js.mdx | 0 .../_003-lifecycle}/#react.mdx | 0 .../001-send-message.mdx | 9 +++ .../002-reset-conversation.mdx | 9 +++ .../003-api/002-methods/_category_.json | 9 +++ .../reference/003-api/_001-ai-chat/#js.mdx | 0 .../reference/003-api/_001-ai-chat/#react.mdx | 0 .../methods/#js/001-send-message.mdx | 0 .../methods/#js/002-reset-conversation.mdx | 0 .../003-api/_001-ai-chat/usage/#react.mdx | 14 ---- .../003-api/_001-ai-chat/usage/setup/#js.mdx | 1 - 17 files changed, 70 insertions(+), 91 deletions(-) delete mode 100644 docs/docs/reference/003-api/001-ai-chat.mdx create mode 100644 docs/docs/reference/003-api/001-usage.mdx rename docs/docs/reference/003-api/{_001-ai-chat/usage => 001-usage/_001-usage}/#js.mdx (100%) rename docs/docs/reference/003-api/{_001-ai-chat/usage/setup => 001-usage/_001-usage}/#react.mdx (100%) rename docs/docs/reference/003-api/{_001-ai-chat/usage/api-calls => 001-usage/_002-api-calls}/#js.mdx (100%) rename docs/docs/reference/003-api/{_001-ai-chat/usage/api-calls => 001-usage/_002-api-calls}/#react.mdx (100%) rename docs/docs/reference/003-api/{_001-ai-chat/usage/lifecycle => 001-usage/_003-lifecycle}/#js.mdx (100%) rename docs/docs/reference/003-api/{_001-ai-chat/usage/lifecycle => 001-usage/_003-lifecycle}/#react.mdx (100%) rename docs/docs/reference/003-api/{_001-ai-chat/methods/#react => 002-methods}/001-send-message.mdx (88%) rename docs/docs/reference/003-api/{_001-ai-chat/methods/#react => 002-methods}/002-reset-conversation.mdx (84%) create mode 100644 docs/docs/reference/003-api/002-methods/_category_.json delete mode 100644 docs/docs/reference/003-api/_001-ai-chat/#js.mdx delete mode 100644 docs/docs/reference/003-api/_001-ai-chat/#react.mdx delete mode 100644 docs/docs/reference/003-api/_001-ai-chat/methods/#js/001-send-message.mdx delete mode 100644 docs/docs/reference/003-api/_001-ai-chat/methods/#js/002-reset-conversation.mdx delete mode 100644 docs/docs/reference/003-api/_001-ai-chat/usage/#react.mdx delete mode 100644 docs/docs/reference/003-api/_001-ai-chat/usage/setup/#js.mdx diff --git a/docs/docs/reference/003-api/001-ai-chat.mdx b/docs/docs/reference/003-api/001-ai-chat.mdx deleted file mode 100644 index 2e7a4be9..00000000 --- a/docs/docs/reference/003-api/001-ai-chat.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -sidebar_label: 'AI Chat API' ---- - -import {PlatformSelector} from '@site/src/components/PlatformSelector/PlatformSelector'; -import {PlatformSection} from '@site/src/components/PlatformSection/PlatformSection'; - -import UsageReact from './_001-ai-chat/#react.mdx'; -import UsageJavaScript from './_001-ai-chat/#js.mdx'; - -import UsageUsageReact from './_001-ai-chat/usage/#react.mdx'; -import UsageUsageJavaScript from './_001-ai-chat/usage/#js.mdx'; - -import UsageSetupReact from './_001-ai-chat/usage/setup/#react.mdx'; -import UsageSetupJavaScript from './_001-ai-chat/usage/setup/#js.mdx'; - -import UsageCallsReact from './_001-ai-chat/usage/api-calls/#react.mdx'; -import UsageCallsJavaScript from './_001-ai-chat/usage/api-calls/#js.mdx'; - -import UsageLifecycleReact from './_001-ai-chat/usage/lifecycle/#react.mdx'; -import UsageLifecycleJavaScript from './_001-ai-chat/usage/lifecycle/#js.mdx'; - -import SendMessageReact from './_001-ai-chat/methods/#react/001-send-message.mdx'; -import SendMessageJavaScript from './_001-ai-chat/methods/#js/001-send-message.mdx'; - -import ResetConversationReact from './_001-ai-chat/methods/#react/002-reset-conversation.mdx'; -import ResetConversationJavaScript from './_001-ai-chat/methods/#js/002-reset-conversation.mdx'; - -# AI Chat API - ---- - -The API layer provides a way to programmatically interact with the chatbot. It enables operations such as sending -messages, getting the chat history, and more. - - - ---- - -## Usage - - - ---- - -### Setup - - - ---- - -### API Calls - - - ---- - -### Lifecycle - - - ---- - -## API Methods - ---- - -### Send Message - - - ---- - -### Reset Conversation - - diff --git a/docs/docs/reference/003-api/001-usage.mdx b/docs/docs/reference/003-api/001-usage.mdx new file mode 100644 index 00000000..a493dcfa --- /dev/null +++ b/docs/docs/reference/003-api/001-usage.mdx @@ -0,0 +1,43 @@ +--- +sidebar_label: 'Usage' +description: 'The AI chat API enables programmatic interaction with the conversational UI.' +--- + +import {PlatformSelector} from '@site/src/components/PlatformSelector/PlatformSelector'; +import {PlatformSection} from '@site/src/components/PlatformSection/PlatformSection'; + +import UsageSetupReact from './001-usage/_001-usage/#react.mdx'; +import UsageSetupJavaScript from './001-usage/_001-usage/#js.mdx'; + +import UsageCallsReact from './001-usage/_002-api-calls/#react.mdx'; +import UsageCallsJavaScript from './001-usage/_002-api-calls/#js.mdx'; + +import UsageLifecycleReact from './001-usage/_003-lifecycle/#react.mdx'; +import UsageLifecycleJavaScript from './001-usage/_003-lifecycle/#js.mdx'; + +# AI Chat API + +--- + +The API layer provides a way to programmatically interact with the chatbot. It enables operations such as sending +messages, getting the chat history, and more. + + null} javascript={() => null}/> + +--- + +## Usage + + + +--- + +## API Calls + + + +--- + +## Lifecycle + + diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/#js.mdx b/docs/docs/reference/003-api/001-usage/_001-usage/#js.mdx similarity index 100% rename from docs/docs/reference/003-api/_001-ai-chat/usage/#js.mdx rename to docs/docs/reference/003-api/001-usage/_001-usage/#js.mdx diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/setup/#react.mdx b/docs/docs/reference/003-api/001-usage/_001-usage/#react.mdx similarity index 100% rename from docs/docs/reference/003-api/_001-ai-chat/usage/setup/#react.mdx rename to docs/docs/reference/003-api/001-usage/_001-usage/#react.mdx diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/api-calls/#js.mdx b/docs/docs/reference/003-api/001-usage/_002-api-calls/#js.mdx similarity index 100% rename from docs/docs/reference/003-api/_001-ai-chat/usage/api-calls/#js.mdx rename to docs/docs/reference/003-api/001-usage/_002-api-calls/#js.mdx diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/api-calls/#react.mdx b/docs/docs/reference/003-api/001-usage/_002-api-calls/#react.mdx similarity index 100% rename from docs/docs/reference/003-api/_001-ai-chat/usage/api-calls/#react.mdx rename to docs/docs/reference/003-api/001-usage/_002-api-calls/#react.mdx diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/lifecycle/#js.mdx b/docs/docs/reference/003-api/001-usage/_003-lifecycle/#js.mdx similarity index 100% rename from docs/docs/reference/003-api/_001-ai-chat/usage/lifecycle/#js.mdx rename to docs/docs/reference/003-api/001-usage/_003-lifecycle/#js.mdx diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/lifecycle/#react.mdx b/docs/docs/reference/003-api/001-usage/_003-lifecycle/#react.mdx similarity index 100% rename from docs/docs/reference/003-api/_001-ai-chat/usage/lifecycle/#react.mdx rename to docs/docs/reference/003-api/001-usage/_003-lifecycle/#react.mdx diff --git a/docs/docs/reference/003-api/_001-ai-chat/methods/#react/001-send-message.mdx b/docs/docs/reference/003-api/002-methods/001-send-message.mdx similarity index 88% rename from docs/docs/reference/003-api/_001-ai-chat/methods/#react/001-send-message.mdx rename to docs/docs/reference/003-api/002-methods/001-send-message.mdx index ae146af8..fbf94484 100644 --- a/docs/docs/reference/003-api/_001-ai-chat/methods/#react/001-send-message.mdx +++ b/docs/docs/reference/003-api/002-methods/001-send-message.mdx @@ -1,3 +1,12 @@ +--- +sidebar_label: 'sendMessage(message)' +description: 'Programmatically submit a prompt to the server' +--- + +# `sendMessage(message)` + +--- + > * Method Name: **`sendMessage(message)`** diff --git a/docs/docs/reference/003-api/_001-ai-chat/methods/#react/002-reset-conversation.mdx b/docs/docs/reference/003-api/002-methods/002-reset-conversation.mdx similarity index 84% rename from docs/docs/reference/003-api/_001-ai-chat/methods/#react/002-reset-conversation.mdx rename to docs/docs/reference/003-api/002-methods/002-reset-conversation.mdx index 8903630e..735e4c1d 100644 --- a/docs/docs/reference/003-api/_001-ai-chat/methods/#react/002-reset-conversation.mdx +++ b/docs/docs/reference/003-api/002-methods/002-reset-conversation.mdx @@ -1,3 +1,12 @@ +--- +sidebar_label: 'resetConversation()' +description: 'Programmatically reset the conversation' +--- + +# `resetConversation()` + +--- + > * Method Name: **`resetConversation()`** diff --git a/docs/docs/reference/003-api/002-methods/_category_.json b/docs/docs/reference/003-api/002-methods/_category_.json new file mode 100644 index 00000000..40563733 --- /dev/null +++ b/docs/docs/reference/003-api/002-methods/_category_.json @@ -0,0 +1,9 @@ +{ + "label": "Methods", + "collapsible": true, + "collapsed": true, + "link": { + "type": "generated-index", + "slug": "/reference/api/methods" + } +} diff --git a/docs/docs/reference/003-api/_001-ai-chat/#js.mdx b/docs/docs/reference/003-api/_001-ai-chat/#js.mdx deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/reference/003-api/_001-ai-chat/#react.mdx b/docs/docs/reference/003-api/_001-ai-chat/#react.mdx deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/reference/003-api/_001-ai-chat/methods/#js/001-send-message.mdx b/docs/docs/reference/003-api/_001-ai-chat/methods/#js/001-send-message.mdx deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/reference/003-api/_001-ai-chat/methods/#js/002-reset-conversation.mdx b/docs/docs/reference/003-api/_001-ai-chat/methods/#js/002-reset-conversation.mdx deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/#react.mdx b/docs/docs/reference/003-api/_001-ai-chat/usage/#react.mdx deleted file mode 100644 index a9cbc226..00000000 --- a/docs/docs/reference/003-api/_001-ai-chat/usage/#react.mdx +++ /dev/null @@ -1,14 +0,0 @@ - - ---- - -## API And Component Lifecycle -
-
- -The `AiChatApi` object has a lifecycle that is tied to the `AiChat` component. When the `AiChat` component is -unmounted, the `AiChatApi` object will be destroyed and any subsequent calls to its methods will result in an exception -being thrown. - -In order to prevent this, it is recommended to create the `AiChatApi` object inside the same component that renders the -`AiChat` component, and to not store the `AiChatApi` object in a state variable or a context. diff --git a/docs/docs/reference/003-api/_001-ai-chat/usage/setup/#js.mdx b/docs/docs/reference/003-api/_001-ai-chat/usage/setup/#js.mdx deleted file mode 100644 index e4c48e78..00000000 --- a/docs/docs/reference/003-api/_001-ai-chat/usage/setup/#js.mdx +++ /dev/null @@ -1 +0,0 @@ -( React-only feature — Ref note on top of this page )