agents.simple.lazy_simple_agent¶
Ultra-optimized SimpleAgent implementation that achieves sub-3 second import times. through comprehensive lazy loading and intelligent caching.
This approach uses proxy objects and deferred imports to avoid loading any heavy dependencies (LangChain, NumPy, Pandas, etc.) until they’re actually needed.
- Usage:
# Ultra-fast import - no heavy dependencies from haive.agents.simple.lazy_simple_agent import LazySimpleAgent as SimpleAgentV3
# Heavy loading happens only when actually used agent = SimpleAgent(name=”test”) # Still fast - creates proxy result = await agent.arun(“Hello”) # Heavy loading happens here
Classes¶
Lazy proxy for Agent base class. |
|
Lazy proxy for AugLLMConfig that defers all heavy imports. |
|
Ultra-optimized SimpleAgent with comprehensive lazy loading. |
Functions¶
|
Cached import with intelligent loading. |
Module Contents¶
- class agents.simple.lazy_simple_agent.LazyAgent(**kwargs)¶
Lazy proxy for Agent base class.
Init .
- class agents.simple.lazy_simple_agent.LazyAugLLMConfig(**kwargs)¶
Lazy proxy for AugLLMConfig that defers all heavy imports.
Init .
- class agents.simple.lazy_simple_agent.LazySimpleAgent(name='LazySimpleAgent', engine=None, temperature=None, max_tokens=None, model_name=None, debug=True, **kwargs)¶
Ultra-optimized SimpleAgent with comprehensive lazy loading.
Initialize with minimal overhead - no heavy imports.
- Parameters:
- async arun(*args, **kwargs)¶
Async run - triggers full initialization.
- classmethod as_structured_tool(*args, **kwargs)¶
Create structured tool - triggers full initialization.
- classmethod as_tool(*args, **kwargs)¶
Create tool - triggers full initialization.
- run(*args, **kwargs)¶
Sync run - triggers full initialization.