MCPcopy Create free account
hub / github.com/ResearAI/AutoFigure / __init__

Method __init__

autofigure/utils/llm_client.py:26–53  ·  view source on GitHub ↗

Initialize LLM client. Args: api_key: API key for the provider base_url: Base URL for the API endpoint model: Model name to use provider: Provider name (openrouter, bianxie, gemini)

(
        self,
        api_key: str,
        base_url: str = "https://openrouter.ai/api/v1",
        model: str = "google/gemini-3.1-pro-preview",
        provider: str = "openrouter",
    )

Source from the content-addressed store, hash-verified

24 """
25
26 def __init__(
27 self,
28 api_key: str,
29 base_url: str = "https://openrouter.ai/api/v1",
30 model: str = "google/gemini-3.1-pro-preview",
31 provider: str = "openrouter",
32 ):
33 """
34 Initialize LLM client.
35
36 Args:
37 api_key: API key for the provider
38 base_url: Base URL for the API endpoint
39 model: Model name to use
40 provider: Provider name (openrouter, bianxie, gemini)
41 """
42 self.api_key = api_key
43 self.base_url = base_url
44 self.model = model
45 self.provider = provider
46
47 # Adjust base_url for Gemini
48 if provider == "gemini" and base_url:
49 if not base_url.endswith("/openai/") and not base_url.endswith("/openai"):
50 if base_url.endswith("/"):
51 self.base_url = base_url + "openai/"
52 else:
53 self.base_url = base_url + "/openai/"
54
55 def call(
56 self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected