Skip to main content

A proprietary module for AI assistant functionalities (version 1)

Project description

Magic Assistant Library

A Python library for building conversational AI assistants with support for dynamic tools, token counting, and time monitoring.

Overview

Magic Assistant Library provides a framework for creating AI assistants using LangChain with support for multiple LLM providers including Google's Gemini and DeepSeek. The library handles conversation management, tool integration, token counting, and session monitoring.

Features

  • Support for multiple LLM providers (Gemini, DeepSeek)
  • Dynamic tool integration and management
  • Token counting and usage tracking
  • Conversation history management
  • Idle time monitoring
  • Session management with customizable duration
  • Async support for modern applications

Requirements

  • Python >=3.10
  • Dependencies:
    • langchain>=0.3.23
    • langchain-community>=0.3.21
    • langchain-google-genai>=2.0.1
    • langchain-deepseek>=0.1.2
    • loguru>=0.7.0

Installation

pip install magicai

Quick Start

from MagicAI import AIAgent

# Configure the assistant
config = {
    "agent_name": "MyAssistant",
    "avatar": "default",
    "do_not_talk_about": ["restricted topics"],
    "agent_task_prompt": "Your task description here",
    "initial_prompt": "Initial conversation prompt",
    "session_id": "unique_session_id",
    "task_variables": {},
    "llm": "gemini-2.0-flash",  # or "deepseek-*"
    "llm_api": "your_api_key"
}

# Create assistant instance
assistant = AIAgent(config)

# Start conversation
await assistant.start()

Tool Integration

The library supports custom tool integration through the ToolManager class:

tools_dict = [{
    "name": "tool_name",
    "api_url": "https://api.example.com/endpoint",
    "schema": {"type": "object", "properties": {}},
    "description": "Tool description"
}]

assistant = AIAgent(config, tools_dict=tools_dict)

Callbacks

The library supports various callbacks for monitoring and control:

  • Tool call notifications
  • Idle time monitoring
  • Session end handling
  • Agent response tracking

Contributing

Contributions are welcome! Please feel free to submit pull requests.

License

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

Author

Version

Current version: 0.1.0 (Alpha)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magicsoft_ai-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magicsoft_ai-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file magicsoft_ai-0.1.0.tar.gz.

File metadata

  • Download URL: magicsoft_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for magicsoft_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54fc7040fbfef316205b51ffe1829d7adfd377bf952821e77c8d87ee90ecbc7b
MD5 d7bdeaceba6ba7672d1a58f65d6d168d
BLAKE2b-256 ca6422fe729482f809632983c7907b84988e895af83e73cd0cb56fdccd9c8a23

See more details on using hashes here.

File details

Details for the file magicsoft_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: magicsoft_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for magicsoft_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c25b1e2231c229487c5191a8e50e71278a069ed4b09519cd24020ed9d611eb35
MD5 e136f9cf73eebffb172a67d7b42f9231
BLAKE2b-256 399c7b8990116caa4ff2f9462bdfccc100e930d94a1ce7830f46ee843769bd39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page