Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct import path in frontend package README #482

Merged
merged 1 commit into from
Nov 8, 2024
Merged
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
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
Loading