feat: add governed chat console
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Body, Controller, Get, Headers, Inject, Post } from '@nestjs/common';
|
||||
import { ok } from '../common/api-response.js';
|
||||
import { actorFromHeaders } from '../common/auth-context.js';
|
||||
import { ChatAskInput, ChatService } from './chat.service.js';
|
||||
|
||||
@Controller('api/v1/chat')
|
||||
export class ChatController {
|
||||
constructor(@Inject(ChatService) private readonly svc: ChatService) {}
|
||||
|
||||
@Post('ask')
|
||||
ask(@Headers() headers: Record<string, string | string[] | undefined>, @Body() body: ChatAskInput) {
|
||||
return ok(this.svc.ask(body, actorFromHeaders(headers)));
|
||||
}
|
||||
|
||||
@Get('audit/verify')
|
||||
verifyAudit() {
|
||||
return ok(this.svc.verifyAudit());
|
||||
}
|
||||
|
||||
@Get('actions')
|
||||
actions(@Headers() headers: Record<string, string | string[] | undefined>) {
|
||||
return ok(this.svc.listActions(actorFromHeaders(headers)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user