|
@@ -34,7 +34,7 @@ public class LlmController {
|
|
|
|
|
|
@PostMapping(AiConstants.LLM_CHAT_PATH)
|
|
@PostMapping(AiConstants.LLM_CHAT_PATH)
|
|
public ChatResult chat(@RequestAttribute AccessOrg accessOrg,
|
|
public ChatResult chat(@RequestAttribute AccessOrg accessOrg,
|
|
- @RequestHeader(AiConstants.LLM_APP_TYPE_HEADER) LlmAppType type,
|
|
|
|
|
|
+ @RequestHeader(AiConstants.LLM_APP_TYPE) LlmAppType type,
|
|
@RequestBody @Validated ChatRequest request) throws Exception {
|
|
@RequestBody @Validated ChatRequest request) throws Exception {
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
if (config == null || config.getLeftCount() <= 0) {
|
|
if (config == null || config.getLeftCount() <= 0) {
|
|
@@ -48,7 +48,7 @@ public class LlmController {
|
|
|
|
|
|
@PostMapping(AiConstants.LLM_CHAT_TEMPLATE_PATH)
|
|
@PostMapping(AiConstants.LLM_CHAT_TEMPLATE_PATH)
|
|
public ChatResult chatTemplate(@RequestAttribute AccessOrg accessOrg,
|
|
public ChatResult chatTemplate(@RequestAttribute AccessOrg accessOrg,
|
|
- @RequestHeader(AiConstants.LLM_APP_TYPE_HEADER) LlmAppType type, @RequestBody Object param)
|
|
|
|
|
|
+ @RequestHeader(AiConstants.LLM_APP_TYPE) LlmAppType type, @RequestBody Object param)
|
|
throws Exception {
|
|
throws Exception {
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
if (config == null || config.getLeftCount() <= 0) {
|
|
if (config == null || config.getLeftCount() <= 0) {
|
|
@@ -76,7 +76,7 @@ public class LlmController {
|
|
|
|
|
|
@PostMapping(AiConstants.LLM_BALANCE_PATH)
|
|
@PostMapping(AiConstants.LLM_BALANCE_PATH)
|
|
public LlmAppBalance balance(@RequestAttribute AccessOrg accessOrg,
|
|
public LlmAppBalance balance(@RequestAttribute AccessOrg accessOrg,
|
|
- @RequestHeader(AiConstants.LLM_APP_TYPE_HEADER) LlmAppType type) {
|
|
|
|
|
|
+ @RequestHeader(AiConstants.LLM_APP_TYPE) LlmAppType type) {
|
|
LlmAppBalance balance = new LlmAppBalance();
|
|
LlmAppBalance balance = new LlmAppBalance();
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
if (config != null) {
|
|
if (config != null) {
|
|
@@ -88,7 +88,7 @@ public class LlmController {
|
|
|
|
|
|
@PostMapping(AiConstants.LLM_PROMPT_TEMPLATE_PATH)
|
|
@PostMapping(AiConstants.LLM_PROMPT_TEMPLATE_PATH)
|
|
public PromptTemplate getPromptTemplate(@RequestAttribute AccessOrg accessOrg,
|
|
public PromptTemplate getPromptTemplate(@RequestAttribute AccessOrg accessOrg,
|
|
- @RequestHeader(AiConstants.LLM_APP_TYPE_HEADER) LlmAppType type) {
|
|
|
|
|
|
+ @RequestHeader(AiConstants.LLM_APP_TYPE) LlmAppType type) {
|
|
PromptTemplate template = new PromptTemplate();
|
|
PromptTemplate template = new PromptTemplate();
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
LlmOrgConfig config = llmOrgConfigService.findByOrgAndAppType(accessOrg.getOrg().getId(), type);
|
|
if (config != null) {
|
|
if (config != null) {
|