MCPcopy Index your code
hub / github.com/Effect-TS/effect / createEmbedding

Function createEmbedding

packages/ai/openai/src/OpenAiClient.ts:203–227  ·  view source on GitHub ↗
(
      options: typeof Generated.CreateEmbeddingRequest.Encoded
    )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

fromRequestErrorMethod · 0.80
fromResponseErrorMethod · 0.80
pipeMethod · 0.65
fromParseErrorMethod · 0.45

Tested by

no test coverage detected