mirror of
https://github.com/langgenius/dify.git
synced 2026-11-12 22:31:24 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
51 lines
1.4 KiB
TypeScript
Generated
51 lines
1.4 KiB
TypeScript
Generated
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
|
import * as z from 'zod'
|
|
|
|
const zErrorResponse = /* @__PURE__ */ (() =>
|
|
z.object({
|
|
code: z.string(),
|
|
details: z.record(z.string(), z.unknown()).optional(),
|
|
message: z.string(),
|
|
params: z.string().optional(),
|
|
status: z.int(),
|
|
}))()
|
|
|
|
const zCompletionRequestError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('completion_request_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zModelCurrentlyNotSupportError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('model_currently_not_support'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zProviderNotInitializeError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('provider_not_initialize'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zProviderQuotaExceededError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('provider_quota_exceeded'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
export const postErrors = {
|
|
completion_request_error: { status: 400, data: zCompletionRequestError },
|
|
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
|
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
|
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
|
}
|