|
@@ -1,7 +1,13 @@
|
|
|
-import { Controller, Get, Query } from '@nestjs/common'
|
|
|
+import { Controller, Get, Query, Post, Body, Header } from '@nestjs/common'
|
|
|
import { ApiOperation, ApiTags } from '@nestjs/swagger'
|
|
|
|
|
|
-import { GetDialogueHistoryDto, GetBasePromptDto } from '@/dto/agent-server'
|
|
|
+import {
|
|
|
+ GetDialogueHistoryDto,
|
|
|
+ GetBasePromptDto,
|
|
|
+ GetUserProfileDto,
|
|
|
+ GetStaffProfileDto,
|
|
|
+ RunPromptDto
|
|
|
+} from '@/dto/agent-server'
|
|
|
|
|
|
import { AgentServerService } from './service/agent-server.service'
|
|
|
|
|
@@ -39,11 +45,17 @@ export class AgentServerController {
|
|
|
return this.agentServerService.listModels()
|
|
|
}
|
|
|
|
|
|
- // @Get('user/profile')
|
|
|
- // @ApiOperation({ summary: '获取用户信息' })
|
|
|
- // async getUserProfile(@Query('user_id') user_id: string) {
|
|
|
- // return this.agentServerService.getUserProfile(user_id)
|
|
|
- // }
|
|
|
+ @Get('user/profile')
|
|
|
+ @ApiOperation({ summary: '获取用户信息' })
|
|
|
+ async getUserProfile(@Query() query: GetUserProfileDto) {
|
|
|
+ return this.agentServerService.getUserProfile(query.userId)
|
|
|
+ }
|
|
|
+
|
|
|
+ @Get('staff/profile')
|
|
|
+ @ApiOperation({ summary: '获取客服信息' })
|
|
|
+ async getStaffProfile(@Query() query: GetStaffProfileDto) {
|
|
|
+ return this.agentServerService.getStaffProfile(query.staffId)
|
|
|
+ }
|
|
|
|
|
|
@Get('base-prompt')
|
|
|
@ApiOperation({ summary: '获取基础提示词' })
|
|
@@ -51,9 +63,10 @@ export class AgentServerController {
|
|
|
return this.agentServerService.getBasePrompt(query.scene)
|
|
|
}
|
|
|
|
|
|
- // @Get('run-prompt')
|
|
|
- // @ApiOperation({ summary: '运行提示词' })
|
|
|
- // async runPrompt(@Query() query: RunPromptDto) {
|
|
|
- // return this.agentServerService.runPrompt(query)
|
|
|
- // }
|
|
|
+ @Post('run-prompt')
|
|
|
+ @Header('Content-Type', 'application/json')
|
|
|
+ @ApiOperation({ summary: '运行提示词' })
|
|
|
+ async runPrompt(@Body() body: RunPromptDto) {
|
|
|
+ return this.agentServerService.runPrompt(body)
|
|
|
+ }
|
|
|
}
|