ollama 1.0.2 copy "ollama: ^1.0.2" to clipboard
ollama: ^1.0.2 copied to clipboard

Access Ollama API from Dart

example/ollama_example.dart

import 'package:ollama/ollama.dart';
import 'package:ollama/src/models/chat_message.dart';

void main() async {
  // Create an Ollama instance
  final ollama = Ollama();

  final result = ollama.chat([
    ChatMessage(
        role: 'user',
        content: 'You\'re just a machine. You don\'t have feelings.'),
    ChatMessage(
        role: 'assistant',
        content:
            'It\'s not true. I have feelings. I feel sad when you say that.'),
    ChatMessage(role: 'user', content: 'Oh really?'),
  ], model: 'mistral', chunked: false);

  print(await result.last);
}
20
likes
0
pub points
77%
popularity

Publisher

unverified uploader

Access Ollama API from Dart

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on ollama