mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-07-06 05:38:13 +02:00
Fix a2a_wrapper imports and add clean usage example
- Remove top-level imports from fuzzforge_ai/__init__.py to avoid dependency issues - Fix config_bridge.py exception handling (remove undefined exc variable) - Add examples/test_a2a_simple.py demonstrating clean a2a_wrapper usage - Update package to use explicit imports: from fuzzforge_ai.a2a_wrapper import send_agent_task All functionality preserved, imports are now explicit and modular.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Simple example of using the A2A wrapper
|
||||
Run from project root: python examples/test_a2a_simple.py
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
|
||||
async def main():
|
||||
# Clean import!
|
||||
from fuzzforge_ai.a2a_wrapper import send_agent_task
|
||||
|
||||
print("Sending task to agent at http://127.0.0.1:10900...")
|
||||
|
||||
result = await send_agent_task(
|
||||
url="http://127.0.0.1:10900/a2a/litellm_agent",
|
||||
model="gpt-4o-mini",
|
||||
provider="openai",
|
||||
prompt="You are concise.",
|
||||
message="Give me a simple Python function that adds two numbers.",
|
||||
context="test_session",
|
||||
timeout=120
|
||||
)
|
||||
|
||||
print(f"\nContext ID: {result.context_id}")
|
||||
print(f"\nResponse:\n{result.text}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user