MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / completePrompt

Method completePrompt

src/api/providers/xai.ts:145–163  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 5

getModelMethod · 0.95
handleOpenAIErrorFunction · 0.90
captureExceptionMethod · 0.65
StringInterface · 0.50
createMethod · 0.45

Tested by

no test coverage detected