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

Class ContentPolicyError

packages/effect/src/unstable/ai/AiError.ts:534–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532 * @since 4.0.0
533 */
534export class ContentPolicyError extends Schema.Error<ContentPolicyError>(
535 "effect/ai/AiError/ContentPolicyError"
536)({
537 _tag: Schema.tag("ContentPolicyError"),
538 description: Schema.String,
539 metadata: providerMetadataWithDefaults<ContentPolicyErrorMetadata>(),
540 http: Schema.optional(HttpContext)
541}) {
542 /**
543 * Marks `ContentPolicyError` as a semantic AI error reason for runtime guards.
544 *
545 * @since 4.0.0
546 */
547 readonly [ReasonTypeId] = ReasonTypeId
548
549 /**
550 * Content policy errors require content changes and are not retryable.
551 *
552 * @since 4.0.0
553 */
554 get isRetryable(): boolean {
555 return false
556 }
557
558 override get message(): string {
559 return `Content policy violation: ${this.description}`
560 }
561}
562
563/**
564 * Error indicating the request had invalid or malformed parameters.

Callers

nothing calls this directly

Calls 2

tagMethod · 0.65

Tested by

no test coverage detected