Skip to content

AGiXT/dart-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub PayPal Ko-Fi

AGiXT SDK for Dart

GitHub GitHub GitHub GitHub

GitHub pypi

GitHub npm

GitHub

Discord Twitter

AGiXT_New

This repository is for the AGiXT SDK for Dart.

More Documentation

Want to know more about AGiXT? Check out our documentation or GitHub page.

AGiXT SDK Documentation

Overview

The AGiXT SDK is a Dart library that provides a comprehensive set of APIs for interacting with the AGiXT platform. The SDK allows developers to create agents, manage conversations, execute commands, handle authentication, and utilize various AI capabilities including text generation, image generation, and speech processing.

Getting Started

To use the AGiXT SDK, you need to import the library and create an instance of the AGiXTSDK class:

import 'agixt.dart';

void main() {
  final agixtSDK = AGiXTSDK(
    baseUri: 'http://localhost:7437',
    apiKey: 'YOUR_API_KEY',
  );
}

Authentication

  • login(String email, String otp): Log in with email and OTP
  • registerUser(String email, String firstName, String lastName): Register a new user
  • userExists(String email): Check if a user exists
  • updateUser(Map<String, dynamic> userData): Update user details
  • getUser(): Get current user details
  • oauth2Login(String provider, String code, {String? referrer}): OAuth2 authentication

Agents

  • getAgents(): Retrieves a list of all agents
  • getAgentConfig(String agentName): Retrieves agent configuration
  • addAgent(String agentName, {Map settings, Map commands, List trainingUrls}): Creates a new agent
  • updateAgentSettings(String agentName, Map settings): Updates agent settings
  • deleteAgent(String agentName): Deletes an agent
  • getPersona(String agentName): Get agent's persona
  • updatePersona(String agentName, String persona): Update agent's persona

Conversations

  • getConversations(): Get all conversations
  • getConversationsWithIds(): Get conversations with their IDs
  • getConversation(String agentName, String conversationName): Get specific conversation
  • newConversation(String agentName, String conversationName): Create new conversation
  • deleteConversation(String agentName, String conversationName): Delete conversation
  • forkConversation(String conversationName, String messageId): Fork a conversation
  • updateConversationMessageById(String messageId, String newMessage, String conversationName): Update message by ID
  • deleteConversationMessageById(String messageId, String conversationName): Delete message by ID

AI Capabilities

  • generateImage(String prompt, {String model, int n, String size, String responseFormat}): Generate images
  • transcribeAudio(String file, String model, {String? language, String? prompt}): Transcribe audio to text
  • translateAudio(String file, String model, {String? prompt}): Translate audio
  • textToSpeech(String agentName, String text): Convert text to speech

Learning & Memory

  • learnText(String agentName, String userInput, String text): Learn from text
  • learnUrl(String agentName, String url): Learn from URL
  • learnFile(String agentName, String fileName, String fileContent): Learn from file
  • learnGithubRepo(String agentName, String githubRepo): Learn from GitHub repository
  • learnArxiv({String agentName, String? query, String? arxivIds}): Learn from arXiv papers
  • getAgentMemories(String agentName, String userInput): Get agent memories
  • exportAgentMemories(String agentName): Export memories
  • importAgentMemories(String agentName, List<Map> memories): Import memories
  • getUniqueExternalSources(String agentName): Get unique external sources

Commands & Extensions

  • getCommands(String agentName): Get available commands
  • executeCommand(String agentName, String commandName, Map commandArgs): Execute command
  • getExtensions(): Get all extensions
  • getExtensionSettings(): Get extension settings
  • createExtension(String agentName, String extensionName, String openapiJsonUrl): Create new extension

Chains & Prompts

  • getChains(): Get all chains
  • runChain({String chainName, String userInput, String agentName}): Run a chain
  • getPrompts({String promptCategory}): Get prompts
  • addPrompt(String promptName, String prompt): Add new prompt
  • updatePrompt(String promptName, String prompt): Update prompt

Training

  • createDataset(String agentName, String datasetName): Create training dataset
  • train({String agentName, String datasetName, String model}): Train on dataset

Error Handling

The SDK includes comprehensive error handling:

dynamic handleError(dynamic error) {
  print("Error: $error");
  throw Exception("Unable to retrieve data. $error");
}

All API methods are asynchronous and return Futures. Use try-catch blocks for proper error handling:

try {
  final agents = await agixtSDK.getAgents();
  print(agents);
} catch (e) {
  print('Error: $e');
}

About

Dart SDK for AGiXT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages