Skip to content

Commit

Permalink
fix: use correct import path in frontend package README
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed Nov 7, 2024
1 parent 030fc3b commit 1d3e96b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/grafana-llm-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import React, { useState } from 'react';
import { useAsync } from 'react-use';
import { scan } from 'rxjs/operators';

import { llms } from '@grafana/llm';
import { openai } from '@grafana/llm';
import { PluginPage } from '@grafana/runtime';

import { Button, Input, Spinner } from '@grafana/ui';
Expand All @@ -30,17 +30,17 @@ const MyComponent = (): JSX.Element => {
const [reply, setReply] = useState('');

const { loading, error } = useAsync(async () => {
const enabled = await llms.openai.enabled();
const enabled = await openai.enabled();
if (!enabled) {
return false;
}
if (message === '') {
return;
}
// Stream the completions. Each element is the next stream chunk.
const stream = llms.openai
const stream = openai
.streamChatCompletions({
// model: llms.openai.Model.LARGE, // defaults to BASE, use larger model for longer context and complex tasks
// model: openai.Model.LARGE, // defaults to BASE, use larger model for longer context and complex tasks
messages: [
{ role: 'system', content: 'You are a cynical assistant.' },
{ role: 'user', content: message },
Expand Down

0 comments on commit 1d3e96b

Please sign in to comment.