(prompt: string)
| 401 | } |
| 402 | |
| 403 | async completePrompt(prompt: string) { |
| 404 | const { id: model, temperature } = this.getModel() |
| 405 | |
| 406 | let message |
| 407 | try { |
| 408 | message = await this.client.messages.create({ |
| 409 | model, |
| 410 | max_tokens: ANTHROPIC_DEFAULT_MAX_TOKENS, |
| 411 | thinking: undefined, |
| 412 | temperature, |
| 413 | messages: [{ role: "user", content: prompt }], |
| 414 | stream: false, |
| 415 | }) |
| 416 | } catch (error) { |
| 417 | TelemetryService.instance.captureException( |
| 418 | new ApiProviderError( |
| 419 | error instanceof Error ? error.message : String(error), |
| 420 | this.providerName, |
| 421 | model, |
| 422 | "completePrompt", |
| 423 | ), |
| 424 | ) |
| 425 | throw error |
| 426 | } |
| 427 | |
| 428 | const content = message.content.find(({ type }) => type === "text") |
| 429 | return content?.type === "text" ? content.text : "" |
| 430 | } |
| 431 | } |
nothing calls this directly
no test coverage detected