dartantic_ai 1.0.0 copy "dartantic_ai: ^1.0.0" to clipboard
dartantic_ai: ^1.0.0 copied to clipboard

Dartantic is an agentic framework designed to make building client and server-side apps in Dart with generative AI easier and more fun!

Welcome to Dartantic! #

The dartantic_ai package provides an agent framework designed to make building client and server-side apps in Dart with generative AI easier and more fun!

Key Features #

  • Agentic behavior with multi-step tool calling: Let your AI agents autonomously chain tool calls together to solve multi-step problems without human intervention.
  • Multiple Providers Out of the Box - OpenAI, Google, Anthropic, Mistral, Cohere, Ollama, and more
  • Streaming Output - Real-time response generation
  • Typed Outputs and Tool Calling - Uses Dart types and JSON serialization
  • Multimedia Input - Process text, images, and files
  • Embeddings - Vector generation and semantic search
  • MCP Support - Model Context Protocol server integration
  • Provider Switching - Switch between AI providers mid-conversation
  • Production Ready: Built-in logging, error handling, and retry handling
  • Extensible: Easy to add custom providers as well as tools of your own or from your favorite MCP servers

Quick Start #

import 'package:dartantic_ai/dartantic_ai.dart';

void main() async {
  // Create an agent with your preferred provider
  final agent = Agent(
    'openai',  // or 'google', 'anthropic', 'ollama', etc.
    history: [ChatMessage.system('You are a helpful assistant.')],
  );

  // Generate text
  final result = await agent.send('Explain quantum computing in simple terms');
  print(result.output);

  // Use typed outputs
  final location = await agent.sendFor<TownAndCountry>(
    'The windy city in the US',
    outputSchema: JsonSchema.create({
      'type': 'object',
      'properties': {
        'town': {'type': 'string'},
        'country': {'type': 'string'},
      },
      'required': ['town', 'country'],
    }),
    outputFromJson: TownAndCountry.fromJson,
  );
  print('${location.output.town}, ${location.output.country}');
}

Documentation #

Read the full documentation at docs.dartantic.ai

The documentation includes:

  • Getting Started Guide - Installation and basic usage
  • Core Features - JSON output, typed responses, and streaming
  • Advanced Features - Tool calling, agentic behavior, and embeddings
  • Integration - Logging, MCP servers, and custom providers
  • Provider Reference - Detailed info on all supported providers
  • Examples - Complete working examples for every feature

Installation #

Add to your pubspec.yaml:

dependencies:
  dartantic_ai: ^VERSION

Contributing & Community #

Welcome contributions! Feature requests, bug reports and PRs are welcome on the dartantic_ai github site.

Want to chat about Dartantic? Drop by the Discussions forum.

License #

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ for the Dart & Flutter community

34
likes
0
points
768
downloads

Publisher

verified publishersellsbrothers.com

Weekly Downloads

Dartantic is an agentic framework designed to make building client and server-side apps in Dart with generative AI easier and more fun!

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

anthropic_sdk_dart, collection, dartantic_interface, google_generative_ai, html, http, json_schema, logging, mcp_dart, meta, mistralai_dart, ollama_dart, openai_dart, rxdart, uuid

More

Packages that depend on dartantic_ai