MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / demo_default_provider

Function demo_default_provider

examples/05_provider_selection.py:85–114  ·  view source on GitHub ↗

Demo using LLMClient with default provider.

()

Source from the content-addressed store, hash-verified

83
84
85async 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
117async def demo_provider_comparison():

Callers 1

mainFunction · 0.85

Calls 4

generateMethod · 0.95
LLMClientClass · 0.90
MessageClass · 0.90
getMethod · 0.80

Tested by

no test coverage detected