fix(web): custom-tool output_schema.properties missing type (#25731)
Co-authored-by: joeyczheng <joeyczheng@tencent.com>
This commit is contained in:
parent
bdbe078630
commit
169ce71e59
4 changed files with 10 additions and 10 deletions
|
|
@ -50,8 +50,8 @@ const StrategyDetail: FC<Props> = ({
|
||||||
res.push({
|
res.push({
|
||||||
name: outputKey,
|
name: outputKey,
|
||||||
type: output.type === 'array'
|
type: output.type === 'array'
|
||||||
? `Array[${output.items?.type.slice(0, 1).toLocaleUpperCase()}${output.items?.type.slice(1)}]`
|
? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleUpperCase() + output.items.type.slice(1) : 'Unknown'}]`
|
||||||
: `${output.type.slice(0, 1).toLocaleUpperCase()}${output.type.slice(1)}`,
|
: `${output.type ? output.type.slice(0, 1).toLocaleUpperCase() + output.type.slice(1) : 'Unknown'}`,
|
||||||
description: output.description,
|
description: output.description,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -411,8 +411,8 @@ const formatItem = (
|
||||||
outputSchema.push({
|
outputSchema.push({
|
||||||
variable: outputKey,
|
variable: outputKey,
|
||||||
type: dataType === 'array'
|
type: dataType === 'array'
|
||||||
? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]`
|
? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleLowerCase() + output.items.type.slice(1) : 'Unknown'}]`
|
||||||
: `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`,
|
: `${output.type ? output.type.slice(0, 1).toLocaleLowerCase() + output.type.slice(1) : 'Unknown'}`,
|
||||||
description: output.description,
|
description: output.description,
|
||||||
children: output.type === 'object' ? {
|
children: output.type === 'object' ? {
|
||||||
schema: {
|
schema: {
|
||||||
|
|
@ -507,8 +507,8 @@ const formatItem = (
|
||||||
outputs.push({
|
outputs.push({
|
||||||
variable: outputKey,
|
variable: outputKey,
|
||||||
type: output.type === 'array'
|
type: output.type === 'array'
|
||||||
? `Array[${output.items?.type.slice(0, 1).toLocaleUpperCase()}${output.items?.type.slice(1)}]` as VarType
|
? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleUpperCase() + output.items.type.slice(1) : 'Unknown'}]` as VarType
|
||||||
: `${output.type.slice(0, 1).toLocaleUpperCase()}${output.type.slice(1)}` as VarType,
|
: `${output.type ? output.type.slice(0, 1).toLocaleUpperCase() + output.type.slice(1) : 'Unknown'}` as VarType,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
res.vars = [
|
res.vars = [
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,8 @@ const useConfig = (id: string, payload: AgentNodeType) => {
|
||||||
res.push({
|
res.push({
|
||||||
name: outputKey,
|
name: outputKey,
|
||||||
type: output.type === 'array'
|
type: output.type === 'array'
|
||||||
? `Array[${output.items?.type.slice(0, 1).toLocaleUpperCase()}${output.items?.type.slice(1)}]`
|
? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleUpperCase() + output.items.type.slice(1) : 'Unknown'}]`
|
||||||
: `${output.type.slice(0, 1).toLocaleUpperCase()}${output.type.slice(1)}`,
|
: `${output.type ? output.type.slice(0, 1).toLocaleUpperCase() + output.type.slice(1) : 'Unknown'}`,
|
||||||
description: output.description,
|
description: output.description,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -189,8 +189,8 @@ const useConfig = (id: string, payload: ToolNodeType) => {
|
||||||
res.push({
|
res.push({
|
||||||
name: outputKey,
|
name: outputKey,
|
||||||
type: output.type === 'array'
|
type: output.type === 'array'
|
||||||
? `Array[${output.items?.type.slice(0, 1).toLocaleUpperCase()}${output.items?.type.slice(1)}]`
|
? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleUpperCase() + output.items.type.slice(1) : 'Unknown'}]`
|
||||||
: `${output.type.slice(0, 1).toLocaleUpperCase()}${output.type.slice(1)}`,
|
: `${output.type ? output.type.slice(0, 1).toLocaleUpperCase() + output.type.slice(1) : 'Unknown'}`,
|
||||||
description: output.description,
|
description: output.description,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue