Spaces:
Sleeping
Sleeping
Commit ·
43cbde3
1
Parent(s): be9ab33
history display
Browse files- app.py +3 -2
- core_logic.py +8 -1
app.py
CHANGED
|
@@ -13,13 +13,14 @@ from storage import save_chat, load_history, get_chat_content, get_secret_passwo
|
|
| 13 |
from git_agent import manage_github_repo
|
| 14 |
import os
|
| 15 |
|
| 16 |
-
|
| 17 |
print("==================================================")
|
| 18 |
print(f"DEBUG: HF_TOKEN exists? {bool(os.getenv('HF_TOKEN'))}")
|
| 19 |
print(f"DEBUG: APP_PASSWORD exists? {bool(os.getenv('APP_PASSWORD'))}")
|
| 20 |
if os.getenv('APP_PASSWORD'):
|
| 21 |
print(f"DEBUG: APP_PASSWORD length is {len(os.getenv('APP_PASSWORD'))}")
|
| 22 |
print("==================================================")
|
|
|
|
| 23 |
|
| 24 |
with gr.Blocks() as demo:
|
| 25 |
chat_id_state = gr.State("")
|
|
@@ -32,7 +33,7 @@ with gr.Blocks() as demo:
|
|
| 32 |
with gr.Column(visible=True) as login_layout:
|
| 33 |
gr.Markdown("## 🔐 CoderG Enterprise Access Gate")
|
| 34 |
gr.Markdown(
|
| 35 |
-
"⚠️ **Workspace Notice:** Please leave the password field blank
|
| 36 |
)
|
| 37 |
password_input = gr.Textbox(
|
| 38 |
label="Security Access Password",
|
|
|
|
| 13 |
from git_agent import manage_github_repo
|
| 14 |
import os
|
| 15 |
|
| 16 |
+
"""
|
| 17 |
print("==================================================")
|
| 18 |
print(f"DEBUG: HF_TOKEN exists? {bool(os.getenv('HF_TOKEN'))}")
|
| 19 |
print(f"DEBUG: APP_PASSWORD exists? {bool(os.getenv('APP_PASSWORD'))}")
|
| 20 |
if os.getenv('APP_PASSWORD'):
|
| 21 |
print(f"DEBUG: APP_PASSWORD length is {len(os.getenv('APP_PASSWORD'))}")
|
| 22 |
print("==================================================")
|
| 23 |
+
"""
|
| 24 |
|
| 25 |
with gr.Blocks() as demo:
|
| 26 |
chat_id_state = gr.State("")
|
|
|
|
| 33 |
with gr.Column(visible=True) as login_layout:
|
| 34 |
gr.Markdown("## 🔐 CoderG Enterprise Access Gate")
|
| 35 |
gr.Markdown(
|
| 36 |
+
"⚠️ **Workspace Notice:** Please leave the password field blank and press the **Unlock Workspace Environment** to proceed directly to the workspace."
|
| 37 |
)
|
| 38 |
password_input = gr.Textbox(
|
| 39 |
label="Security Access Password",
|
core_logic.py
CHANGED
|
@@ -169,7 +169,14 @@ def chat_function(message, history):
|
|
| 169 |
|
| 170 |
messages.append({"role": "user", "content": prompt})
|
| 171 |
|
| 172 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
try:
|
| 174 |
completion = client.chat.completions.create(
|
| 175 |
model=model,
|
|
|
|
| 169 |
|
| 170 |
messages.append({"role": "user", "content": prompt})
|
| 171 |
|
| 172 |
+
# =============================================================================================
|
| 173 |
+
# 🎯DIAGNOSTICS FOR THE LENGTH OF LIST PAYLOAD BEING SENT TO THE PROVIDER, WHICH IT CAN HANDLE
|
| 174 |
+
# =============================================================================================
|
| 175 |
+
print("\n==================================================")
|
| 176 |
+
print(f"📊 Sending {len(messages)} raw message blocks to the {model}.")
|
| 177 |
+
print("==================================================\n")
|
| 178 |
+
# ====================================================================
|
| 179 |
+
|
| 180 |
try:
|
| 181 |
completion = client.chat.completions.create(
|
| 182 |
model=model,
|