SYMBOL INDEX (152 symbols across 16 files) FILE: browser.py class Browser (line 15) | class Browser: method __init__ (line 18) | def __init__(self, proxy: str = None) -> None: method create_driver (line 22) | def create_driver(self): method wait_for_page_load (line 48) | def wait_for_page_load(self, timeout=5): method full_text (line 53) | def full_text(self, soup: BeautifulSoup) -> str: method get_image_file_size (line 57) | def get_image_file_size(self, img_url: str) -> int: method get_the_image (line 67) | def get_the_image(self, soup: BeautifulSoup, base_url: str) -> str: method get_headline_image (line 102) | def get_headline_image(self, soup: BeautifulSoup) -> str: method webpage_content (line 109) | def webpage_content(self, url: str, get_image: bool = True) -> tuple: FILE: chatbot.py class Chatbot (line 22) | class Chatbot(): method __init__ (line 25) | def __init__(self, config: config.Config, wcfw: WcfWrapper, oaiw: open... method start_main_loop (line 52) | def start_main_loop(self) -> None: method run_wxmsg (line 74) | def run_wxmsg(self, msg:WxMsg): method _filter_preprocess_wxmsg (line 165) | def _filter_preprocess_wxmsg(self, msg:WxMsg) -> str: method _match_admin_cmd (line 261) | def _match_admin_cmd(self, content:str) -> Tuple[str, config.AdminCmd]: method process_admin_cmd (line 278) | def process_admin_cmd(self, content:str, receiver:str, at_list:str) ->... method set_preset (line 341) | def set_preset(self, chatid:str, pr_name:str) -> bool: method help_msg (line 357) | def help_msg(self, chatid:str) -> str: method preprocess_video (line 381) | def preprocess_video(self, video_file:str) -> tuple[str, list]: FILE: common.py class ContentType (line 18) | class ContentType(Enum): class ChatMsg (line 29) | class ChatMsg: method __init__ (line 31) | def __init__(self, type:ContentType, content:str) -> None: function now_str (line 42) | def now_str() -> str: function timestamp (line 45) | def timestamp() -> str: function logger (line 49) | def logger() -> logging.Logger: function get_path (line 53) | def get_path(folder:str) -> pathlib.Path: function temp_file (line 66) | def temp_file(name:str) -> str: function temp_dir (line 70) | def temp_dir() -> str: function wait_for_file (line 74) | def wait_for_file(file:str, duration:float = 3) -> bool: function download_file (line 94) | def download_file(url:str, filename:str, proxy:str = None) -> int: function error_info (line 125) | def error_info(e:Exception) -> str: function error_trace (line 136) | def error_trace(e:Exception) -> str: FILE: config.py class AdminCmd (line 9) | class AdminCmd(Enum): method description (line 21) | def description(self): class Config (line 36) | class Config(object): method __init__ (line 62) | def __init__(self, cfg:str) -> None: method _load_file (line 78) | def _load_file(self, file) -> dict: method _load_admin_config (line 86) | def _load_admin_config(self): method load_config (line 100) | def load_config(self): FILE: live_tools.py class LiveSite (line 16) | class LiveSite(Enum): class BiliApi (line 23) | class BiliApi: method get_mixin_key (line 34) | def get_mixin_key(self, orig: str): method encode_wbi (line 38) | def encode_wbi(self, params: dict, img_key: str, sub_key: str): method get_wbi_keys (line 55) | def get_wbi_keys(self) -> tuple[str, str]: method code_query (line 87) | def code_query(self, base_url:str, param_dict:dict) -> str: method get_live_data (line 94) | def get_live_data(self, room_id: str) -> dict: method get_user_card (line 117) | def get_user_card(self, uid:str) -> dict: class DouyuApi (line 138) | class DouyuApi: method __init__ (line 141) | def __init__(self, timeout:int=5) -> None: method get_live_data (line 146) | def get_live_data(self, room_id: str) -> dict: class LiveMonitor (line 165) | class LiveMonitor: method __init__ (line 167) | def __init__(self, config_dict:dict, wcfw:wcf_wrapper.WcfWrapper): method load_config (line 185) | def load_config(self, cfg_dict:dict): method add_monitor (line 200) | def add_monitor(self, site:LiveSite, roomid: str, chatid:str): method remove_monitor (line 210) | def remove_monitor(self, site:LiveSite, roomid: str, chatid:str): method run_monitor (line 218) | def run_monitor(self): method process_monitor (line 230) | def process_monitor(self, site:LiveSite, roomid:str, chat_list:list): FILE: main.py function main (line 18) | def main(cfg:str): function load_tools (line 51) | def load_tools(cfg:config.Config, oaiw:openai_wrapper.OpenAIWrapper) -> ... FILE: openai_wrapper.py class OpenAIWrapper (line 19) | class OpenAIWrapper: method __init__ (line 27) | def __init__(self, cfg:config.Config) -> None: method load_config (line 43) | def load_config(self): method add_tools (line 64) | def add_tools(self, tools:dict[str, toolbase.ToolBase]): method tools_help (line 70) | def tools_help(self) -> str: method create_openai_client (line 78) | def create_openai_client(self) -> OpenAI: method assistant_id (line 95) | def assistant_id(self) -> str: method get_thread (line 134) | def get_thread(self, chatid:str) -> str: method set_chat_prompt (line 148) | def set_chat_prompt(self, chatid:str, prompt:str): method clear_chat_prompt (line 152) | def clear_chat_prompt(self, chatid:str): method clear_chat_thread (line 156) | def clear_chat_thread(self, chatid:str): method upload_file (line 163) | def upload_file(self, filename:str, purpose:str="assistants") -> str: method run_msg (line 186) | def run_msg(self, chatid:str, method _process_new_msgs (line 298) | def _process_new_msgs(self, thread_id, last_msg_id, callback_msg:MSG_C... method _call_tool (line 321) | def _call_tool(self, name:str, arguments:str, callback_msg:MSG_CALLBAC... method text_to_image (line 337) | def text_to_image(self, prompt:str, quality:str=None) -> str: method tts (line 363) | def tts(self, text:str) -> str: method audio_trans (line 383) | def audio_trans(self, file:str) -> str: method download_openai_file (line 401) | def download_openai_file(self, file_id:str, name_override:str = None) ... FILE: preset.py class Preset (line 7) | class Preset(): method __init__ (line 13) | def __init__(self, name:str, desc:str, sys_prompt:str, msg_format:str)... method construct_msg (line 19) | def construct_msg(self, msg:str, wxcode:str, nickname:str) -> str: function read_preset (line 31) | def read_preset(name:str) -> Preset: function list_preset (line 53) | def list_preset() -> str: function get_default_preset (line 64) | def get_default_preset() -> Preset: FILE: tools/tool_audio_transcript.py class Tool_audio_transcript (line 4) | class Tool_audio_transcript(ToolBase): method __init__ (line 8) | def __init__(self, config: Config, oaiw:OpenAIWrapper) -> None: method name (line 14) | def name(self) -> str: method desc (line 18) | def desc(self) -> str: method function_json (line 22) | def function_json(self) -> dict: method process_toolcall (line 39) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... FILE: tools/tool_bing_search.py class Tool_bing_search (line 5) | class Tool_bing_search(ToolBase): method name (line 9) | def name(self) -> str: method desc (line 13) | def desc(self) -> str: method function_json (line 17) | def function_json(self) -> dict: method validate_config (line 38) | def validate_config(self) -> bool: method process_toolcall (line 49) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... FILE: tools/tool_browse_link.py class Tool_browse_link (line 4) | class Tool_browse_link(ToolBase): method name (line 10) | def name(self) -> str: method desc (line 14) | def desc(self) -> str: method function_json (line 18) | def function_json(self) -> dict: method process_toolcall (line 36) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... FILE: tools/tool_mahjong_agari.py class Tool_mahjong_agari (line 143) | class Tool_mahjong_agari(ToolBase): method name (line 147) | def name(self) -> str: method desc (line 151) | def desc(self) -> str: method function_json (line 155) | def function_json(self) -> dict: method process_toolcall (line 201) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... function yaku_cn_name (line 253) | def yaku_cn_name(yaku:Yaku) -> str: function wind_to_str (line 267) | def wind_to_str(wind): function str_to_wind (line 280) | def str_to_wind(wind_str:str): FILE: tools/tool_text_to_image.py class Tool_text_to_image (line 5) | class Tool_text_to_image(ToolBase): method __init__ (line 9) | def __init__(self, config:Config, oaiw:OpenAIWrapper) -> None: method name (line 15) | def name(self) -> str: method desc (line 19) | def desc(self) -> str: method function_json (line 23) | def function_json(self) -> dict: method process_toolcall (line 46) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... FILE: tools/tool_text_to_speech.py class Tool_text_to_speech (line 4) | class Tool_text_to_speech(ToolBase): method __init__ (line 7) | def __init__(self, config:Config, oaiw:OpenAIWrapper) -> None: method name (line 13) | def name(self) -> str: method desc (line 17) | def desc(self) -> str: method function_json (line 21) | def function_json(self) -> dict: method process_toolcall (line 38) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... FILE: tools/toolbase.py class ToolBase (line 11) | class ToolBase(ABC): method __init__ (line 17) | def __init__(self, config:Config) -> None: method validate_config (line 25) | def validate_config(self) -> bool: method name (line 39) | def name(self) -> str: method desc (line 45) | def desc(self) -> str: method function_json (line 51) | def function_json(self) -> dict: method process_toolcall (line 56) | def process_toolcall(self, arguments:str, callback_msg:MSG_CALLBACK) -... FILE: wcf_wrapper.py class WcfWrapper (line 11) | class WcfWrapper: method __init__ (line 13) | def __init__(self) -> None: method __del__ (line 26) | def __del__(self): method read_contacts (line 29) | def read_contacts(self) -> dict: method msg_preview_str (line 37) | def msg_preview_str(self, msg:WxMsg) -> str: method wxid_to_contact (line 56) | def wxid_to_contact(self, wxid:str) -> dict: method wxid_to_nickname (line 65) | def wxid_to_nickname(self, wxid:str) -> str: method wxid_to_wxcode (line 77) | def wxid_to_wxcode(self, wxid:str) -> str: method get_msg (line 85) | def get_msg(self) -> WxMsg: method is_msg_at_me (line 103) | def is_msg_at_me(self, msg:WxMsg) -> bool: method get_msg_text (line 117) | def get_msg_text(self, msg:WxMsg) -> str: method get_content_type (line 132) | def get_content_type(self, msg:WxMsg) -> int: method get_refer_content (line 141) | def get_refer_content(self, msg:WxMsg) -> ChatMsg: method get_msg_from_db (line 235) | def get_msg_from_db(self, msgid:str) -> dict: method get_msg_extra (line 247) | def get_msg_extra(self, msgid:str, sample_extra:str) -> str: method downloaded_image (line 295) | def downloaded_image(self, main_name:str) -> str: method get_image (line 304) | def get_image(self, msgid:str, extra:str) -> str: method get_video (line 334) | def get_video(self, msgid:str, extra:str) -> str: method send_message (line 358) | def send_message(self, chat_msg:ChatMsg, receiver:str, at_list:str="")... method send_text (line 393) | def send_text(self, msg: str, receiver: str, at_list: str = "") -> int: method send_image (line 422) | def send_image(self, file:str, receiver:str) -> int: method send_file (line 428) | def send_file(self, file:str, receiver:str) -> int: method send_test_msg (line 434) | def send_test_msg(self, receiver:str) -> int: method search_msg (line 445) | def search_msg(self):