Create an LLM client from SDK config. Args: config: AutoFigure SDK Config object purpose: 'generation' or 'methodology' Returns: Configured LLMClient instance
(config: "Config", purpose: str = "generation")
| 181 | |
| 182 | |
| 183 | def create_client_from_config(config: "Config", purpose: str = "generation") -> LLMClient: |
| 184 | """ |
| 185 | Create an LLM client from SDK config. |
| 186 | |
| 187 | Args: |
| 188 | config: AutoFigure SDK Config object |
| 189 | purpose: 'generation' or 'methodology' |
| 190 | |
| 191 | Returns: |
| 192 | Configured LLMClient instance |
| 193 | """ |
| 194 | if purpose == "methodology": |
| 195 | return LLMClient( |
| 196 | api_key=config.methodology_api_key, |
| 197 | base_url=config.methodology_base_url, |
| 198 | model=config.methodology_model, |
| 199 | provider=config.methodology_provider, |
| 200 | ) |
| 201 | else: |
| 202 | return LLMClient( |
| 203 | api_key=config.generation_api_key, |
| 204 | base_url=config.generation_base_url, |
| 205 | model=config.generation_model, |
| 206 | provider=config.generation_provider, |
| 207 | ) |