mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
Merge main HEAD (segment 5) into sandboxed-agent-rebase
Resolve 83 conflicts: 10 backend, 62 frontend, 11 config/lock files. Preserve sandbox/agent/collaboration features while adopting main's UI refactorings (Dialog/AlertDialog/Popover), model provider updates, and enterprise features. Made-with: Cursor
This commit is contained in:
@ -2,12 +2,41 @@ import type { ValidationError } from 'jsonschema'
|
||||
import type { ArrayItems, Field, LLMNodeType } from './types'
|
||||
import * as z from 'zod'
|
||||
import { draft07Validator, forbidBooleanProperties } from '@/utils/validators'
|
||||
import { extractPluginId } from '../../utils/plugin'
|
||||
import { ArrayType, FILE_REF_FORMAT, Type } from './types'
|
||||
|
||||
export const checkNodeValid = (_payload: LLMNodeType) => {
|
||||
return true
|
||||
}
|
||||
|
||||
export enum LLMModelIssueCode {
|
||||
providerRequired = 'provider-required',
|
||||
providerPluginUnavailable = 'provider-plugin-unavailable',
|
||||
}
|
||||
|
||||
export const getLLMModelIssue = ({
|
||||
modelProvider,
|
||||
isModelProviderInstalled = true,
|
||||
}: {
|
||||
modelProvider?: string
|
||||
isModelProviderInstalled?: boolean
|
||||
}) => {
|
||||
if (!modelProvider)
|
||||
return LLMModelIssueCode.providerRequired
|
||||
|
||||
if (!isModelProviderInstalled)
|
||||
return LLMModelIssueCode.providerPluginUnavailable
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export const isLLMModelProviderInstalled = (modelProvider: string | undefined, installedPluginIds: ReadonlySet<string>) => {
|
||||
if (!modelProvider)
|
||||
return true
|
||||
|
||||
return installedPluginIds.has(extractPluginId(modelProvider))
|
||||
}
|
||||
|
||||
export const getFieldType = (field: Field) => {
|
||||
const { type, items, enum: enums, format } = field
|
||||
if (format === FILE_REF_FORMAT)
|
||||
|
||||
Reference in New Issue
Block a user