🚀 Nbagents Summary
What We Added
✨ Async Support
- Full async/await support for both tools and LLM calls
run_async()method for async executionis_async_function()utility to detect async functionsrun_sync_or_async()utility to handle both sync and async functions seamlessly
🔧 Built-in Tools
- Web Search: Search the web using DuckDuckGo API (both sync and async versions)
- File Operations:
read_file: Read content from fileswrite_file: Write content to fileslist_files: List files in directories
- Time:
get_current_time- Get current date and time - Auto-registration of built-in tools (can be disabled with
include_builtin_tools=False)
📋 Comprehensive Logging
setup_logger()function for easy logger configuration- Agent-specific loggers with configurable log levels
- Debug logging for tool execution and iterations
- Info/Warning/Error logging for key events
- Tool registration and execution logging
🔄 Enhanced Error Handling
- Better retry mechanisms for both LLM calls and tool execution
- Graceful error reporting with detailed messages
- Tool execution attempt logging
- Improved exception handling
🛠️ Improved Tool System
- Enhanced
Toolclass with async support detection - Better tool schema parsing
- Tool metadata including async status
- Improved tool registry with built-in tool management
🎯 Better Agent Configuration
log_levelparameter for controlling logging verbosityinclude_builtin_toolsparameter to control built-in tool loading- Enhanced initialization with better defaults
📦 Dependencies Added
requests- For web search functionalityaiohttp- For async web searchasyncio- For async support (built-in)logging- For comprehensive logging (built-in)
🎮 Usage Examples
Basic Usage with Built-in Tools
from nbagents import Agent
agent = Agent(llm=your_llm_function, include_builtin_tools=True)
result = agent.run("Get the current time and save it to a file")
Async Usage
import asyncio
from nbagents import Agent
async def main():
agent = Agent(llm=async_llm_function, include_builtin_tools=True)
result = await agent.run_async("Search for Python tutorials and save results")
asyncio.run(main())
Custom Logging
from nbagents import Agent, setup_logger
logger = setup_logger("my_agent", "DEBUG")
agent = Agent(llm=your_llm, log_level="DEBUG")
Custom Tools with Async
@agent.tool("async_process")
async def async_process(data: str) -> str:
await asyncio.sleep(1) # Simulate async work
return f"Processed: {data}"
✅ Verified Working Features
- ✅ File read/write operations work correctly
- ✅ Time retrieval works correctly
- ✅ Async tool execution works
- ✅ Comprehensive logging is functional
- ✅ Error handling and retries work
- ✅ Tool registration and discovery works
- ✅ Both sync and async LLM calls supported
🚀 Next Possible Enhancements
- Memory/persistence system
- Multi-agent communication
- Plugin system
- Configuration file support
- Performance metrics and monitoring
- Additional built-in tools (database, API calls, etc.)
- Tool composition and chaining
- Custom prompt templates
Metadata
Release files for nbagents 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nbagents-0.1.1.tar.gz | 10.3 kB | Without provenance | Details for nbagents-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nbagents-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nbagents-0.1.1-py3-none-any.whl |
Total release size: 21.5 kB
Release files / nbagents-0.1.1.tar.gz
| Download URL | nbagents-0.1.1.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bf47ee822863f9a9cbd3db5b6aff080d337561e122157532540f5a751503e66
|
|
BLAKE2b-256 checksum How to use checksums |
b6bf28dc2e3e1c2df0c0e67f2bc84662d9e9d71032ed69076942a272e554802e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.5 Windows/10
|
Release files / nbagents-0.1.1-py3-none-any.whl
| Download URL | nbagents-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb239bc6600cc2514fb6c41398f403a088f13fb50c78f87d9423823dfb4133c5
|
|
BLAKE2b-256 checksum How to use checksums |
51ea8baff27af7105a8bccbe00ea9e447e595633f5c25b39f029850cc6d4c90f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.5 Windows/10
|
Security for nbagents 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.