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 )