Skip to main content

Make class instantiation easy with auto-imports

Project description

AINI

aini

Make AI class initialization easy with auto-imports.

Installation

pip install aini

Usage

Autogen

Use DeepSeek as the model for the assistant agent.

from aini import aini, aview

# Load assistant agent with DeepSeek as its model - requires DEEPSEEK_API_KEY
client = aini('autogen/client', model=aini('autogen/llm', 'ds'))
agent = aini('autogen/assistant', name='deepseek', model_client=client)

# Run the agent
ans = await agent.run(task='What is your name')

# Display result structure
aview(ans)
[Output]
<autogen_agentchat.base._task.TaskResult>
{
  'messages': [
    {'source': 'user', 'content': 'What is your name', 'type': 'TextMessage'},
    {
      'source': 'ds',
      'models_usage <autogen_core.models._types.RequestUsage>': {
        'prompt_tokens': 32,
        'completion_tokens': 17
      },
      'content': 'My name is DeepSeek Chat! 😊 How can I assist you today?',
      'type': 'TextMessage'
    }
  ]
}

# Display agent structure with private keys included
aview(agent._model_context, inc_=True, max_depth=5)
[Output]
<autogen_core.model_context._unbounded_chat_completion_context.UnboundedChatCompletionContext>
{
  '_messages': [
    {'content': 'What is your name', 'source': 'user', 'type': 'UserMessage'},
    {
      'content': 'My name is DeepSeek Chat! 😊 How can I assist you today?',
      'source': 'ds',
      'type': 'AssistantMessage'
    }
  ]
}

Agno

# Load an agent with tools from configuration files
agent = aini('agno/agent', tools=[aini('agno/tools', 'google')])

# Run the agent
ans = agent.run('Compare MCP and A2A')

# Display component structure with filtering
aview(ans, exclude_keys=['metrics'])
[Output]
<agno.run.response.RunResponse>
{
  'content': "Here's a comparison between **MCP** and **A2A**: ...",
  'content_type': 'str',
  'event': 'RunResponse',
  'messages': [
    {
      'role': 'user',
      'content': 'Compare MCP and A2A',
      'add_to_agent_memory': True,
      'created_at': 1746758165
    },
    {
      'role': 'assistant',
      'tool_calls': [
        {
          'id': 'call_0_21871e19-3de7-4a8a-9275-9b4128fb743c',
          'function': {
            'arguments': '{"query":"MCP vs A2A comparison","max_results":5}',
            'name': 'google_search'
          },
          'type': 'function'
        }
      ]
    }
  ]
  ...
}

# Export to YAML for debugging
aview(ans, to_file='debug/output.yaml')

Mem0

memory = aini('mem0/mem0', 'mem0')

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

aini-0.1.9.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

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

aini-0.1.9-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file aini-0.1.9.tar.gz.

File metadata

  • Download URL: aini-0.1.9.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aini-0.1.9.tar.gz
Algorithm Hash digest
SHA256 733d38f3c7cc25159a1e16af094a49167e083398b562b7de2fca2153fb560171
MD5 3296ad022c0c5eec8ce1fd0270e29ed6
BLAKE2b-256 79b7f56f7c2abc051db47d2f58660a981405664d90d11ef18135c3d381d751b9

See more details on using hashes here.

File details

Details for the file aini-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: aini-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aini-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 daf31b25660afa9b2cf80446e294dfd20b5fd330e4aa1cf33b5389d331a4e2d8
MD5 79963bafad6effa25d8f6fd0ebb3e3d0
BLAKE2b-256 88215d75fdd4549bd4c60123768c3cfa49a23e21069a08507585ce1468d59c07

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