mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-19 13:23:16 +08:00
增加日志信息
This commit is contained in:
parent
55b32b29fe
commit
9dd2d9bbf1
@ -237,8 +237,10 @@ class RESTFulOpenAIBootstrapBaseWeb(OpenAIBootstrapBaseWeb):
|
||||
return await openai_embedding_text(response)
|
||||
|
||||
except ValueError as e:
|
||||
logger.error(f"Error while creating embeddings: {str(e)}")
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
|
||||
except InvokeError as e:
|
||||
logger.error(f"Error while creating embeddings: {str(e)}")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)
|
||||
)
|
||||
@ -295,9 +297,11 @@ class RESTFulOpenAIBootstrapBaseWeb(OpenAIBootstrapBaseWeb):
|
||||
else:
|
||||
return await openai_chat_completion(response)
|
||||
except ValueError as e:
|
||||
logger.error(f"Error while creating chat completion: {str(e)}")
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
|
||||
|
||||
except InvokeError as e:
|
||||
logger.error(f"Error while creating chat completion: {str(e)}")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user