Catalog PyPI
Back to packageRELEASE DETAILS

0.1.2

PyPI

AgenticWrapper

A lightweight Python framework for adding agent capabilities (tools calling, memory, structured outputs) to single custom LLM functions

agentaiframeworkllmwrapper
Published25 May 2025
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.1.2 documentation

AgenticWrapper

English | 简体中文

AgenticWrapper is an extremely lightweight Python Agent framework that wraps your custom LLM function, enabling it with Agent capabilities, including tool calling, memory management, and structured output.

AgenticWrapper has no runtime dependencies.

Quick Start

Installation

pip install AgenticWrapper

Basic Usage

from AgenticWrapper import Agent

async def llm_func(messages: list[dict[str, str]]) -> str:
    # Assume this is your custom LLM function
    return "Hello, I'm AgenticWrapper."

agent = Agent(llm_func)
response = await agent.query("Hello")
print(response)
agent.clear_memory()

Structured Output

Use Python dataclass to define the output structure:

@dataclass
class SearchResult:
    query: str
    results: List[str]
    total_count: int

response = await agent.query("Search for relevant content", structured_output_type=SearchResult)
assert isinstance(response, SearchResult)

Tool Calling

Define a tool function, preferably with function documentation:

async def get_weather(location: str) -> str:
    """Get weather information"""
    # Simulate an API call
    await asyncio.sleep(0.1)
    if location.lower() == "london":
        return "The weather is clear, with a temperature of 15°C."
    elif location.lower() == "paris":
        return "The weather is clear, with a temperature of 18°C."
    else:
        return f"I don't know the weather for {location}."

Use the tool in the Agent:

agent = Agent(llm_interaction_func=mock_llm_func, tools=[get_weather])
response = await agent.query("Check the weather in london")
print(response)

Tool function parameters types must be valid json types, return types must be str.

More Examples

More examples can be found in example.py.

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

2 collected
agenticwrapper-0.1.2-py3-none-any.whl

bdist_wheel · 7.36 KB · Python py3

Source file
agenticwrapper-0.1.2.tar.gz

sdist · 6.9 KB · Python source

Source file

Repository

PENDING
lxl66566/agenticwrapper

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:25 UTC

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

Record identity

package_version:18b7c349a8f789c4ea7caaed6a6a92079f7b44007994c4fb4e722668df7db2a0

Other collected versions

View all collected versions →