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

Access Ollama API from Dart

example/ollama_example.dart

import 'dart:io';

import 'package:ollama/ollama.dart';

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

  // Generate a response from a model
  final response = ollama.chat([
    ChatMessage(role: 'system', content: 'You are a helpful assistant.'),
    ChatMessage(role: 'user', content: 'How are you?'),
  ], model: 'llama3');

  // Print the response
  response.listen(stdout.write);
}
20
likes
140
pub points
77%
popularity

Publisher

unverified uploader

Access Ollama API from Dart

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

More

Packages that depend on ollama