File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ def get_llm_settings(request: Request, languageModelName: str) -> Dict:
79
79
"value" : setting ,
80
80
"schema" : schema
81
81
}
82
+
82
83
83
84
84
85
@router .put ("/settings/{languageModelName}" )
@@ -119,7 +120,19 @@ def upsert_llm_setting(
119
120
# crete new collections
120
121
# (in case embedder is not configured, it will be changed automatically and aligned to vendor)
121
122
# TODO: should we take this feature away?
122
- ccat .load_memory ()
123
+ # Exception handling in case an incorrect key is loaded.
124
+ try :
125
+ ccat .load_memory ()
126
+ except Exception as e :
127
+ log .error (e )
128
+ crud .delete_settings_by_category (category = LLM_SELECTED_CATEGORY )
129
+ crud .delete_settings_by_category (category = LLM_CATEGORY )
130
+ raise HTTPException (
131
+ status_code = 400 ,
132
+ detail = {
133
+ "error" : str (e )
134
+ }
135
+ )
123
136
# recreate tools embeddings
124
137
ccat .mad_hatter .find_plugins ()
125
138
ccat .mad_hatter .embed_tools ()
You can’t perform that action at this time.
0 commit comments