Demo using LLMClient with default provider.
()
| 83 | |
| 84 | |
| 85 | async def demo_default_provider(): |
| 86 | """Demo using LLMClient with default provider.""" |
| 87 | print("\n" + "=" * 60) |
| 88 | print("DEMO: LLMClient with Default Provider (Anthropic)") |
| 89 | print("=" * 60) |
| 90 | |
| 91 | # Load config |
| 92 | config_path = Path("mini_agent/config/config.yaml") |
| 93 | with open(config_path, encoding="utf-8") as f: |
| 94 | config = yaml.safe_load(f) |
| 95 | |
| 96 | # Initialize client without specifying provider (defaults to Anthropic) |
| 97 | client = LLMClient( |
| 98 | api_key=config["api_key"], |
| 99 | model=config.get("model", "MiniMax-M2.5"), |
| 100 | ) |
| 101 | |
| 102 | print(f"Provider (default): {client.provider}") |
| 103 | print(f"API Base: {client.api_base}") |
| 104 | |
| 105 | # Simple question |
| 106 | messages = [Message(role="user", content="Say 'Hello with default provider!'")] |
| 107 | print(f"\n👤 User: {messages[0].content}") |
| 108 | |
| 109 | try: |
| 110 | response = await client.generate(messages) |
| 111 | print(f"💬 Model: {response.content}") |
| 112 | print("✅ Default provider demo completed") |
| 113 | except Exception as e: |
| 114 | print(f"❌ Error: {e}") |
| 115 | |
| 116 | |
| 117 | async def demo_provider_comparison(): |