mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
4.8.11 test (#2843)
* feat: app version test * update doc * fix: paging num error * fix: doc api domain * rename variable * perf: memment node min size
This commit is contained in:
@@ -25,6 +25,7 @@ import { AIChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { GPTMessages2Chats } from '@fastgpt/global/core/chat/adapt';
|
||||
import { updateToolInputValue } from './utils';
|
||||
import { computedMaxToken, llmCompletionsBodyFormat } from '../../../../ai/utils';
|
||||
import { toolValueTypeList } from '@fastgpt/global/core/workflow/constants';
|
||||
|
||||
type FunctionRunResponseType = {
|
||||
toolRunResponse: DispatchFlowResponse;
|
||||
@@ -64,10 +65,12 @@ export const runToolWithFunctionCall = async (
|
||||
}
|
||||
> = {};
|
||||
item.toolParams.forEach((item) => {
|
||||
const isArray = item.valueType?.startsWith('array');
|
||||
const jsonSchema = (
|
||||
toolValueTypeList.find((type) => type.value === item.valueType) || toolValueTypeList[0]
|
||||
).jsonSchema;
|
||||
|
||||
properties[item.key] = {
|
||||
type: isArray ? 'array' : item.valueType || 'string',
|
||||
...(isArray && { items: { type: item.valueType?.slice(5).toLowerCase() || 'string' } }),
|
||||
...jsonSchema,
|
||||
description: item.toolDescription || '',
|
||||
enum: item.enum?.split('\n').filter(Boolean) || []
|
||||
};
|
||||
|
@@ -27,6 +27,7 @@ import { GPTMessages2Chats } from '@fastgpt/global/core/chat/adapt';
|
||||
import { updateToolInputValue } from './utils';
|
||||
import { computedMaxToken, llmCompletionsBodyFormat } from '../../../../ai/utils';
|
||||
import { WorkflowResponseType } from '../../type';
|
||||
import { toolValueTypeList } from '@fastgpt/global/core/workflow/constants';
|
||||
|
||||
type FunctionCallCompletion = {
|
||||
id: string;
|
||||
@@ -72,10 +73,12 @@ export const runToolWithPromptCall = async (
|
||||
}
|
||||
> = {};
|
||||
item.toolParams.forEach((item) => {
|
||||
const isArray = item.valueType?.startsWith('array');
|
||||
const jsonSchema = (
|
||||
toolValueTypeList.find((type) => type.value === item.valueType) || toolValueTypeList[0]
|
||||
).jsonSchema;
|
||||
|
||||
properties[item.key] = {
|
||||
type: isArray ? 'array' : item.valueType || 'string',
|
||||
...(isArray && { items: { type: item.valueType?.slice(5).toLowerCase() || 'string' } }),
|
||||
...jsonSchema,
|
||||
description: item.toolDescription || '',
|
||||
enum: item.enum?.split('\n').filter(Boolean) || []
|
||||
};
|
||||
|
@@ -26,6 +26,7 @@ import { updateToolInputValue } from './utils';
|
||||
import { computedMaxToken, llmCompletionsBodyFormat } from '../../../../ai/utils';
|
||||
import { getNanoid, sliceStrStartEnd } from '@fastgpt/global/common/string/tools';
|
||||
import { addLog } from '../../../../../common/system/log';
|
||||
import { toolValueTypeList } from '@fastgpt/global/core/workflow/constants';
|
||||
|
||||
type ToolRunResponseType = {
|
||||
toolRunResponse: DispatchFlowResponse;
|
||||
@@ -78,10 +79,11 @@ export const runToolWithToolChoice = async (
|
||||
}
|
||||
> = {};
|
||||
item.toolParams.forEach((item) => {
|
||||
const isArray = item.valueType?.startsWith('array');
|
||||
const jsonSchema = (
|
||||
toolValueTypeList.find((type) => type.value === item.valueType) || toolValueTypeList[0]
|
||||
)?.jsonSchema;
|
||||
properties[item.key] = {
|
||||
type: isArray ? 'array' : item.valueType || 'string',
|
||||
...(isArray && { items: { type: item.valueType?.slice(5).toLowerCase() || 'string' } }),
|
||||
...jsonSchema,
|
||||
description: item.toolDescription || '',
|
||||
enum: item.enum?.split('\n').filter(Boolean) || []
|
||||
};
|
||||
|
Reference in New Issue
Block a user