Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -109,7 +109,7 @@ llm = ChatOpenAI(
|
|
| 109 |
max_tokens=None,
|
| 110 |
timeout=None,
|
| 111 |
max_retries=5,
|
| 112 |
-
api_key="gl-
|
| 113 |
base_url="https://aibe.mygreatlearning.com/openai/v1"
|
| 114 |
)
|
| 115 |
|
|
@@ -521,7 +521,7 @@ def chatbot_interface():
|
|
| 521 |
[f"{turn['role'].capitalize()}: {turn['content']}" for turn in st.session_state.conversation_history]
|
| 522 |
)
|
| 523 |
|
| 524 |
-
|
| 525 |
# Pass the history to the agent
|
| 526 |
# response = agent_executor.invoke({"input": conversation_input})
|
| 527 |
response = agent_executor.invoke({"input": conversation_input})
|
|
@@ -538,7 +538,6 @@ def chatbot_interface():
|
|
| 538 |
|
| 539 |
except Exception as e:
|
| 540 |
st.write("Blocked by content policy \n", e )
|
| 541 |
-
|
| 542 |
|
| 543 |
def main():
|
| 544 |
# Check if the user is logged in
|
|
|
|
| 109 |
max_tokens=None,
|
| 110 |
timeout=None,
|
| 111 |
max_retries=5,
|
| 112 |
+
api_key="gl-U2FsdGVkX1/DTLQlsmj+RdJjPy3igB9qINuaX940XtJ0CPnGc/5sbBkPKah/C829", # if you prefer to pass api key in directly instaed of using env vars
|
| 113 |
base_url="https://aibe.mygreatlearning.com/openai/v1"
|
| 114 |
)
|
| 115 |
|
|
|
|
| 521 |
[f"{turn['role'].capitalize()}: {turn['content']}" for turn in st.session_state.conversation_history]
|
| 522 |
)
|
| 523 |
|
| 524 |
+
try:
|
| 525 |
# Pass the history to the agent
|
| 526 |
# response = agent_executor.invoke({"input": conversation_input})
|
| 527 |
response = agent_executor.invoke({"input": conversation_input})
|
|
|
|
| 538 |
|
| 539 |
except Exception as e:
|
| 540 |
st.write("Blocked by content policy \n", e )
|
|
|
|
| 541 |
|
| 542 |
def main():
|
| 543 |
# Check if the user is logged in
|