Installation
Add the following dependencies to yourpubspec.yaml file:
Configuration
Get your API key from the Google AI Studio or your preferred LLM provider. Run your app with the API key:gemini.dart
sample.
Using Other LLM Providers
dartantic_ai supports multiple providers. Set the appropriate API key and configure the Agent:Device Permissions
To enable your users to take advantage of features like voice input and media attachments, ensure that your app has the necessary permissions:Network Access
On macOS, add the following to your*.entitlements files:
AndroidManifest.xml contains:
Clipboard Access
To enable copying and pasting images and other custom data to and from the Android clipboard, add the following content provider to yourAndroidManifest.xml inside the <application> tag:
<your-package-name> with your actual package name (e.g.,
com.example.myapp).
Other Permissions
- Microphone access: To enable voice input, update configs according to the
permission and setup
instructions
for
package:record. - File selection: To enable file attachments, follow the usage
instructions for
package:file_selector. - Image selection: To enable taking or selecting pictures, refer to the
installation
instructions for
package:image_picker.
Running Examples
Provide your API key via--dart-define:

