( harness: HarnessName, grokOptions?: GrokHarnessOptions, )
| 264 | |
| 265 | /** The harness adapter `chat()` runs for the chosen harness. */ |
| 266 | export function buildAdapter( |
| 267 | harness: HarnessName, |
| 268 | grokOptions?: GrokHarnessOptions, |
| 269 | ): AnyTextAdapter { |
| 270 | if (harness === 'grok') { |
| 271 | return grokBuildText(grokOptions?.model ?? 'composer-2.5', { |
| 272 | protocol: grokOptions?.protocol ?? 'acp', |
| 273 | transport: grokOptions?.transport ?? 'auto', |
| 274 | }) |
| 275 | } |
| 276 | return HARNESSES[harness].makeAdapter() |
| 277 | } |
| 278 | |
| 279 | /** Required env vars (harness + provider) that are not set in process.env. */ |
| 280 | export function missingEnv( |
no test coverage detected