Initialize the asynchronous OpenRouter client.
(self)
| 56 | } |
| 57 | |
| 58 | def init_async_client(self): |
| 59 | """Initialize the asynchronous OpenRouter client.""" |
| 60 | from api.config import OPENROUTER_API_KEY |
| 61 | api_key = OPENROUTER_API_KEY |
| 62 | if not api_key: |
| 63 | log.warning("OPENROUTER_API_KEY not configured") |
| 64 | |
| 65 | # For async, we'll use aiohttp |
| 66 | return { |
| 67 | "api_key": api_key, |
| 68 | "base_url": "https://openrouter.ai/api/v1" |
| 69 | } |
| 70 | |
| 71 | def convert_inputs_to_api_kwargs( |
| 72 | self, input: Any, model_kwargs: Dict = None, model_type: ModelType = None |