调整接口分享

master
masong 3 months ago
parent 7f719939fd
commit 839f36d079
  1. 11
      packages/dbgpt-app/src/dbgpt_app/openapi/user_share/api_user_share.py

@ -56,6 +56,7 @@ def get_chat_flow() -> FlowService:
async def chat_app_api(api_key: str,
app_code: str,
user_input: str,
flow_service: FlowService = Depends(get_chat_flow),
):
@ -66,7 +67,8 @@ async def chat_completions(
api_key: str,
app_code: str,
user_input: str,
flow_service: FlowService = Depends(get_chat_flow),
random: str,
flow_service: FlowService = Depends(get_chat_flow)
):
logger.info("外部接口调用")
@ -87,8 +89,9 @@ async def chat_completions(
if app_code not in user_share.app_ids:
return Result.failed(msg="无此应用编码,请与管理员联系")
# 根据app_code 查看详细信息
conv_uid = user_share.id
if(random is None):
random = uuid.uuid1()
conv_uid = random
team_context = ""
gpt_app_detail = gpts_dao.app_detail(app_code)
gpt_app = gpts_dao.get_app_by_code(app_code)
@ -100,7 +103,7 @@ async def chat_completions(
llm_strategy = "";
if gpt_app_detail.details[0].llm_strategy == 'priority':
#查询llm model
llm_strategy = json.loads(gpt_app_detail.details[0].llm_strategy_value[0])
llm_strategy = gpt_app_detail.details[0].llm_strategy_value[0]
else:
# 查询model

Loading…
Cancel
Save