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

Function createResponse

packages/ai/openai/src/OpenAiClient.ts:166–190  ·  view source on GitHub ↗
(
      options: typeof Generated.CreateResponse.Encoded
    )

Source from the content-addressed store, hash-verified

164 }
165
166 const createResponse = (
167 options: typeof Generated.CreateResponse.Encoded
168 ): Effect.Effect<Generated.Response, AiError.AiError> =>
169 client.createResponse(options).pipe(
170 Effect.catchTags({
171 RequestError: (error) =>
172 AiError.HttpRequestError.fromRequestError({
173 module: "OpenAiClient",
174 method: "createResponse",
175 error
176 }),
177 ResponseError: (error) =>
178 AiError.HttpResponseError.fromResponseError({
179 module: "OpenAiClient",
180 method: "createResponse",
181 error
182 }),
183 ParseError: (error) =>
184 AiError.MalformedOutput.fromParseError({
185 module: "OpenAiClient",
186 method: "createResponse",
187 error
188 })
189 })
190 )
191
192 const createResponseStream = (
193 options: Omit<typeof Generated.CreateResponse.Encoded, "stream">

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