Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion modules/tool/contract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import z from 'zod';
import { c } from '@/contract/init';
import { ToolListItemSchema, type ToolListItemType } from './type/api';
import { ToolTypeEnum } from './type/tool';
import { ToolTypeListSchema } from './controller';

export const toolContract = c.router(
Expand Down
4 changes: 2 additions & 2 deletions modules/tool/controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ToolType } from './type';
import { tools } from './constants';
import { ToolTypeEnum } from './type/tool';
import { ToolTypeTranslations } from './type/tool';
import { ToolTypeMap } from './type/tool';
import z from 'zod';
import { I18nStringStrictSchema } from '@/type/i18n';

Expand All @@ -17,7 +17,7 @@ export function getTool(toolId: string): ToolType | undefined {
}

export function getToolType(): z.infer<typeof ToolTypeListSchema> {
return Object.entries(ToolTypeTranslations).map(([type, name]) => ({
return Object.entries(ToolTypeMap).map(([type, name]) => ({
type: type as ToolTypeEnum,
name
}));
Expand Down
2 changes: 1 addition & 1 deletion modules/tool/type/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export type ToolClassifyType = {
};

/* Tool config is passed to FastGPT */
export const ToolTypeTranslations = {
export const ToolTypeMap = {
[ToolTypeEnum.tools]: {
en: 'tools',
'zh-CN': '工具',
Expand Down
8 changes: 5 additions & 3 deletions sdk/client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import createClient from '@/contract/client';
import type { SystemVarType } from '@tool/type/tool';
import type { StreamMessageType } from '@tool/type/tool';

export { createClient };

// Tool run
import { ToolTypeEnum, type SystemVarType } from '@tool/type/tool';
import type { StreamMessageType } from '@tool/type/tool';
export type { SystemVarType, StreamMessageType as StreamMessage };
export { RunToolWithStream } from './runToolStream';
export { StreamDataAnswerTypeEnum } from '@tool/type/tool';

export { ToolTypeEnum };
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastgpt-sdk/plugin",
"version": "0.1.14",
"version": "0.1.15",
"description": "fastgpt-plugin sdk",
"main": "dist/client.js",
"types": "dist/client.d.ts",
Expand Down