perf: logger (#186)
* feat: finish response * perf: logger * docs * perf: log * docs
This commit is contained in:
@@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { connectToDatabase } from '@/service/mongo';
|
||||
import { authUser, authApp, authShareChat, AuthUserTypeEnum } from '@/service/utils/auth';
|
||||
import { sseErrRes, jsonRes } from '@/service/response';
|
||||
import { withNextCors } from '@/service/utils/tools';
|
||||
import { addLog, withNextCors } from '@/service/utils/tools';
|
||||
import { ChatRoleEnum, ChatSourceEnum, sseResponseEventEnum } from '@/constants/chat';
|
||||
import {
|
||||
dispatchHistory,
|
||||
@@ -181,7 +181,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
||||
});
|
||||
}
|
||||
|
||||
console.log(`finish time: ${(Date.now() - startTime) / 1000}s`);
|
||||
addLog.info(`completions running time: ${(Date.now() - startTime) / 1000}s`);
|
||||
|
||||
if (stream) {
|
||||
sseResponse({
|
||||
@@ -351,6 +351,7 @@ export async function dispatchModules({
|
||||
res,
|
||||
stream,
|
||||
detail,
|
||||
outputs: module.outputs,
|
||||
userOpenaiAccount: user?.openaiAccount,
|
||||
...params
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ import NodeCard from '../modules/NodeCard';
|
||||
import { FlowModuleItemType } from '@/types/flow';
|
||||
import Container from '../modules/Container';
|
||||
import RenderInput from '../render/RenderInput';
|
||||
import RenderOutput from '../render/RenderOutput';
|
||||
|
||||
const NodeAnswer = ({ data }: NodeProps<FlowModuleItemType>) => {
|
||||
const { moduleId, inputs, outputs, onChangeNode } = data;
|
||||
@@ -11,6 +12,7 @@ const NodeAnswer = ({ data }: NodeProps<FlowModuleItemType>) => {
|
||||
<NodeCard minW={'400px'} {...data}>
|
||||
<Container borderTop={'2px solid'} borderTopColor={'myGray.200'}>
|
||||
<RenderInput moduleId={moduleId} onChangeNode={onChangeNode} flowInputList={inputs} />
|
||||
<RenderOutput onChangeNode={onChangeNode} moduleId={moduleId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
</NodeCard>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user