ollama 1.0.1 copy "ollama: ^1.0.1" to clipboard
ollama: ^1.0.1 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.generate('Tell me about llamas', model: 'llama2');

  // Print the response
  await for (final chunk in response) {
    stdout.write(chunk.text);
  }
}
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