mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: build
This commit is contained in:
parent
31065a10c2
commit
809fde3694
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { createContext, useCallback, useContext, useRef } from 'react';
|
import { createContext, useCallback, useContext, useRef } from 'react';
|
||||||
import { AIEmployee, Message, ResendOptions, SendOptions } from '../types'; // 假设有这些类型定义
|
import { AIEmployee, Message, ResendOptions, SendOptions } from '../types';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { uid } from '@formily/shared';
|
import { uid } from '@formily/shared';
|
||||||
import { useT } from '../../locale';
|
import { useT } from '../../locale';
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
/**
|
|
||||||
* This file is part of the NocoBase (R) project.
|
|
||||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
||||||
* Authors: NocoBase Team.
|
|
||||||
*
|
|
||||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { useFieldSchema, useForm } from '@formily/react';
|
|
||||||
import { AIEmployeeChatContext } from './AIEmployeeChatProvider';
|
|
||||||
import { EditOutlined } from '@ant-design/icons';
|
|
||||||
import { useT } from '../locale';
|
|
||||||
|
|
||||||
export const useDetailsAIEmployeeChatContext = () => {
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useFormAIEmployeeChatContext = (): AIEmployeeChatContext => {
|
|
||||||
const t = useT();
|
|
||||||
const fieldSchema = useFieldSchema();
|
|
||||||
const form = useForm();
|
|
||||||
return {
|
|
||||||
attachments: {
|
|
||||||
formSchema: {
|
|
||||||
title: t('Current form'),
|
|
||||||
type: 'uiSchema',
|
|
||||||
description: 'The JSON schema of the form',
|
|
||||||
content: fieldSchema.parent.parent['x-uid'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
setFormValues: {
|
|
||||||
title: t('Set form values'),
|
|
||||||
icon: <EditOutlined />,
|
|
||||||
action: (content: string) => {
|
|
||||||
try {
|
|
||||||
form.setValues(JSON.parse(content));
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
@ -11,7 +11,7 @@ import actions, { Context, Next } from '@nocobase/actions';
|
|||||||
import PluginAIServer from '../plugin';
|
import PluginAIServer from '../plugin';
|
||||||
import { Database, Model } from '@nocobase/database';
|
import { Database, Model } from '@nocobase/database';
|
||||||
import { concat } from '@langchain/core/utils/stream';
|
import { concat } from '@langchain/core/utils/stream';
|
||||||
import { LLMProvider } from '../../../server';
|
import { LLMProvider } from '../llm-providers/provider';
|
||||||
import { parseResponseMessage } from '../utils';
|
import { parseResponseMessage } from '../utils';
|
||||||
|
|
||||||
async function parseUISchema(ctx: Context, content: string) {
|
async function parseUISchema(ctx: Context, content: string) {
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
import { ToolOptions } from '../manager/ai-manager';
|
import { ToolOptions } from '../manager/ai-manager';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import PluginAIServer from '../plugin';
|
|
||||||
import PluginWorkflowServer, { Processor, EXECUTION_STATUS } from '@nocobase/plugin-workflow';
|
import PluginWorkflowServer, { Processor, EXECUTION_STATUS } from '@nocobase/plugin-workflow';
|
||||||
import { Context } from '@nocobase/actions';
|
import { Context } from '@nocobase/actions';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user