GithubHelp home page GithubHelp logo

jbexta / lionagi-ap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lion-agi/lionagi

0.0 0.0 0.0 7.99 MB

Towards Automated General Intelligence.

License: Apache License 2.0

Python 56.31% Jupyter Notebook 43.69%

lionagi-ap's Introduction

PyPI - Version PyPI - Downloads

PyPI | Documentation | Discord

LionAGI

Powerful Intelligent Workflow Automation

LionAGI is an intelligent agent framework. Tailored for big data analysis in conjunction with advanced machine learning tools, designed for data-centric, production-level projects. Lionagi provides a set of robust tools, enabling flexible and rapid design of agentic workflow, for your own data.

Why Automating Workflows?

Intelligent AI models such as Large Language Model (LLM), introduced new possibilities of human-computer interaction. LLMs is drawing a lot of attention worldwide due to its “one model fits all”, and incredible performance. One way of using LLM is to use as search engine, however, this usage is complicated by the fact that LLMs hallucinate.

What goes inside of a LLM is more akin to a black-box, lacking interpretability, meaning we don’t know how it reaches certain answer or conclusion, thus we cannot fully trust/rely the output from such a system.

ReAct flow

Another approach of using LLM is to treat them as intelligent agent, that are equipped with various tools and data sources. A workflow conducted by such an intelligent agent have clear steps, and we can specify, observe, evaluate and optimize the logic for each decision that the agent made to perform actions. This approach, though we still cannot pinpoint how LLM output what it outputs, but the flow itself is explainable.

LionAGI agent can manage and direct other agents, can also use multiple different tools in parallel.

parallel agents

Install LionAGI with pip:

pip install lionagi

Download the .env_template file, input your appropriate API_KEY, save the file, rename as .env and put in your project's root directory. by default we use OPENAI_API_KEY.

Quick Start

The following example shows how to use LionAGI's Session object to interact with gpt-4-turbo model:

# define system messages, context and user instruction
system = "You are a helpful assistant designed to perform calculations."
instruction = {"Addition":"Add the two numbers together i.e. x+y"}
context = {"x": 10, "y": 5}
# in interactive environment (.ipynb for example)
import lionagi as li

calculator = li.Session(system=system)
result = await calculator.chat(
  instruction=instruction, context=context, model="gpt-4-turbo-preview"
)

print(f"Calculation Result: {result}")
# or otherwise, you can use
import asyncio
from dotenv import load_dotenv

load_dotenv()

import lionagi as li

async def main():
    calculator = li.Session(system=system)
    result = await calculator.chat(
      instruction=instruction, context=context, model="gpt-4-turbo-preview"
    )
    print(f"Calculation Result: {result}")

if __name__ == "__main__":
    asyncio.run(main())

Visit our notebooks for examples.

LionAGI is designed to be asynchronous only, please check python official documentation on how async work: here


Notice:

  • calling API with maximum throughput over large set of data with advanced models i.e. gpt-4 can get EXPENSIVE IN JUST SECONDS,
  • please know what you are doing, and check the usage on OpenAI regularly
  • default rate limits are set to be 1,000 requests, 100,000 tokens per miniute, please check the OpenAI usage limit documentation you can modify token rate parameters to fit different use cases.
  • if you would like to build from source, please download the latest release,

Community

We encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community members Join Our Discord

Citation

When referencing LionAGI in your projects or research, please cite:

@software{Li_LionAGI_2023,
  author = {Haiyang Li},
  month = {12},
  year = {2023},
  title = {LionAGI: Towards Automated General Intelligence},
  url = {https://github.com/lion-agi/lionagi},
}

Requirements

Python 3.10 or higher.

lionagi-ap's People

Contributors

ohdearquant avatar alina-luo avatar adamjhn avatar topherf22 avatar karandeeps18 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.