|
@@ -1,6 +1,6 @@
|
|
|
import { Injectable } from '@nestjs/common'
|
|
|
|
|
|
-import { RunPromptDto } from '@/dto/agent-server'
|
|
|
+import { RunPromptDto, FormatForPromptDto } from '@/dto/agent-server'
|
|
|
import { IAgentServerService } from '@/interface/agent-server.interface'
|
|
|
import { ServiceResponse } from '@/response/response.interface'
|
|
|
import { BusinessCode, HttpStatusCode } from '@/response/status-code.enum'
|
|
@@ -218,4 +218,26 @@ export class AgentServerService implements IAgentServerService {
|
|
|
data: data
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ async formatForPrompt({
|
|
|
+ content,
|
|
|
+ formatType
|
|
|
+ }: FormatForPromptDto): Promise<ServiceResponse<any>> {
|
|
|
+ const { code, data, msg } = await this.httpService.formatForPrompt({
|
|
|
+ content,
|
|
|
+ format_type: formatType
|
|
|
+ })
|
|
|
+ if (code !== HttpStatusCode.OK) {
|
|
|
+ return {
|
|
|
+ code: BusinessCode.BAD_REQUEST,
|
|
|
+ msg: msg || '格式化提示词失败',
|
|
|
+ data: null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ code: BusinessCode.SUCCESS,
|
|
|
+ msg: '格式化提示词成功',
|
|
|
+ data: data
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|