langchain 0.0.1-dev.4 copy "langchain: ^0.0.1-dev.4" to clipboard
langchain: ^0.0.1-dev.4 copied to clipboard

Build powerful LLM-based Dart/Flutter applications.

example/langchain_example.dart

// ignore_for_file: avoid_print
import 'package:langchain/langchain.dart';

void main() async {
  final llm = FakeListLLM(
    responses: ['Why did the AI go on a diet? Because it had too many bytes!'],
  );
  final promptTemplate = PromptTemplate.fromTemplate(
    'tell me a joke about {subject}',
  );
  final prompt = promptTemplate.format({'subject': 'AI'});
  final result = await llm(prompt);
  print(result);
  // Why did the AI go on a diet? Because it had too many bytes!
}
196
likes
0
pub points
92%
popularity

Publisher

verified publisherlangchaindart.dev

Build powerful LLM-based Dart/Flutter applications.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

collection, cross_file, meta

More

Packages that depend on langchain