Skip to content

Commit 2ca0ca2

Browse files
committed
docs: Fix example
1 parent e16eeb0 commit 2ca0ca2

File tree

2 files changed

+16
-93
lines changed

2 files changed

+16
-93
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ The plugin is incredibly straightforward to use and is [**available on npm**](ht
6767
start: {
6868
message: "What would you like to find out today?",
6969
transition: 0,
70-
path: "llm_example_block",
70+
path: "llm_example_block",
7171
},
7272
llm_example_block: {
7373
llmConnector: {
74-
provider: new WebLlmProvider({
75-
model: 'Qwen2-0.5B-Instruct-q4f16_1-MLC',
76-
}),
77-
}
74+
provider: new WebLlmProvider({
75+
model: 'Qwen2-0.5B-Instruct-q4f16_1-MLC',
76+
}),
77+
}
7878
} as LlmConnectorBlock,
7979
// ... other blocks as necessary
8080
}
@@ -194,7 +194,7 @@ Within the `llmConnector` attribute, there is a `stopConditions` property that a
194194

195195
```javascript
196196
import ChatBot from "react-chatbotify";
197-
import llmConnector, { LlmConnectorBlock, BrowserProvider } from "@rcb-plugins/llm-connector";
197+
import LlmConnector, { LlmConnectorBlock, OpenaiProvider } from "@rcb-plugins/llm-connector";
198198

199199
const MyComponent = () => {
200200
const flow = {
@@ -206,10 +206,10 @@ const MyComponent = () => {
206206
llm_example_block: {
207207
llmConnector: {
208208
provider: new OpenaiProvider({
209-
mode: 'direct',
210-
model: 'gpt-4.1-nano',
211-
responseFormat: 'stream',
212-
apiKey: // openai api key here,
209+
mode: 'direct',
210+
model: 'gpt-4.1-nano',
211+
responseFormat: 'stream',
212+
apiKey: // openai api key here,
213213
}),
214214
stopConditions: {
215215
onUserMessage: (message: Message) => {
@@ -221,11 +221,11 @@ const MyComponent = () => {
221221
}
222222
},
223223
onKeyDown: (event: KeyboardEvent) => {
224-
if (event.key === 'Escape') {
225-
return 'start';
226-
}
227-
return null;
228-
},
224+
if (event.key === 'Escape') {
225+
return 'start';
226+
}
227+
return null;
228+
},
229229
},
230230
},
231231
} as LlmConnectorBlock,
@@ -239,7 +239,7 @@ const MyComponent = () => {
239239
};
240240

241241
return (
242-
<ChatBot plugins={[llmConnectorProvider()]}/>
242+
<ChatBot plugins={[LlmConnector()]}/>
243243
)
244244
}
245245
```

types/global.d.ts

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)