完成Help Scout渠道的完整功能实现,包含API客户端、webhook处理、轮询同步、自动回复、工单标签分配、客户资料管理等核心能力,附带完整的配置Schema与插件元信息
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
|
|
class HelpScoutStreaming:
|
|
streaming_mode = "block"
|
|
preview_stream_throttle_ms = 200
|
|
preview_min_initial_chars = 20
|
|
|
|
block_streaming_enabled = True
|
|
block_streaming_break = "paragraph"
|
|
block_streaming_chunk_min_chars = 200
|
|
block_streaming_chunk_max_chars = 1500
|
|
block_streaming_chunk_break_preference = "paragraph"
|
|
block_streaming_coalesce_defaults = {
|
|
"min_chars": 100,
|
|
"max_chars": 600,
|
|
"idle_ms": 500,
|
|
}
|
|
|
|
def create_draft_stream_session(self, target_id: str) -> object:
|
|
conversation_id = target_id.split(":")[-1] if ":" in target_id else target_id
|
|
return {
|
|
"target_id": target_id,
|
|
"conversation_id": int(conversation_id),
|
|
"mode": "block",
|
|
"draft_base": "",
|
|
}
|
|
|
|
def create_block_chunker(self) -> object:
|
|
return {
|
|
"mode": "paragraph",
|
|
"min_chars": 200,
|
|
"max_chars": 1500,
|
|
"break_preference": "paragraph",
|
|
}
|