Skip to content

Commit

Permalink
1.4.11 - updates to OpenAI Assistants, streaming functionality and more
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidijusParsiunas committed Feb 10, 2024
1 parent 96ce0e1 commit 4d20fbf
Show file tree
Hide file tree
Showing 16 changed files with 10,394 additions and 10,043 deletions.
20,301 changes: 10,318 additions & 9,983 deletions component/custom-elements.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions component/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deep-chat",
"version": "1.4.10",
"version": "1.4.11",
"description": "Customizable chat component for AI APIs",
"main": "./dist/deepChat.js",
"module": "./dist/deepChat.js",
Expand Down
30 changes: 15 additions & 15 deletions example-servers/nextjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example-servers/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"dependencies": {
"axios": "^1.4.0",
"deep-chat-react": "^1.4.10",
"deep-chat-react": "^1.4.11",
"eventsource-parser": "^1.0.0",
"next": "13.4.9",
"react": "^18.2.0",
Expand Down
14 changes: 7 additions & 7 deletions example-servers/sveltekit/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example-servers/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"type": "module",
"dependencies": {
"deep-chat": "^1.4.10",
"deep-chat": "^1.4.11",
"eventsource-parser": "^1.0.0"
}
}
18 changes: 9 additions & 9 deletions other-packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions other-packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deep-chat-react",
"version": "1.4.10",
"version": "1.4.11",
"description": "Customizable chat component for AI APIs",
"main": "./dist/deepChat.js",
"module": "./dist/deepChat.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
"license": "MIT",
"dependencies": {
"@lit-labs/react": "^1.1.1",
"deep-chat": "1.4.10"
"deep-chat": "1.4.11"
},
"devDependencies": {
"@types/react": "^18.0.28",
Expand Down
5 changes: 3 additions & 2 deletions website/docs/docs/connect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ Configuration for the outgoing network requests to the target server.

### `stream` {#stream}

- Type: `boolean` | {`simulation?: boolean | number`}
- Type: `boolean` | {`simulation?: boolean | number | string`}

Used to stream responses from the target service. <br />
By setting _true_ - the chat will stream incoming [`server-sent events`](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) from
the server. See [`example`](https://deepchat.dev/examples/servers) server code. <br />
The responses are expected to contain partial text, however you can use [`overwrite`](#Response) to overwrite each one. <br />
You can alternatively use the `simulation` object property to facilitate a <b>stream-like</b> experience for any other connection type where the received content wil be
gradually populated in the message bubble. You can also control the millisecond interim of each character's appearance by assigning it a number with the default being _6_. <br />
gradually populated in the message bubble. You can control the millisecond interim of each word's appearance by assigning it a number with the default being _6_.
A string value is used to act like an _end-phrase_ for individual websocket messages that facilitate a stream. <br />

#### Stream Service Example

Expand Down
4 changes: 4 additions & 0 deletions website/docs/docs/directConnection/OpenAI.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,17 @@ If `max_tokens` is not set, the component sets it to _300_ as otherwise the API

- Type: `true` | {<br />
&nbsp;&nbsp;&nbsp;&nbsp; `assistant_id?: string`, <br />
&nbsp;&nbsp;&nbsp;&nbsp; `thread_id?: string`, <br />
&nbsp;&nbsp;&nbsp;&nbsp; `load_thread_history?: boolean`, <br />
&nbsp;&nbsp;&nbsp;&nbsp; [`new_assistant?: NewAssistant`](#NewAssistant), <br />
&nbsp;&nbsp;&nbsp;&nbsp; [`function_handler?: AssistantFunctionHandler`](#assistant-functions) <br />
}

Connect to your Open AI [`assistant`](https://platform.openai.com/docs/assistants/overview).
When set to `true` or the `assistant_id` is not defined, Deep Chat will automatically create a new assistant when the user sends the first message. <br />
`assistant_id` is the id of your assistant. <br />
`thread_id` allows you to communicate in the context of an already existing conversation/[thread](https://platform.openai.com/docs/api-reference/threads). <br />
`load_thread_history` toggles a preload of the previous conversation/[thread](https://platform.openai.com/docs/api-reference/threads) messages on chat is initialisation. <br />
`new_assistant` defines the details for the newly created assistant. <br />
`function_handler` is the actual function used to handle the model's function response. Please navigate to [Assistant Functions](#assistant-functions) for more info. <br />

Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ npm install deep-chat-react
Access the component via CDN:

```
https://unpkg.com/[email protected].10/dist/deepChat.bundle.js
https://unpkg.com/[email protected].11/dist/deepChat.bundle.js
```
4 changes: 2 additions & 2 deletions website/docs/docs/messages/HTML.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ import Tabs from '@theme/Tabs';

Because Deep Chat is a [shadow element](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM) and your html is rendered inside it - the resulting elements will not be able to access the CSS and JavaScript
in your app. To help with this, you can use this object to declare reusable styling and bind your app's functions to the elements via their class names. <br />
`events` is an object that accepts properties with keys that use any of the ones in [GlobalEventHandlersEventMap](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.globaleventhandlerseventmap.html) (same as the string
that you would use for _addEventListener(HERE)_, e.g. _"mousedown"_) and accepts a function as the value. <br />
`events` is an object that accepts properties with keys from [GlobalEventHandlersEventMap](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.globaleventhandlerseventmap.html) (same as the string
used for _addEventListener(HERE)_, e.g. _"mousedown"_) or any custom event name and accepts a function as the value. <br />
`styles` defines the styles applied to the element for different mouse states. <br />

#### Example
Expand Down
30 changes: 15 additions & 15 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mdx-js/react": "^1.6.22",
"active-table-react": "latest",
"clsx": "^1.2.1",
"deep-chat-react": "1.4.10",
"deep-chat-react": "1.4.11",
"deep-chat-web-llm": "^0.0.23",
"highlight.js": "^11.7.0",
"microsoft-cognitiveservices-speech-sdk": "^1.30.1",
Expand Down
13 changes: 12 additions & 1 deletion website/src/pages/playground/serviceModal/serviceModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ const SERVICE_MODAL_FORM_CONFIG = {
},
assistant: {
assistant_id: 'string',
thread_id: 'string',
load_thread_history: ['true', 'false'],
allowMixedFiles: ['true', 'false'],
},
images: {
Expand Down Expand Up @@ -623,6 +625,12 @@ const OPTIONAL_PARAM_TO_LINK = {
websocket: 'https://deepchat.dev/docs/connect#Websocket',
headers: 'https://deepchat.dev/docs/connect#Request',
additionalBodyProps: 'https://deepchat.dev/docs/connect#Request',
allowImages: 'https://deepchat.dev/docs/files#images',
allowCamera: 'https://deepchat.dev/docs/files#camera',
allowGifs: 'https://deepchat.dev/docs/files#gifs',
allowAudio: 'https://deepchat.dev/docs/files#audio',
allowMicrophone: 'https://deepchat.dev/docs/files#microphone',
allowMixedFiles: 'https://deepchat.dev/docs/files/#mixedFiles',
},
webModel: {
model:
Expand All @@ -638,7 +646,10 @@ const OPTIONAL_PARAM_TO_LINK = {
top_p: 'https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p',
},
assistant: {
assistant_id: 'https://platform.openai.com/docs/api-reference/assistants',
assistant_id: 'https://deepchat.dev/docs/directConnection/OpenAI#Assistant',
thread_id: 'https://deepchat.dev/docs/directConnection/OpenAI#Assistant',
load_thread_history: 'https://deepchat.dev/docs/directConnection/OpenAI#Assistant',
allowMixedFiles: 'https://deepchat.dev/docs/files/#mixedFiles',
},
images: {
model: 'https://platform.openai.com/docs/api-reference/images/create#images-create-model',
Expand Down

0 comments on commit 4d20fbf

Please sign in to comment.