Catalog PyPI
Back to packageRELEASE DETAILS

0.2.0

PyPI

agentlego

AgentLego is a versatile tool library for enhancing LLM-based agents.

agentaillmmulti-modality
Published4 Feb 2024
Direct dependencies25
Transitive dependenciesNot calculated

README

Version 0.2.0 documentation

Open in OpenXLab docs PyPI license

English | 简体中文

Introduction

AgentLego is an open-source library of versatile tool APIs to extend and enhance large language model (LLM) based agents, with the following highlight features:

  • Rich set of tools for multimodal extensions of LLM agents including visual perception, image generation and editing, speech processing and visual-language reasoning, etc.
  • Flexible tool interface that allows users to easily extend custom tools with arbitrary types of arguments and outputs.
  • Easy integration with LLM-based agent frameworks like LangChain, Transformers Agents, Lagent.
  • Support tool serving and remote accessing, which is especially useful for tools with heavy ML models (e.g. ViT) or special environment requirements (e.g. GPU and CUDA).

https://github-production-user-asset-6210df.s3.amazonaws.com/26739999/289006700-2140015c-b5e0-4102-bc54-9a1b4e3db9ec.mp4

Quick Starts

Installation

Install the AgentLego package

pip install agentlego

Install tool-specific dependencies

Some tools requires extra packages, please check the readme file of the tool, and confirm all requirements are satisfied.

For example, if we want to use the ImageDescription tool. We need to check the Set up section of readme and install the requirements.

pip install -U openmim
mim install -U mmpretrain

Use tools directly

from agentlego import list_tools, load_tool

print(list_tools())  # list tools in AgentLego

image_caption_tool = load_tool('ImageDescription', device='cuda')
print(image_caption_tool.description)
image = './examples/demo.png'
caption = image_caption_tool(image)

Integrated into agent frameworks

Supported Tools

General ability

Speech related

Image-processing related

  • ImageDescription: Describe the input image.
  • OCR: Recognize the text from a photo.
  • VQA: Answer the question according to the image.
  • HumanBodyPose: Estimate the pose or keypoints of human in an image.
  • HumanFaceLandmark: Estimate the landmark or keypoints of human faces in an image.
  • ImageToCanny: Extract the edge image from an image.
  • ImageToDepth: Generate the depth image of an image.
  • ImageToScribble: Generate a sketch scribble of an image.
  • ObjectDetection: Detect all objects in the image.
  • TextToBbox: Detect specific objects described by the given text in the image.
  • Segment Anything series
    • SegmentAnything: Segment all items in the image.
    • SegmentObject: Segment the certain objects in the image according to the given object name.

AIGC related

Licence

This project is released under the Apache 2.0 license. Users should also ensure compliance with the licenses governing the models used in this project.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 29

Native requirements
25 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
addict
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
addictruntime
func-timeout
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
func-timeoutruntime
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
numpyruntime
openapi-pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
openapi-pydanticruntime
packaging
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
packagingruntime
Pillow
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
Pillowruntime
prompt-toolkit
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
prompt-toolkitruntime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pydantic >=2.0runtime
pyyaml
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pyyamlruntime
requests
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
requestsruntime
rich
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
richruntime
thefuzz
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
thefuzzruntime
tqdm
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
tqdmruntime
typing-extensions
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
typing-extensionsruntime
fastapi
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
fastapi ; extra == 'all'runtime
openai
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
openai ; extra == 'all'runtime
python-multipart
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
python-multipart ; extra == 'all'runtime
sentence-transformers
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
sentence-transformers ; extra == 'all'runtime
torch
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
torch ; extra == 'all'runtime
torchaudio
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
torchaudio ; extra == 'all'runtime
torchvision
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
torchvision ; extra == 'all'runtime
typing-extensions
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
typing-extensions ; extra == 'all'runtime
uvicorn
Environment
{
  "extras": "standard",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
uvicorn[standard] ; extra == 'all'runtime
easyocr
Environment
{
  "extras": "",
  "marker": "extra == 'all'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
easyocr ; extra == 'all'runtime
fastapi
Environment
{
  "extras": "",
  "marker": "extra == 'server'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
fastapi ; extra == 'server'runtime
makefun
Environment
{
  "extras": "",
  "marker": "extra == 'server'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
makefun ; extra == 'server'runtime
python-multipart
Environment
{
  "extras": "",
  "marker": "extra == 'server'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
python-multipart ; extra == 'server'runtime
typer
Environment
{
  "extras": "",
  "marker": "extra == 'server'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
typer >=0.9 ; extra == 'server'runtime
uvicorn
Environment
{
  "extras": "standard",
  "marker": "extra == 'server'",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
uvicorn[standard] ; extra == 'server'runtime

Distribution files

2 collected
agentlego-0.2.0-py3-none-any.whl

bdist_wheel · 105.61 KB · Python py3

Source file
agentlego-0.2.0.tar.gz

sdist · 76.2 KB · Python source

Source file

Repository

PENDING
internlm/agentlego

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:33 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:7dc47dbdebe46c3b2a54eab945f9365966bdd75b7b13aa7db8d4e7be39e95e6c

Other collected versions

View all collected versions →