feat: add hermes dashboard config endpoint to admin-ai-chat
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 12s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 12s
This commit is contained in:
parent
f2d1c16299
commit
2b0bc92ebb
@ -1,5 +1,5 @@
|
|||||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||||
import { Controller, Post, Body, UseGuards } from '@nestjs/common';
|
import { Controller, Post, Get, Body, UseGuards } from '@nestjs/common';
|
||||||
import { AdminAiChatService } from './admin-ai-chat.service';
|
import { AdminAiChatService } from './admin-ai-chat.service';
|
||||||
import { AiChatDto } from './dto/ai-chat.dto';
|
import { AiChatDto } from './dto/ai-chat.dto';
|
||||||
import { AdminAuthGuard } from '../../common/guards/admin-auth.guard';
|
import { AdminAuthGuard } from '../../common/guards/admin-auth.guard';
|
||||||
@ -20,4 +20,12 @@ export class AdminAiChatController {
|
|||||||
async chat(@Body() dto: AiChatDto) {
|
async chat(@Body() dto: AiChatDto) {
|
||||||
return this.aiChatService.chat(dto);
|
return this.aiChatService.chat(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('dashboard')
|
||||||
|
@AdminRoles('SUPER_ADMIN' as AdminRole)
|
||||||
|
@ApiBearerAuth()
|
||||||
|
@ApiOperation({ summary: '获取 Hermes Agent Dashboard 访问信息' })
|
||||||
|
getDashboard() {
|
||||||
|
return this.aiChatService.getDashboardConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -34,4 +34,12 @@ export class AdminAiChatService {
|
|||||||
usage: result.usage,
|
usage: result.usage,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDashboardConfig() {
|
||||||
|
return {
|
||||||
|
url: 'http://10.2.0.7:9119',
|
||||||
|
token: 'v8dAkvcsHaHe_yok5kjO0QErKtogQcq3IKaJT8PNczQ',
|
||||||
|
description: 'Hermes Agent Dashboard — 4核4G 上的 AI Agent,可执行服务器管理、文件操作等高级任务',
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user