Skip to content

Commit 2fcfbce

Browse files
committed
onward
1 parent 1456aae commit 2fcfbce

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/common/src/dto/teach/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from './teach.dto';
22
export * from './teach-details.dto';
33
export * from './teach-response.dto';
44
export * from './teach-system-prompt.dto';
5+
export * from './teach-system-prompt-response.dto';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface TeachSystemPromptResponseDto {
2+
// can be empty
3+
response: string;
4+
}

src/teach/teach.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Body, Controller, Logger, Param, Post, Req, UseGuards } from '@nestjs/common';
2-
import { TeachDetailsDto, TeachDto, TeachResponseDto, TeachSystemPromptDto, Role } from '@poly/common';
2+
import { TeachDetailsDto, TeachDto, TeachResponseDto, TeachSystemPromptDto, TeachSystemPromptResponseDto, Role} from '@poly/common';
33
import { FunctionService } from 'function/function.service';
44
import { ApiKeyGuard } from 'auth/api-key-auth-guard.service';
55
import { ParseIdPipe } from 'pipe/parse-id.pipe';
@@ -25,9 +25,9 @@ export class TeachController {
2525

2626
@UseGuards(new ApiKeyGuard([Role.Admin]))
2727
@Post('/system-prompt')
28-
async teachSystemPrompt(@Req() req, @Body() body: TeachSystemPromptDto) {
28+
async teachSystemPrompt(@Req() req, @Body() body: TeachSystemPromptDto): Promise<TeachSystemPromptResponseDto> {
2929
await this.polyFunctionService.setSystemPrompt(req.user.id, body.prompt);
30-
return {"response": "Conversation cleared and new system prompt set!"}
30+
return {response: "Conversation cleared and new system prompt set!"}
3131
}
3232

3333
@UseGuards(ApiKeyGuard)

0 commit comments

Comments
 (0)