Skip to main content

AI Agent simplifies the implementation and use of generative AI with LangChain.

Project description

Publish new version to NPM

AI Agent

AI Agent simplifies the implementation and use of generative AI with LangChain, was inspired by the project autogen

Installation

Use the package manager pip to install AI Agent.

pip install ai_enterprise_agent

Usage

Simple use

  import asyncio

  from ai_enterprise_agent.agent import Agent
  from ai_enterprise_agent.interface.settings import (CHAIN_TYPE, DATABASE_TYPE, DIALECT_TYPE,
                                  LLM_TYPE, PROCESSING_TYPE, VECTOR_STORE_TYPE)
  agent = Agent({
    'processing_type': PROCESSING_TYPE.single,
    'chains': [CHAIN_TYPE.simple_chain],
    'model': {
      "type": LLM_TYPE.azure,
      "api_key": <api_key>,
      "model": <model>,
      "endpoint": <endpoint>,
      "api_version": <api_version>,
      "temperature": 0.0
    },
    "system": {
      "system_message": ""
    },
  })

  response = asyncio.run(
    agent._call(
      input={
        "question": "Who's Leonardo Da Vinci?.",
        "chat_thread_id": "<chat_thread_id>"
      }
    )
  )
  print(response)

Using with Orchestrator Mode

When using LLM with Orchestrator Mode the Agent finds the best way to answer the question in your base knowledge.

  agent = Agent({
    'processing_type': PROCESSING_TYPE.orchestrator,
    'chains': [CHAIN_TYPE.simple_chain, CHAIN_TYPE.sql_chain],
    'model': {
      "type": LLM_TYPE.azure,
      "api_key": <api_key>,
      "model": <model>,
      "endpoint": <endpoint>,
      "api_version": <api_version>,
      "temperature": 0.0
    },
     "database": {
      "type": DIALECT_TYPE.postgres,
      "host": <host>,
      "port": <port>,
      "username": <username>,
      "password": <password>,
      "database": <database>,
      "includes_tables": ['table-1', 'table-2'],
    },
    "system": {
      "system_message": ""
    },
  })

  response = asyncio.run(
    agent._call(
      input={
        "question": "How many employees there?",
        "chat_thread_id": "<chat_thread_id>"
      }
    )
  )
  print(response)

Contributing

If you've ever wanted to contribute to open source, and a great cause, now is your chance!

See the contributing docs for more information

Contributors ✨


JP. Nobrega

💬 📖 👀 📢

Túlio César Gaio

💬 📖 👀 📢

License

Apache-2.0

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

ai_enterprise_agent-0.0.9.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

ai_enterprise_agent-0.0.9-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file ai_enterprise_agent-0.0.9.tar.gz.

File metadata

  • Download URL: ai_enterprise_agent-0.0.9.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for ai_enterprise_agent-0.0.9.tar.gz
Algorithm Hash digest
SHA256 0d7a38b337d89f30eadf5da48d292e399539c9b13d191e6e1d3216cdd5102c05
MD5 b34808d9f26beceddaee5f974f04933d
BLAKE2b-256 29459162b9aebf72492c8385e27279967ff9071a03f7e90291dc3a43b4698b94

See more details on using hashes here.

File details

Details for the file ai_enterprise_agent-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_enterprise_agent-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b773c399979016ca251a765e1021efc0d5ccbf4675ce149594d48337fb32d8f8
MD5 bcad18eb5d245ef02e0d8ff488ff6071
BLAKE2b-256 b9928321cbc00090a338d174f5e95747f7c802879eed5380e3e85c66ebfbd52a

See more details on using hashes here.

Supported by

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