mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-21 20:06:06 +00:00
fix: is_stream_output_supperted in webchat return
This commit is contained in:
@@ -51,6 +51,8 @@ class WebChatAdapter(msadapter.MessagePlatformAdapter):
|
|||||||
typing.Callable[[platform_events.Event, msadapter.MessagePlatformAdapter], None],
|
typing.Callable[[platform_events.Event, msadapter.MessagePlatformAdapter], None],
|
||||||
] = {}
|
] = {}
|
||||||
|
|
||||||
|
is_stream: bool
|
||||||
|
|
||||||
def __init__(self, config: dict, ap: app.Application, logger: EventLogger):
|
def __init__(self, config: dict, ap: app.Application, logger: EventLogger):
|
||||||
self.ap = ap
|
self.ap = ap
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
@@ -61,6 +63,8 @@ class WebChatAdapter(msadapter.MessagePlatformAdapter):
|
|||||||
|
|
||||||
self.bot_account_id = 'webchatbot'
|
self.bot_account_id = 'webchatbot'
|
||||||
|
|
||||||
|
self.is_stream = False
|
||||||
|
|
||||||
async def send_message(
|
async def send_message(
|
||||||
self,
|
self,
|
||||||
target_type: str,
|
target_type: str,
|
||||||
@@ -138,6 +142,9 @@ class WebChatAdapter(msadapter.MessagePlatformAdapter):
|
|||||||
queue.put(None)
|
queue.put(None)
|
||||||
|
|
||||||
return message_data.model_dump()
|
return message_data.model_dump()
|
||||||
|
|
||||||
|
async def is_stream_output_supported(self) -> bool:
|
||||||
|
return self.is_stream
|
||||||
|
|
||||||
def register_listener(
|
def register_listener(
|
||||||
self,
|
self,
|
||||||
@@ -172,8 +179,9 @@ class WebChatAdapter(msadapter.MessagePlatformAdapter):
|
|||||||
|
|
||||||
async def send_webchat_message(
|
async def send_webchat_message(
|
||||||
self, pipeline_uuid: str, session_type: str, message_chain_obj: typing.List[dict],
|
self, pipeline_uuid: str, session_type: str, message_chain_obj: typing.List[dict],
|
||||||
is_stream: bool = False,
|
is_stream: bool = False,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
|
self.is_stream = is_stream
|
||||||
"""发送调试消息到流水线"""
|
"""发送调试消息到流水线"""
|
||||||
if session_type == 'person':
|
if session_type == 'person':
|
||||||
use_session = self.webchat_person_session
|
use_session = self.webchat_person_session
|
||||||
|
|||||||
Reference in New Issue
Block a user