Current collected state Current
Observed since 20 Oct, 21:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A simple LLM abstraction layer
A simple LLM abstraction layer for Python applications.
pip install agent1
from agent1 import Message, Agent
# 1. Create a Message
message = Message(
content="What is the capital of France?",
role="user"
)
# 2. Create an Agent
agent = Agent(
instruction="You are a helpful assistant.",
model="gpt-4"
)
# 3. Load an Agent from config file
# agent = Agent.load("config/agent.toml")
# 4. Do work (synchronous)
response = agent.work([message])
print(response.content)
# 5. Stream responses
for chunk in agent.stream([message]):
if hasattr(chunk, 'content'):
print(chunk.content, end='', flush=True)
Create a config file (supports .toml, .json, .yaml, .yml):
# agent.toml
instruction = "You are a helpful assistant that specializes in Python programming."
model = "gpt-4"
temperature = 0.7
Load and use the agent:
from agent1 import Agent, Message
# Load agent from config file
agent = Agent.load("agent.toml")
message = Message(
content="How do I create a list comprehension in Python?",
role="user"
)
response = agent.work([message])
print(response.content)
For non-blocking operations, use async methods:
import asyncio
from agent1 import Agent, Message
async def main():
agent = Agent(
instruction="You are a helpful assistant.",
model="gpt-4"
)
message = Message(
content="Explain quantum computing in simple terms.",
role="user"
)
# Async work
response = await agent.work_async([message])
print(response.content)
# Async streaming
async for chunk in agent.stream_async([message]):
if hasattr(chunk, 'content'):
print(chunk.content, end='', flush=True)
# Run the async function
asyncio.run(main())
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.18 | 2 Mar 2026 | 3 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:fbe140d3be11911b96c43c5328c0dbe9829918d6313b184bfa02b99b217ad9dc