( model: ModelConfig, _authConfig: AuthConfig, )
| 42 | * Creates an LLM API instance from a ModelConfig and auth configuration |
| 43 | */ |
| 44 | export function createLlmApi( |
| 45 | model: ModelConfig, |
| 46 | _authConfig: AuthConfig, |
| 47 | ): BaseLlmApi | null { |
| 48 | const config: LLMConfig = { |
| 49 | provider: model.provider as any, |
| 50 | model: model.model, |
| 51 | apiKey: model.apiKey, |
| 52 | apiBase: model.apiBase, |
| 53 | requestOptions: model.requestOptions, |
| 54 | env: model.env, |
| 55 | }; |
| 56 | |
| 57 | return constructLlmApi(config) ?? null; |
| 58 | } |
| 59 | |
| 60 | export function getLlmApi( |
| 61 | assistant: AssistantUnrolled, |
no test coverage detected