MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromSchemaError

Method fromSchemaError

packages/effect/src/ai/AiError.ts:942–944  ·  view source on GitHub ↗

* Creates an InvalidOutputError from a Schema error. * * **Example** (Creating an invalid output error from a schema error) * * ```ts import.meta.vitest * import { Effect, Schema } from "effect" * import { AiError } from "effect/ai" * * const schemaError = await Effect.runPro

(error: Schema.SchemaError)

Source from the content-addressed store, hash-verified

940 * @since 4.0.0
941 */
942 static fromSchemaError(error: Schema.SchemaError): InvalidOutputError {
943 return new InvalidOutputError({ description: error.message })
944 }
945
946 override get message(): string {
947 return `Invalid output: ${this.description}`

Callers 12

errors.tsFile · 0.45
mapSchemaErrorFunction · 0.45
errors.tsFile · 0.45
errors.tsFile · 0.45
mapSchemaErrorFunction · 0.45
errors.tsFile · 0.45
AiError.test.tsFile · 0.45
makeUnsafeFunction · 0.45
generateTextFunction · 0.45
generateObjectFunction · 0.45
LanguageModel.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected