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:
Archer
2024-09-30 17:28:03 +08:00
committed by GitHub
parent 7c829febec
commit 7c38d1da9a
39 changed files with 427 additions and 179 deletions

View File

@@ -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) || []
};

View File

@@ -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) || []
};

View File

@@ -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) || []
};