langchain 0.6.0+1 copy "langchain: ^0.6.0+1" to clipboard
langchain: ^0.6.0+1 copied to clipboard

Build powerful LLM-based Dart and Flutter applications with LangChain.dart.

example/langchain_example.dart

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

void main() async {
  final promptTemplate = PromptTemplate.fromTemplate(
    'tell me a joke about {subject}',
  );
  final llm = FakeLLM(
    responses: ['Why did the AI go on a diet? Because it had too many bytes!'],
  );
  final chain = promptTemplate.pipe(llm).pipe(const StringOutputParser());
  final result = await chain.invoke({'subject': 'AI'});
  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 and Flutter applications with LangChain.dart.

Homepage
Repository (GitHub)
View/report issues

Topics

#ai #nlp #llms #langchain

Documentation

Documentation

License

unknown (license)

Dependencies

characters, collection, crypto, langchain_core, meta, uuid

More

Packages that depend on langchain