Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function MyComponent() {
```tsx
const handleGenerate = async () => {
const chat = [
{ role: 'system', content: 'You are a helpful assistant' }
{ role: 'system', content: 'You are a helpful assistant' },
{ role: 'user', content: 'What is the meaning of life?' }
];

Expand Down
12 changes: 9 additions & 3 deletions docs/docs/natural-language-processing/useLLM.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const llm = useLLM({

const handleGenerate = async () => {
const chat = [
{ role: 'system' content: 'You are a helpful assistant' },
{ role: 'system', content: 'You are a helpful assistant' },
{ role: 'user', content: 'Hi!' },
{ role: 'assistant', content: 'Hi!, how can I help you?'},
{ role: 'user', content: 'What is the meaning of life?' },
Expand Down Expand Up @@ -230,8 +230,14 @@ const llm = useLLM({

const handleGenerate = async () => {
const chat = [
{ role: 'system' content: `You are a helpful assistant. Current time and date: ${new Date().toString()}` }
{ role: 'user', content: `Hi, what's the weather like in Cracow right now?` }
{
role: 'system',
content: `You are a helpful assistant. Current time and date: ${new Date().toString()}`,
},
{
role: 'user',
content: `Hi, what's the weather like in Cracow right now?`,
},
];

// Chat completion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const llm = useLLM({

const handleGenerate = async () => {
const chat = [
{ role: 'system' content: 'You are a helpful assistant' },
{ role: 'system', content: 'You are a helpful assistant' },
{ role: 'user', content: 'Hi!' },
{ role: 'assistant', content: 'Hi!, how can I help you?'},
{ role: 'user', content: 'What is the meaning of life?' },
Expand Down Expand Up @@ -230,8 +230,14 @@ const llm = useLLM({

const handleGenerate = async () => {
const chat = [
{ role: 'system' content: `You are a helpful assistant. Current time and date: ${new Date().toString()}` }
{ role: 'user', content: `Hi, what's the weather like in Cracow right now?` }
{
role: 'system',
content: `You are a helpful assistant. Current time and date: ${new Date().toString()}`,
},
{
role: 'user',
content: `Hi, what's the weather like in Cracow right now?`,
},
];

// Chat completion
Expand Down