(
options: typeof Generated.CreateEmbeddingRequest.Encoded
)
| 201 | } |
| 202 | |
| 203 | const createEmbedding = ( |
| 204 | options: typeof Generated.CreateEmbeddingRequest.Encoded |
| 205 | ): Effect.Effect<Generated.CreateEmbeddingResponse, AiError.AiError> => |
| 206 | client.createEmbedding(options).pipe( |
| 207 | Effect.catchTags({ |
| 208 | RequestError: (error) => |
| 209 | AiError.HttpRequestError.fromRequestError({ |
| 210 | module: "OpenAiClient", |
| 211 | method: "createResponse", |
| 212 | error |
| 213 | }), |
| 214 | ResponseError: (error) => |
| 215 | AiError.HttpResponseError.fromResponseError({ |
| 216 | module: "OpenAiClient", |
| 217 | method: "createResponse", |
| 218 | error |
| 219 | }), |
| 220 | ParseError: (error) => |
| 221 | AiError.MalformedOutput.fromParseError({ |
| 222 | module: "OpenAiClient", |
| 223 | method: "createResponse", |
| 224 | error |
| 225 | }) |
| 226 | }) |
| 227 | ) |
| 228 | |
| 229 | return OpenAiClient.of({ |
| 230 | client, |
nothing calls this directly
no test coverage detected