mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 08:58:09 +08:00
refactor: Improve type safety in context generate modal hooks
This commit is contained in:
@ -74,7 +74,7 @@ const resolveVarSchema = (variable: Var): Record<string, unknown> | undefined =>
|
||||
|
||||
const toAvailableVarsPayload = (
|
||||
availableVars: NodeOutPutVar[],
|
||||
nodeMap: Map<string, { data?: { type?: string } }>,
|
||||
nodeMap: Map<string, Node>,
|
||||
): ContextGenerateAvailableVar[] => {
|
||||
const results: ContextGenerateAvailableVar[] = []
|
||||
availableVars.forEach((nodeVar) => {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import type { IOnCompleted, IOnData, IOnError, IOnFile, IOnMessageEnd, IOnMessageReplace, IOnThought } from './base'
|
||||
import type { FileEntity } from '@/app/components/base/file-uploader/types'
|
||||
import type { ModelParameterRule } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||
import type { StructuredOutput } from '@/app/components/workflow/nodes/llm/types'
|
||||
import type { BlockEnum, ValueSelector, VarType } from '@/app/components/workflow/types'
|
||||
import type { ChatPromptConfig, CompletionPromptConfig } from '@/models/debug'
|
||||
import type { AppModeEnum, CompletionParams, ModelModeType } from '@/types/app'
|
||||
import { get, post, ssePost } from './base'
|
||||
@ -34,13 +36,13 @@ export type ContextGenerateMessage = {
|
||||
|
||||
// FIXME
|
||||
export type ContextGenerateAvailableVar = {
|
||||
value_selector: string[]
|
||||
type: string
|
||||
value_selector: ValueSelector
|
||||
type: VarType
|
||||
description?: string
|
||||
node_id?: string
|
||||
node_title?: string
|
||||
node_type?: string
|
||||
schema?: Record<string, unknown> | null
|
||||
node_type?: BlockEnum
|
||||
schema?: StructuredOutput['schema'] | Record<string, unknown> | null
|
||||
}
|
||||
|
||||
export type ContextGenerateParameterInfo = {
|
||||
|
||||
Reference in New Issue
Block a user