fixed team chats

This commit is contained in:
Iyeoluwa Akinrinola
2025-05-16 18:03:15 +01:00
parent 463923278a
commit 730009ae87
21 changed files with 1655 additions and 63 deletions
+10
View File
@@ -69,6 +69,11 @@ class ChatService:
openwebui_channel_id = None
if is_team_chat:
try:
print("=" * 50)
print(f"Creating team chat with title: {chat_title}")
print(f"OpenWebUI URL: {openwebui_channels.openwebui_url}")
print(f"OpenWebUI API Key: {openwebui_channels.openwebui_api_key[:5]}..." if openwebui_channels.openwebui_api_key else "No API key")
# Create a channel in OpenWebUI
channel_response = openwebui_channels.create_channel(
name=chat_title,
@@ -76,13 +81,18 @@ class ChatService:
is_private=True # Team chats are private by default
)
print(f"Channel response: {json.dumps(channel_response, indent=2) if channel_response else 'None'}")
if channel_response:
openwebui_channel_id = channel_response.get('id')
print(f"Created OpenWebUI channel with ID: {openwebui_channel_id}")
else:
print("Failed to create OpenWebUI channel, continuing with local team chat only")
print("=" * 50)
except Exception as e:
print("=" * 50)
print(f"Error creating OpenWebUI channel: {str(e)}")
print("=" * 50)
# Create chat data
self.chats[chat_id] = {