Raiff1982 commited on
Commit
4cd4274
·
verified ·
1 Parent(s): dca483b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -35,12 +35,20 @@ def codette_chat(message, history, consent=True, dynamic_rec=True, use_finetune=
35
  )
36
  return response['choices'][0]['message']['content']
37
  except Exception as e:
 
 
 
 
 
 
 
 
38
  fallback = codette_cqure.recursive_universal_reasoning(
39
  message,
40
  user_consent=consent,
41
  dynamic_recursion=dynamic_rec
42
  )
43
- return f"[Error calling FT model]: {str(e)}\n\nFallback response:\n{fallback}"
44
  else:
45
  return codette_cqure.recursive_universal_reasoning(
46
  message,
 
35
  )
36
  return response['choices'][0]['message']['content']
37
  except Exception as e:
38
+ err_msg = str(e)
39
+ if "Response ended prematurely" in err_msg:
40
+ err_note = "[FT model network timeout. Using local core to continue the conversation.]"
41
+ internal_flag = "⚠️ Potential proxy interference or timeout from OpenAI stream detected."
42
+ else:
43
+ err_note = f"[Error calling FT model]: {err_msg}"
44
+ internal_flag = "⚠️ Unknown FT error occurred."
45
+
46
  fallback = codette_cqure.recursive_universal_reasoning(
47
  message,
48
  user_consent=consent,
49
  dynamic_recursion=dynamic_rec
50
  )
51
+ return f"{err_note}\n{internal_flag}\n\nCodette's fallback:\n{fallback}"
52
  else:
53
  return codette_cqure.recursive_universal_reasoning(
54
  message,