(prompt: string)
| 143 | } |
| 144 | |
| 145 | async completePrompt(prompt: string): Promise<string> { |
| 146 | const model = this.getModel() |
| 147 | |
| 148 | try { |
| 149 | const response = await this.client.responses.create({ |
| 150 | model: model.id, |
| 151 | input: [{ role: "user", content: [{ type: "input_text", text: prompt }] }], |
| 152 | store: false, |
| 153 | }) |
| 154 | |
| 155 | // output_text is a convenience field on the Responses API response |
| 156 | return response.output_text || "" |
| 157 | } catch (error) { |
| 158 | const errorMessage = error instanceof Error ? error.message : String(error) |
| 159 | const apiError = new ApiProviderError(errorMessage, this.providerName, model.id, "completePrompt") |
| 160 | TelemetryService.instance.captureException(apiError) |
| 161 | throw handleOpenAIError(error, this.providerName) |
| 162 | } |
| 163 | } |
| 164 | } |
nothing calls this directly
no test coverage detected