Skip to content

[GenAI Application Development Framework] πŸš€ Build GenAI application quick and easy πŸ’¬ Easy to interact with GenAI agent in code using structure data and chained-calls syntax 🧩 Use Agently Workflow to manage complex GenAI working logic πŸ”€ Switch to any model without rewrite application code

License

Notifications You must be signed in to change notification settings

AgentEra/Agently

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image

Agently 4 (v4.0.0.Beta1)

English Introduction | 中文介绍

Speed Up Your GenAI Application Development

license PyPI - Downloads GitHub star chart Twitter WeChat

Discussions Contribute Issues

Getting Started

Agently is a Python-based framework for building GenAI applications. You can install it via pip and import features using from agently import Agently.

Install via pip:

pip install agently==4.0.0b1

⚠️: Version specifier is required during beta testing.

Clone the repository and install locally:

git clone git@github.com:AgentEra/Agently.git
cd Agently
pip install -e .

What is Agently?

Agently aims to provide an intuitive, efficient, and developer-friendly framework for GenAI application development. By deeply understanding the runtime control needs of model outputs, Agently bridges the gap between large language models and real-world applications.

Agently abstracts away the complexities of:

  • Varying model parameters
  • Output formatting
  • Communication between engineering modules and GenAI logic

...while giving developers full control over business logic and integration with existing systems.

We believe GenAI is not a generational replacement for current systems but a powerful extension. Engineers and tools are key to turning GenAI's possibilities into reality.

Our mission is to build the best developer experience (DX) for GenAI application engineers.

Core Features Overview

Structured and Streamed Output Control for LLMs

Agently allows you to control and consume model outputs using a developer-centric pattern:

from agently import Agently

agent = Agently.create_agent()

(
    agent
        .input("What time is it now?", always=True)
        .info({
            "default_timezone": "",
            "tool_list": [{
                "name": "get_current_time",
                "desc": "Get current time by time zone provided",
                "kwargs": {
                    "timezone_str": (str, "time zone string in ZoneInfo()"),
                },
            }]
        })
        .output({
            "first_time_response": (str, ),
            "tool_using_judgement": (bool, ),
            "tool_using_command": (
                {
                    "name": (str, "Decide which tool to use by tool name:{tool_list.[].name}"),
                    "kwargs": (dict, "According {tool_list.[].args} to output kwargs dictionary"),
                },
                "If {tool_using_judgement}==False, just output {}",
            ),
        })
)

Then, consume the model response:

response = agent.get_response()

# Get raw output
response_text = response.get_text()

# Get parsed structured result
response_dict = response.get_result()

# Streamed output
for delta in response.get_generator(content="delta"):
    print(delta, end="", flush=True)

Or use the instant parsing mode:

instant_response_generator = response.get_generator(content="instant")

use_tool = False

for instant_message in instant_response_generator:
    if instant_message.path == "first_time_response":
        if instant_message.delta is not None:
            print(instant_message.delta, end="", flush=True)
    elif instant_message.path == "tool_using_judgement":
        use_tool = instant_message.value
        print()
        if use_tool:
            print("[USE TOOL!]")
        else:
            print("[NO NEED TO USE TOOL!]")
    if use_tool:
        if instant_message.path == "tool_using_command.name" and instant_message.is_complete:
            print(f"I want to use: '{ instant_message.value }'")
        elif instant_message.path == "tool_using_command":
            print(f"call: { instant_message.value }")
            print(f"kwargs: { instant_message.value }")
I can check the current time for you. Please specify a timezone (e.g., 'America/New_York') so I can provide the accurate time.
[NO NEED TO USE TOOL!]

[More documentation coming soon...]

πŸ’¬ WeChat Group (Join Us)

Click Here to Apply or Scan the QR Code Below:

WeChat QR

About

[GenAI Application Development Framework] πŸš€ Build GenAI application quick and easy πŸ’¬ Easy to interact with GenAI agent in code using structure data and chained-calls syntax 🧩 Use Agently Workflow to manage complex GenAI working logic πŸ”€ Switch to any model without rewrite application code

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 19

Languages