Spaces:
Build error
Build error
Commit ·
22cc587
1
Parent(s): 3a91121
README.md
CHANGED
|
@@ -35,6 +35,7 @@ pip install -r requirements.txt
|
|
| 35 |
|
| 36 |
# Configure the environment variables
|
| 37 |
|
|
|
|
| 38 |
# Usage
|
| 39 |
Run the following command to start the chat interface.
|
| 40 |
|
|
|
|
| 35 |
|
| 36 |
# Configure the environment variables
|
| 37 |
|
| 38 |
+
|
| 39 |
# Usage
|
| 40 |
Run the following command to start the chat interface.
|
| 41 |
|
app.py
CHANGED
|
@@ -160,14 +160,14 @@ class ChainlitUserProxyAgent(UserProxyAgent):
|
|
| 160 |
silent=silent,
|
| 161 |
)
|
| 162 |
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
|
| 172 |
@cl.on_chat_resume
|
| 173 |
async def on_chat_resume(conversation: ConversationDict):
|
|
@@ -181,8 +181,8 @@ async def on_chat_resume(conversation: ConversationDict):
|
|
| 181 |
@cl.on_chat_start
|
| 182 |
async def on_chat_start():
|
| 183 |
try:
|
| 184 |
-
|
| 185 |
-
|
| 186 |
|
| 187 |
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
|
| 188 |
proof_reader = ChainlitAssistantAgent(
|
|
|
|
| 160 |
silent=silent,
|
| 161 |
)
|
| 162 |
|
| 163 |
+
@cl.oauth_callback
|
| 164 |
+
def oauth_callback(
|
| 165 |
+
provider_id: str,
|
| 166 |
+
token: str,
|
| 167 |
+
raw_user_data: Dict[str, str],
|
| 168 |
+
default_app_user: cl.AppUser,
|
| 169 |
+
) -> Optional[cl.AppUser]:
|
| 170 |
+
return default_app_user
|
| 171 |
|
| 172 |
@cl.on_chat_resume
|
| 173 |
async def on_chat_resume(conversation: ConversationDict):
|
|
|
|
| 181 |
@cl.on_chat_start
|
| 182 |
async def on_chat_start():
|
| 183 |
try:
|
| 184 |
+
app_user = cl.user_session.get("user")
|
| 185 |
+
await cl.Message(f"Hello {app_user.username}").send()
|
| 186 |
|
| 187 |
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
|
| 188 |
proof_reader = ChainlitAssistantAgent(
|