| 642 | * @since 4.0.0 |
| 643 | */ |
| 644 | export class InternalProviderError extends Schema.Error<InternalProviderError>( |
| 645 | "effect/ai/AiError/InternalProviderError" |
| 646 | )({ |
| 647 | _tag: Schema.tag("InternalProviderError"), |
| 648 | description: Schema.String, |
| 649 | metadata: providerMetadataWithDefaults<InternalProviderErrorMetadata>(), |
| 650 | http: Schema.optional(HttpContext) |
| 651 | }) { |
| 652 | /** |
| 653 | * Marks `InternalProviderError` as a semantic AI error reason for runtime guards. |
| 654 | * |
| 655 | * @since 4.0.0 |
| 656 | */ |
| 657 | readonly [ReasonTypeId] = ReasonTypeId |
| 658 | |
| 659 | /** |
| 660 | * Internal provider errors are typically transient and are retryable. |
| 661 | * |
| 662 | * @since 4.0.0 |
| 663 | */ |
| 664 | get isRetryable(): boolean { |
| 665 | return true |
| 666 | } |
| 667 | |
| 668 | override get message(): string { |
| 669 | return `Internal provider error: ${this.description}` |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | /** |
| 674 | * Error indicating failure to parse or validate LLM output. |
nothing calls this directly
no test coverage detected