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

Method fromParseError

packages/ai/ai/src/AiError.ts:590–601  ·  view source on GitHub ↗

* Creates a MalformedOutput error from a Schema ParseError. * * @example * ```ts * import { AiError } from "@effect/ai" * import { Effect, Schema } from "effect" * * const UserSchema = Schema.Struct({ * name: Schema.String, * age: Schema.Number * }) * * const

({ error, ...params }: {
    readonly module: string
    readonly method: string
    readonly description?: string
    readonly error: ParseError
  })

Source from the content-addressed store, hash-verified

588 * @category Constructors
589 */
590 static fromParseError({ error, ...params }: {
591 readonly module: string
592 readonly method: string
593 readonly description?: string
594 readonly error: ParseError
595 }): MalformedOutput {
596 // TODO(Max): enhance
597 return new MalformedOutput({
598 ...params,
599 cause: error
600 })
601 }
602}
603
604// =============================================================================

Callers 14

streamRequestFunction · 0.45
AnthropicClient.tsFile · 0.45
makeFunction · 0.45
streamRequestFunction · 0.45
Chat.tsFile · 0.45
generateTextFunction · 0.45
generateObjectFunction · 0.45
LanguageModel.tsFile · 0.45
streamRequestFunction · 0.45
makeFunction · 0.45
createResponseFunction · 0.45
createEmbeddingFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected