SYMBOL INDEX (1469 symbols across 160 files) FILE: agent/chat/service.py class ChatService (line 14) | class ChatService: method __init__ (line 24) | def __init__(self, agent_bridge): method run (line 30) | def run(self, query: str, session_id: str, send_chunk_fn: Callable[[di... method _persist_messages (line 190) | def _persist_messages(session_id: str, new_messages: list, channel_typ... class _StreamState (line 208) | class _StreamState: method __init__ (line 211) | def __init__(self): FILE: agent/memory/chunker.py class TextChunk (line 13) | class TextChunk: class TextChunker (line 20) | class TextChunker: method __init__ (line 23) | def __init__(self, max_tokens: int = 500, overlap_tokens: int = 50): method chunk_text (line 36) | def chunk_text(self, text: str) -> List[TextChunk]: method _split_long_line (line 114) | def _split_long_line(self, line: str, max_chars: int) -> List[str]: method _get_overlap_lines (line 121) | def _get_overlap_lines(self, lines: List[str], target_chars: int) -> L... method chunk_markdown (line 135) | def chunk_markdown(self, text: str) -> List[TextChunk]: FILE: agent/memory/config.py function _default_workspace (line 14) | def _default_workspace(): class MemoryConfig (line 21) | class MemoryConfig: method get_workspace (line 52) | def get_workspace(self) -> Path: method get_memory_dir (line 56) | def get_memory_dir(self) -> Path: method get_db_path (line 60) | def get_db_path(self) -> Path: method get_skills_dir (line 66) | def get_skills_dir(self) -> Path: method get_agent_workspace (line 70) | def get_agent_workspace(self, agent_name: Optional[str] = None) -> Path: function get_default_memory_config (line 90) | def get_default_memory_config() -> MemoryConfig: function set_global_memory_config (line 104) | def set_global_memory_config(config: MemoryConfig): FILE: agent/memory/conversation_store.py function _is_visible_user_message (line 63) | def _is_visible_user_message(content: Any) -> bool: function _extract_display_text (line 78) | def _extract_display_text(content: Any) -> str: function _extract_tool_calls (line 95) | def _extract_tool_calls(content: Any) -> List[Dict[str, Any]]: function _extract_tool_results (line 109) | def _extract_tool_results(content: Any) -> Dict[str, str]: function _group_into_display_turns (line 130) | def _group_into_display_turns( class ConversationStore (line 223) | class ConversationStore: method __init__ (line 233) | def __init__(self, db_path: Path): method load_messages (line 242) | def load_messages( method append_messages (line 318) | def append_messages( method clear_session (line 395) | def clear_session(self, session_id: str) -> None: method cleanup_old_sessions (line 410) | def cleanup_old_sessions(self, max_age_days: Optional[int] = None) -> ... method load_history_page (line 454) | def load_history_page( method get_stats (line 522) | def get_stats(self) -> Dict[str, Any]: method _init_db (line 553) | def _init_db(self) -> None: method _migrate (line 563) | def _migrate(self, conn: sqlite3.Connection) -> None: method _connect (line 577) | def _connect(self) -> sqlite3.Connection: function get_conversation_store (line 592) | def get_conversation_store() -> ConversationStore: FILE: agent/memory/embedding.py class EmbeddingProvider (line 12) | class EmbeddingProvider(ABC): method embed (line 16) | def embed(self, text: str) -> List[float]: method embed_batch (line 21) | def embed_batch(self, texts: List[str]) -> List[List[float]]: method dimensions (line 27) | def dimensions(self) -> int: class OpenAIEmbeddingProvider (line 32) | class OpenAIEmbeddingProvider(EmbeddingProvider): method __init__ (line 35) | def __init__(self, model: str = "text-embedding-3-small", api_key: Opt... method _call_api (line 58) | def _call_api(self, input_data): method embed (line 89) | def embed(self, text: str) -> List[float]: method embed_batch (line 94) | def embed_batch(self, texts: List[str]) -> List[List[float]]: method dimensions (line 103) | def dimensions(self) -> int: class EmbeddingCache (line 110) | class EmbeddingCache: method __init__ (line 113) | def __init__(self): method get (line 116) | def get(self, text: str, provider: str, model: str) -> Optional[List[f... method put (line 121) | def put(self, text: str, provider: str, model: str, embedding: List[fl... method _compute_key (line 127) | def _compute_key(text: str, provider: str, model: str) -> str: method clear (line 132) | def clear(self): function create_embedding_provider (line 137) | def create_embedding_provider( FILE: agent/memory/manager.py class MemoryManager (line 20) | class MemoryManager: method __init__ (line 27) | def __init__( method _init_workspace (line 109) | def _init_workspace(self): method search (line 118) | async def search( method add_memory (line 195) | async def add_memory( method sync (line 270) | async def sync(self, force: bool = False): method _sync_file (line 318) | async def _sync_file( method flush_memory (line 386) | def flush_memory( method get_status (line 415) | def get_status(self) -> Dict[str, Any]: method mark_dirty (line 429) | def mark_dirty(self): method close (line 433) | def close(self): method _generate_chunk_id (line 439) | def _generate_chunk_id(self, path: str, start_line: int, end_line: int... method _compute_temporal_decay (line 445) | def _compute_temporal_decay(path: str, half_life_days: float = 30.0) -... method _merge_results (line 475) | def _merge_results( FILE: agent/memory/service.py class MemoryService (line 19) | class MemoryService: method __init__ (line 25) | def __init__(self, workspace_root: str): method list_files (line 35) | def list_files(self, page: int = 1, page_size: int = 20) -> dict: method get_content (line 88) | def get_content(self, filename: str) -> dict: method dispatch (line 111) | def dispatch(self, action: str, payload: Optional[dict] = None) -> dict: method _resolve_path (line 146) | def _resolve_path(self, filename: str) -> str: method _file_info (line 158) | def _file_info(path: str, filename: str, file_type: str) -> dict: FILE: agent/memory/storage.py class MemoryChunk (line 17) | class MemoryChunk: class SearchResult (line 33) | class SearchResult: class MemoryStorage (line 44) | class MemoryStorage: method __init__ (line 47) | def __init__(self, db_path: Path): method _check_fts5_support (line 53) | def _check_fts5_support(self) -> bool: method _init_db (line 64) | def _init_db(self): method save_chunk (line 200) | def save_chunk(self, chunk: MemoryChunk): method save_chunks_batch (line 221) | def save_chunks_batch(self, chunks: List[MemoryChunk]): method get_chunk (line 239) | def get_chunk(self, chunk_id: str) -> Optional[MemoryChunk]: method search_vector (line 250) | def search_vector( method search_keyword (line 313) | def search_keyword( method _search_fts5 (line 344) | def _search_fts5( method _search_like (line 400) | def _search_like( method delete_by_path (line 461) | def delete_by_path(self, path: str): method get_file_hash (line 468) | def get_file_hash(self, path: str) -> Optional[str]: method update_file_metadata (line 475) | def update_file_metadata(self, path: str, source: str, file_hash: str,... method get_stats (line 483) | def get_stats(self) -> Dict[str, int]: method close (line 498) | def close(self): method __del__ (line 508) | def __del__(self): method _row_to_chunk (line 517) | def _row_to_chunk(self, row) -> MemoryChunk: method _cosine_similarity (line 534) | def _cosine_similarity(vec1: List[float], vec2: List[float]) -> float: method _contains_cjk (line 549) | def _contains_cjk(text: str) -> bool: method _build_fts_query (line 555) | def _build_fts_query(raw_query: str) -> Optional[str]: method _bm25_rank_to_score (line 574) | def _bm25_rank_to_score(rank: float) -> float: method _truncate_text (line 580) | def _truncate_text(text: str, max_chars: int) -> str: method compute_hash (line 587) | def compute_hash(content: str) -> str: FILE: agent/memory/summarizer.py class MemoryFlushManager (line 33) | class MemoryFlushManager: method __init__ (line 44) | def __init__( method get_today_memory_file (line 59) | def get_today_memory_file(self, user_id: Optional[str] = None, ensure_... method get_main_memory_file (line 77) | def get_main_memory_file(self, user_id: Optional[str] = None) -> Path: method get_status (line 86) | def get_status(self) -> dict: method flush_from_messages (line 95) | def flush_from_messages( method _flush_worker (line 146) | def _flush_worker( method create_daily_summary (line 187) | def create_daily_summary( method _summarize_messages (line 215) | def _summarize_messages(self, messages: List[Dict], max_messages: int ... method _format_conversation_for_summary (line 234) | def _format_conversation_for_summary(self, messages: List[Dict], max_m... method _call_llm_for_summary (line 250) | def _call_llm_for_summary(self, conversation_text: str) -> str: method _extract_summary_fallback (line 279) | def _extract_summary_fallback(messages: List[Dict], max_messages: int ... method _extract_text_from_content (line 303) | def _extract_text_from_content(content) -> str: function create_memory_files_if_needed (line 318) | def create_memory_files_if_needed(workspace_dir: Path, user_id: Optional... function ensure_daily_memory_file (line 342) | def ensure_daily_memory_file(workspace_dir: Path, user_id: Optional[str]... FILE: agent/prompt/builder.py class ContextFile (line 16) | class ContextFile: class PromptBuilder (line 22) | class PromptBuilder: method __init__ (line 25) | def __init__(self, workspace_dir: str, language: str = "zh"): method build (line 36) | def build( function build_agent_system_prompt (line 77) | def build_agent_system_prompt( function _build_identity_section (line 148) | def _build_identity_section(base_persona: Optional[str], language: str) ... function _build_tooling_section (line 154) | def _build_tooling_section(tools: List[Any], language: str) -> List[str]: function _build_skills_section (line 219) | def _build_skills_section(skill_manager: Any, tools: Optional[List[Any]]... function _build_memory_section (line 266) | def _build_memory_section(memory_manager: Any, tools: Optional[List[Any]... function _build_user_identity_section (line 322) | def _build_user_identity_section(user_identity: Dict[str, str], language... function _build_docs_section (line 346) | def _build_docs_section(workspace_dir: str, language: str) -> List[str]: function _build_workspace_section (line 352) | def _build_workspace_section(workspace_dir: str, language: str) -> List[... function _build_cloud_website_section (line 398) | def _build_cloud_website_section(workspace_dir: str) -> List[str]: function _build_context_files_section (line 407) | def _build_context_files_section(context_files: List[ContextFile], langu... function _build_runtime_section (line 440) | def _build_runtime_section(runtime_info: Dict[str, Any], language: str) ... FILE: agent/prompt/workspace.py class WorkspaceFiles (line 25) | class WorkspaceFiles: function ensure_workspace (line 34) | def ensure_workspace(workspace_dir: str, create_templates: bool = True) ... function load_context_files (line 95) | def load_context_files(workspace_dir: str, files_to_load: Optional[List[... function _create_template_if_missing (line 155) | def _create_template_if_missing(filepath: str, template_content: str): function _is_template_placeholder (line 166) | def _is_template_placeholder(content: str) -> bool: function _is_onboarding_done (line 188) | def _is_onboarding_done(workspace_dir: str) -> bool: function _get_agent_template (line 211) | def _get_agent_template() -> str: function _get_user_template (line 252) | def _get_user_template() -> str: function _get_rule_template (line 282) | def _get_rule_template() -> str: function _get_memory_template (line 334) | def _get_memory_template() -> str: function _get_bootstrap_template (line 345) | def _get_bootstrap_template() -> str: FILE: agent/protocol/agent.py class Agent (line 13) | class Agent: method __init__ (line 14) | def __init__(self, system_prompt: str, description: str = "AI Agent", ... method add_tool (line 75) | def add_tool(self, tool: BaseTool): method get_skills_prompt (line 85) | def get_skills_prompt(self, skill_filter=None) -> str: method get_full_system_prompt (line 101) | def get_full_system_prompt(self, skill_filter=None) -> str: method _rebuild_runtime_section (line 127) | def _rebuild_runtime_section(self, prompt: str) -> str: method _rebuild_skills_section (line 177) | def _rebuild_skills_section(self, prompt: str) -> str: method _rebuild_tool_list_section (line 212) | def _rebuild_tool_list_section(self, prompt: str) -> str: method refresh_skills (line 236) | def refresh_skills(self): method list_skills (line 242) | def list_skills(self): method _get_model_context_window (line 252) | def _get_model_context_window(self) -> int: method _get_context_reserve_tokens (line 304) | def _get_context_reserve_tokens(self) -> int: method _estimate_message_tokens (line 319) | def _estimate_message_tokens(self, message: dict) -> int: method _estimate_text_tokens (line 363) | def _estimate_text_tokens(text: str) -> int: method _find_tool (line 382) | def _find_tool(self, tool_name: str): method output (line 398) | def output(self, message="", end="\n"): method _execute_post_process_tools (line 404) | def _execute_post_process_tools(self): method capture_tool_use (line 441) | def capture_tool_use(self, tool_name, input_params, output, status, th... method run_stream (line 475) | def run_stream(self, user_message: str, on_event=None, clear_history: ... method clear_history (line 568) | def clear_history(self): FILE: agent/protocol/agent_stream.py class AgentStreamExecutor (line 16) | class AgentStreamExecutor: method __init__ (line 27) | def __init__( method _emit_event (line 69) | def _emit_event(self, event_type: str, data: dict = None): method _filter_think_tags (line 81) | def _filter_think_tags(self, text: str) -> str: method _hash_args (line 95) | def _hash_args(self, args: dict) -> str: method _check_consecutive_failures (line 102) | def _check_consecutive_failures(self, tool_name: str, args: dict) -> T... method _record_tool_result (line 162) | def _record_tool_result(self, tool_name: str, args: dict, success: bool): method run_stream (line 170) | def run_stream(self, user_message: str) -> str: method _call_llm_stream (line 480) | def _call_llm_stream(self, retry_on_empty=True, retry_count=0, max_ret... method _execute_tool (line 821) | def _execute_tool(self, tool_call: Dict) -> Dict[str, Any]: method _build_tool_not_found_message (line 932) | def _build_tool_not_found_message(self, tool_name: str) -> str: method _validate_and_fix_messages (line 973) | def _validate_and_fix_messages(self): method _identify_complete_turns (line 977) | def _identify_complete_turns(self) -> List[Dict]: method _estimate_turn_tokens (line 1033) | def _estimate_turn_tokens(self, turn: Dict) -> int: method _truncate_historical_tool_results (line 1040) | def _truncate_historical_tool_results(self): method _aggressive_trim_for_overflow (line 1092) | def _aggressive_trim_for_overflow(self) -> bool: method _trim_messages (line 1194) | def _trim_messages(self): method _clear_session_db (line 1346) | def _clear_session_db(self): method _prepare_messages (line 1364) | def _prepare_messages(self) -> List[Dict[str, Any]]: FILE: agent/protocol/context.py class TeamContext (line 1) | class TeamContext: method __init__ (line 2) | def __init__(self, name: str, description: str, rule: str, agents: lis... class AgentOutput (line 24) | class AgentOutput: method __init__ (line 25) | def __init__(self, agent_name: str, output: str): FILE: agent/protocol/message_utils.py function sanitize_claude_messages (line 26) | def sanitize_claude_messages(messages: List[Dict]) -> int: function drop_orphaned_tool_results_openai (line 148) | def drop_orphaned_tool_results_openai(messages: List[Dict]) -> List[Dict]: function _has_block_type (line 179) | def _has_block_type(content: list, block_type: str) -> bool: function _extract_text_from_content (line 186) | def _extract_text_from_content(content) -> str: function compress_turn_to_text_only (line 200) | def compress_turn_to_text_only(turn: Dict) -> Dict: FILE: agent/protocol/models.py class LLMRequest (line 9) | class LLMRequest: method __init__ (line 12) | def __init__(self, messages: List[Dict[str, str]] = None, model: Optio... class LLMModel (line 26) | class LLMModel: method __init__ (line 29) | def __init__(self, model: str = None, **kwargs): method call (line 33) | def call(self, request: LLMRequest): method call_stream (line 40) | def call_stream(self, request: LLMRequest): class ModelFactory (line 48) | class ModelFactory: method create_model (line 52) | def create_model(model_type: str, **kwargs): FILE: agent/protocol/result.py class AgentActionType (line 11) | class AgentActionType(Enum): class ToolResult (line 19) | class ToolResult: class AgentAction (line 40) | class AgentAction: class AgentResult (line 64) | class AgentResult: method success (line 80) | def success(cls, final_answer: str, step_count: int) -> "AgentResult": method error (line 85) | def error(cls, error_message: str, step_count: int = 0) -> "AgentResult": method is_error (line 95) | def is_error(self) -> bool: FILE: agent/protocol/task.py class TaskType (line 9) | class TaskType(Enum): class TaskStatus (line 19) | class TaskStatus(Enum): class Task (line 28) | class Task: method __init__ (line 59) | def __init__(self, content: str = "", **kwargs): method get_text (line 79) | def get_text(self) -> str: method update_status (line 88) | def update_status(self, status: TaskStatus) -> None: FILE: agent/skills/config.py function resolve_runtime_platform (line 11) | def resolve_runtime_platform() -> str: function has_binary (line 16) | def has_binary(bin_name: str) -> bool: function has_any_binary (line 27) | def has_any_binary(bin_names: List[str]) -> bool: function has_env_var (line 37) | def has_env_var(env_name: str) -> bool: function get_skill_config (line 47) | def get_skill_config(config: Optional[Dict], skill_name: str) -> Optiona... function should_include_skill (line 69) | def should_include_skill( function is_config_path_truthy (line 142) | def is_config_path_truthy(config: Dict, path: str) -> bool: function resolve_config_path (line 171) | def resolve_config_path(config: Dict, path: str): FILE: agent/skills/formatter.py function format_skills_for_prompt (line 9) | def format_skills_for_prompt(skills: List[Skill]) -> str: function format_skill_entries_for_prompt (line 43) | def format_skill_entries_for_prompt(entries: List[SkillEntry]) -> str: function _escape_xml (line 54) | def _escape_xml(text: str) -> str: FILE: agent/skills/frontmatter.py function parse_frontmatter (line 11) | def parse_frontmatter(content: str) -> Dict[str, Any]: function parse_metadata (line 70) | def parse_metadata(frontmatter: Dict[str, Any]) -> Optional[SkillMetadata]: function _normalize_string_list (line 141) | def _normalize_string_list(value: Any) -> List[str]: function parse_boolean_value (line 155) | def parse_boolean_value(value: Optional[str], default: bool = False) -> ... function get_frontmatter_value (line 169) | def get_frontmatter_value(frontmatter: Dict[str, Any], key: str) -> Opti... FILE: agent/skills/loader.py class SkillLoader (line 13) | class SkillLoader: method __init__ (line 16) | def __init__(self): method load_skills_from_dir (line 19) | def load_skills_from_dir(self, dir_path: str, source: str) -> LoadSkil... method _load_skills_recursive (line 47) | def _load_skills_recursive( method _load_skill_from_file (line 108) | def _load_skill_from_file(self, file_path: str, source: str) -> LoadSk... method _load_linkai_agent_description (line 175) | def _load_linkai_agent_description(self, skill_dir: str, default_descr... method load_all_skills (line 212) | def load_all_skills( method _create_skill_entry (line 259) | def _create_skill_entry(self, skill: Skill) -> SkillEntry: FILE: agent/skills/manager.py class SkillManager (line 17) | class SkillManager: method __init__ (line 20) | def __init__( method refresh_skills (line 49) | def refresh_skills(self): method _load_skills_config (line 61) | def _load_skills_config(self) -> Dict[str, dict]: method _save_skills_config (line 74) | def _save_skills_config(self): method _sync_skills_config (line 83) | def _sync_skills_config(self): method is_skill_enabled (line 111) | def is_skill_enabled(self, name: str) -> bool: method set_skill_enabled (line 123) | def set_skill_enabled(self, name: str, enabled: bool): method get_skills_config (line 135) | def get_skills_config(self) -> Dict[str, dict]: method get_skill (line 143) | def get_skill(self, name: str) -> Optional[SkillEntry]: method list_skills (line 152) | def list_skills(self) -> List[SkillEntry]: method filter_skills (line 160) | def filter_skills( method build_skills_prompt (line 206) | def build_skills_prompt( method build_skill_snapshot (line 226) | def build_skill_snapshot( method sync_skills_to_workspace (line 258) | def sync_skills_to_workspace(self, target_workspace_dir: str): method get_skill_by_key (line 291) | def get_skill_by_key(self, skill_key: str) -> Optional[SkillEntry]: FILE: agent/skills/service.py class SkillService (line 24) | class SkillService: method __init__ (line 31) | def __init__(self, skill_manager: SkillManager): method query (line 40) | def query(self) -> List[dict]: method add (line 56) | def add(self, payload: dict) -> None: method _add_url (line 104) | def _add_url(self, name: str, payload: dict) -> None: method _add_package (line 136) | def _add_package(self, name: str, payload: dict) -> None: method open (line 183) | def open(self, payload: dict) -> None: method close (line 195) | def close(self, payload: dict) -> None: method delete (line 210) | def delete(self, payload: dict) -> None: method dispatch (line 234) | def dispatch(self, action: str, payload: Optional[dict] = None) -> dict: method _download_file (line 267) | def _download_file(url: str, dest: str): FILE: agent/skills/types.py class SkillInstallSpec (line 11) | class SkillInstallSpec: class SkillMetadata (line 29) | class SkillMetadata: class Skill (line 42) | class Skill: class SkillEntry (line 55) | class SkillEntry: class LoadSkillsResult (line 63) | class LoadSkillsResult: class SkillSnapshot (line 70) | class SkillSnapshot: FILE: agent/tools/__init__.py function _import_optional_tools (line 18) | def _import_optional_tools(): function _import_browser_tool (line 91) | def _import_browser_tool(): FILE: agent/tools/base_tool.py class ToolStage (line 7) | class ToolStage(Enum): class ToolResult (line 13) | class ToolResult: method __init__ (line 16) | def __init__(self, status: str = None, result: Any = None, ext_data: A... method success (line 22) | def success(result, ext_data: Any = None): method fail (line 26) | def fail(result, ext_data: Any = None): class BaseTool (line 30) | class BaseTool: method get_json_schema (line 43) | def get_json_schema(cls) -> dict: method execute_tool (line 51) | def execute_tool(self, params: dict) -> ToolResult: method execute (line 57) | def execute(self, params: dict) -> ToolResult: method _parse_schema (line 62) | def _parse_schema(cls) -> dict: method should_auto_execute (line 81) | def should_auto_execute(self, context) -> bool: method close (line 91) | def close(self): FILE: agent/tools/bash/bash.py class Bash (line 18) | class Bash(BaseTool): method __init__ (line 45) | def __init__(self, config: dict = None): method execute (line 55) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _get_safety_warning (line 230) | def _get_safety_warning(self, command: str) -> str: method _convert_env_vars_for_windows (line 276) | def _convert_env_vars_for_windows(command: str, dotenv_vars: dict) -> ... FILE: agent/tools/browser_tool.py function copy (line 1) | def copy(self): FILE: agent/tools/edit/edit.py class Edit (line 22) | class Edit(BaseTool): method __init__ (line 47) | def __init__(self, config: dict = None): method execute (line 52) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _resolve_path (line 174) | def _resolve_path(self, path: str) -> str: FILE: agent/tools/env_config/env_config.py class EnvConfig (line 26) | class EnvConfig(BaseTool): method __init__ (line 67) | def __init__(self, config: dict = None): method _ensure_env_file (line 76) | def _ensure_env_file(self): method _mask_value (line 85) | def _mask_value(self, value: str) -> str: method _read_env_file (line 91) | def _read_env_file(self) -> Dict[str, str]: method _write_env_file (line 108) | def _write_env_file(self, env_vars: Dict[str, str]): method _reload_env (line 116) | def _reload_env(self): method _refresh_skills (line 123) | def _refresh_skills(self): method execute (line 139) | def execute(self, args: Dict[str, Any]) -> ToolResult: FILE: agent/tools/ls/ls.py class Ls (line 16) | class Ls(BaseTool): method __init__ (line 37) | def __init__(self, config: dict = None): method execute (line 41) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _resolve_path (line 134) | def _resolve_path(self, path: str) -> str: FILE: agent/tools/memory/memory_get.py class MemoryGetTool (line 10) | class MemoryGetTool(BaseTool): method __init__ (line 38) | def __init__(self, memory_manager): method execute (line 48) | def execute(self, args: dict): FILE: agent/tools/memory/memory_search.py class MemorySearchTool (line 11) | class MemorySearchTool(BaseTool): method __init__ (line 40) | def __init__(self, memory_manager, user_id: Optional[str] = None): method execute (line 52) | def execute(self, args: dict): FILE: agent/tools/read/read.py class Read (line 15) | class Read(BaseTool): method __init__ (line 40) | def __init__(self, config: dict = None): method execute (line 63) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _resolve_path (line 131) | def _resolve_path(self, path: str) -> str: method _return_file_metadata (line 144) | def _return_file_metadata(self, absolute_path: str, file_type: str, fi... method _read_image (line 183) | def _read_image(self, absolute_path: str, file_ext: str) -> ToolResult: method _read_text (line 221) | def _read_text(self, absolute_path: str, display_path: str, offset: in... method _read_office (line 344) | def _read_office(self, absolute_path: str, display_path: str, file_ext... method _extract_office_text (line 407) | def _extract_office_text(absolute_path: str, file_ext: str) -> str: method _read_pdf (line 454) | def _read_pdf(self, absolute_path: str, display_path: str, offset: int... FILE: agent/tools/scheduler/integration.py function init_scheduler (line 18) | def init_scheduler(agent_bridge) -> bool: function get_task_store (line 77) | def get_task_store(): function get_scheduler_service (line 82) | def get_scheduler_service(): function _execute_agent_task (line 87) | def _execute_agent_task(task: dict, agent_bridge): function _execute_send_message (line 187) | def _execute_send_message(task: dict, agent_bridge): function _execute_tool_call (line 272) | def _execute_tool_call(task: dict, agent_bridge): function _execute_skill_call (line 364) | def _execute_skill_call(task: dict, agent_bridge): function attach_scheduler_to_tool (line 447) | def attach_scheduler_to_tool(tool, context: Context = None): FILE: agent/tools/scheduler/scheduler_service.py class SchedulerService (line 13) | class SchedulerService: method __init__ (line 18) | def __init__(self, task_store, execute_callback: Callable): method start (line 32) | def start(self): method stop (line 44) | def stop(self): method _run_loop (line 55) | def _run_loop(self): method _check_and_execute_tasks (line 67) | def _check_and_execute_tasks(self): method _is_task_due (line 93) | def _is_task_due(self, task: dict, now: datetime) -> bool: method _calculate_next_run (line 146) | def _calculate_next_run(self, task: dict, from_time: datetime) -> Opti... method _execute_task (line 197) | def _execute_task(self, task: dict): FILE: agent/tools/scheduler/scheduler_tool.py class SchedulerTool (line 16) | class SchedulerTool(BaseTool): method __init__ (line 72) | def __init__(self, config: dict = None): method execute (line 80) | def execute(self, params: dict) -> ToolResult: method _create_task (line 124) | def _create_task(self, **kwargs) -> str: method _list_tasks (line 223) | def _list_tasks(self, **kwargs) -> str: method _get_task (line 245) | def _get_task(self, **kwargs) -> str: method _delete_task (line 276) | def _delete_task(self, **kwargs) -> str: method _enable_task (line 289) | def _enable_task(self, **kwargs) -> str: method _disable_task (line 302) | def _disable_task(self, **kwargs) -> str: method _parse_schedule (line 315) | def _parse_schedule(self, schedule_type: str, schedule_value: str) -> ... method _calculate_next_run (line 370) | def _calculate_next_run(self, task: dict) -> Optional[datetime]: method _format_schedule_description (line 392) | def _format_schedule_description(self, schedule: dict) -> str: method _get_receiver_name (line 432) | def _get_receiver_name(self, context: Context) -> str: FILE: agent/tools/scheduler/task_store.py class TaskStore (line 14) | class TaskStore: method __init__ (line 19) | def __init__(self, store_path: str = None): method _ensure_store_dir (line 35) | def _ensure_store_dir(self): method load_tasks (line 40) | def load_tasks(self) -> Dict[str, dict]: method save_tasks (line 59) | def save_tasks(self, tasks: Dict[str, dict]): method add_task (line 91) | def add_task(self, task: dict) -> bool: method update_task (line 114) | def update_task(self, task_id: str, updates: dict) -> bool: method delete_task (line 137) | def delete_task(self, task_id: str) -> bool: method get_task (line 156) | def get_task(self, task_id: str) -> Optional[dict]: method list_tasks (line 169) | def list_tasks(self, enabled_only: bool = False) -> List[dict]: method enable_task (line 190) | def enable_task(self, task_id: str, enabled: bool = True) -> bool: FILE: agent/tools/send/send.py class Send (line 13) | class Send(BaseTool): method __init__ (line 34) | def __init__(self, config: dict = None): method execute (line 44) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _resolve_path (line 104) | def _resolve_path(self, path: str) -> str: method _get_image_mime_type (line 111) | def _get_image_mime_type(self, ext: str) -> str: method _get_video_mime_type (line 121) | def _get_video_mime_type(self, ext: str) -> str: method _get_audio_mime_type (line 130) | def _get_audio_mime_type(self, ext: str) -> str: method _get_document_mime_type (line 139) | def _get_document_mime_type(self, ext: str) -> str: method _format_size (line 154) | def _format_size(self, size_bytes: int) -> str: FILE: agent/tools/tool_manager.py class ToolManager (line 10) | class ToolManager: method __new__ (line 16) | def __new__(cls): method __init__ (line 24) | def __init__(self): method load_tools (line 29) | def load_tools(self, tools_dir: str = "", config_dict=None): method _load_tools_from_init (line 42) | def _load_tools_from_init(self) -> bool: method _load_tools_from_directory (line 115) | def _load_tools_from_directory(self, tools_dir: str): method _configure_tools_from_config (line 176) | def _configure_tools_from_config(self, config_dict=None): method create_tool (line 215) | def create_tool(self, name: str) -> BaseTool: method list_tools (line 234) | def list_tools(self) -> dict: FILE: agent/tools/utils/diff.py function strip_bom (line 11) | def strip_bom(text: str) -> Tuple[str, str]: function detect_line_ending (line 23) | def detect_line_ending(text: str) -> str: function normalize_to_lf (line 35) | def normalize_to_lf(text: str) -> str: function restore_line_endings (line 45) | def restore_line_endings(text: str, original_ending: str) -> str: function normalize_for_fuzzy_match (line 58) | def normalize_for_fuzzy_match(text: str) -> str: class FuzzyMatchResult (line 86) | class FuzzyMatchResult: method __init__ (line 89) | def __init__(self, found: bool, index: int = -1, match_length: int = 0... function fuzzy_find_text (line 96) | def fuzzy_find_text(content: str, old_text: str) -> FuzzyMatchResult: function generate_diff_string (line 132) | def generate_diff_string(old_content: str, new_content: str) -> dict: FILE: agent/tools/utils/truncate.py class TruncationResult (line 19) | class TruncationResult: method __init__ (line 22) | def __init__( method to_dict (line 48) | def to_dict(self) -> Dict[str, Any]: function format_size (line 65) | def format_size(bytes_count: int) -> str: function truncate_head (line 75) | def truncate_head(content: str, max_lines: Optional[int] = None, max_byt... function truncate_tail (line 171) | def truncate_tail(content: str, max_lines: Optional[int] = None, max_byt... function _truncate_string_to_bytes_from_end (line 258) | def _truncate_string_to_bytes_from_end(text: str, max_bytes: int) -> str: function truncate_line (line 281) | def truncate_line(line: str, max_chars: int = GREP_MAX_LINE_LENGTH) -> T... FILE: agent/tools/vision/vision.py class Vision (line 33) | class Vision(BaseTool): method __init__ (line 65) | def __init__(self, config: dict = None): method is_available (line 69) | def is_available() -> bool: method execute (line 75) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _resolve_provider (line 110) | def _resolve_provider(self) -> Tuple[Optional[str], str, dict]: method _ensure_v1 (line 132) | def _ensure_v1(api_base: str) -> str: method _build_image_content (line 141) | def _build_image_content(self, image: str) -> dict: method _maybe_compress (line 169) | def _maybe_compress(path: str) -> str: method _call_api (line 203) | def _call_api(self, api_key: str, api_base: str, model: str, FILE: agent/tools/web_fetch/web_fetch.py function _extract_charset_from_content_type (line 47) | def _extract_charset_from_content_type(content_type: str) -> Optional[str]: function _extract_charset_from_html_meta (line 53) | def _extract_charset_from_html_meta(raw_bytes: bytes) -> Optional[str]: function _get_url_suffix (line 64) | def _get_url_suffix(url: str) -> str: function _is_document_url (line 70) | def _is_document_url(url: str) -> bool: class WebFetch (line 76) | class WebFetch(BaseTool): method __init__ (line 97) | def __init__(self, config: dict = None): method execute (line 101) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _fetch_webpage (line 117) | def _fetch_webpage(self, url: str) -> ToolResult: method _fetch_document (line 150) | def _fetch_document(self, url: str) -> ToolResult: method _parse_document (line 222) | def _parse_document(self, file_path: str, suffix: str) -> str: method _parse_pdf (line 237) | def _parse_pdf(self, file_path: str) -> str: method _parse_word (line 253) | def _parse_word(self, file_path: str) -> str: method _parse_text (line 265) | def _parse_text(self, file_path: str) -> str: method _parse_spreadsheet (line 276) | def _parse_spreadsheet(self, file_path: str) -> str: method _parse_ppt (line 301) | def _parse_ppt(self, file_path: str) -> str: method _detect_encoding (line 329) | def _detect_encoding(response: requests.Response) -> str: method _ensure_tmp_dir (line 357) | def _ensure_tmp_dir(self) -> str: method _extract_filename (line 363) | def _extract_filename(self, url: str) -> str: method _cleanup_file (line 375) | def _cleanup_file(path: str): method _is_binary_content_type (line 384) | def _is_binary_content_type(content_type: str) -> bool: method _handle_download_by_content_type (line 396) | def _handle_download_by_content_type(self, url: str, response: request... method _rewrite_url_with_suffix (line 420) | def _rewrite_url_with_suffix(url: str, suffix: str) -> str: method _extract_title (line 429) | def _extract_title(html: str) -> str: method _extract_text (line 434) | def _extract_text(html: str) -> str: FILE: agent/tools/web_search/web_search.py class WebSearch (line 23) | class WebSearch(BaseTool): method __init__ (line 56) | def __init__(self, config: dict = None): method is_available (line 61) | def is_available() -> bool: method _resolve_backend (line 65) | def _resolve_backend(self) -> Optional[str]: method execute (line 78) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _search_bocha (line 120) | def _search_bocha(self, query: str, count: int, freshness: str, summar... method _format_bocha_results (line 170) | def _format_bocha_results(self, data: dict, query: str) -> ToolResult: method _search_linkai (line 215) | def _search_linkai(self, query: str, count: int, freshness: str) -> To... method _format_linkai_results (line 257) | def _format_linkai_results(self, data: dict, query: str) -> ToolResult: FILE: agent/tools/write/write.py class Write (line 14) | class Write(BaseTool): method __init__ (line 35) | def __init__(self, config: dict = None): method execute (line 40) | def execute(self, args: Dict[str, Any]) -> ToolResult: method _resolve_path (line 86) | def _resolve_path(self, path: str) -> str: FILE: app.py function get_channel_manager (line 19) | def get_channel_manager(): function _parse_channel_type (line 23) | def _parse_channel_type(raw) -> list: class ChannelManager (line 38) | class ChannelManager: method __init__ (line 45) | def __init__(self): method channel (line 53) | def channel(self): method get_channel (line 57) | def get_channel(self, channel_name: str): method start (line 60) | def start(self, channel_names: list, first_start: bool = False): method _run_channel (line 111) | def _run_channel(self, name: str, channel): method stop (line 118) | def stop(self, channel_name: str = None): method _interrupt_thread (line 159) | def _interrupt_thread(th: threading.Thread, name: str): method restart (line 177) | def restart(self, new_channel_name: str): method add_channel (line 189) | def add_channel(self, channel_name: str): method remove_channel (line 205) | def remove_channel(self, channel_name: str): function _clear_singleton_cache (line 218) | def _clear_singleton_cache(channel_name: str): function sigterm_handler_wrap (line 256) | def sigterm_handler_wrap(_signo): function run (line 269) | def run(): FILE: bridge/agent_bridge.py function add_openai_compatible_support (line 20) | def add_openai_compatible_support(bot_instance): class AgentLLMModel (line 63) | class AgentLLMModel(LLMModel): method __init__ (line 80) | def __init__(self, bridge: Bridge, bot_type: str = "chat"): method model (line 89) | def model(self): method model (line 94) | def model(self, value): method _resolve_bot_type (line 97) | def _resolve_bot_type(self, model_name: str) -> str: method bot (line 126) | def bot(self): method call (line 137) | def call(self, request: LLMRequest): method call_stream (line 180) | def call_stream(self, request: LLMRequest): method _format_response (line 227) | def _format_response(self, response): method _format_stream_chunk (line 232) | def _format_stream_chunk(self, chunk): class AgentBridge (line 238) | class AgentBridge: method __init__ (line 244) | def __init__(self, bridge: Bridge): method create_agent (line 253) | def create_agent(self, system_prompt: str, tools: List = None, **kwarg... method get_agent (line 307) | def get_agent(self, session_id: str = None) -> Optional[Agent]: method _init_default_agent (line 329) | def _init_default_agent(self): method _init_agent_for_session (line 334) | def _init_agent_for_session(self, session_id: str): method agent_reply (line 339) | def agent_reply(self, query: str, context: Context = None, method _create_file_reply (line 461) | def _create_file_reply(self, file_info: dict, text_response: str, cont... method _migrate_config_to_env (line 503) | def _migrate_config_to_env(self, workspace_root: str): method _persist_messages (line 576) | def _persist_messages( method clear_session (line 602) | def clear_session(self, session_id: str): method clear_all_sessions (line 613) | def clear_all_sessions(self): method refresh_all_skills (line 619) | def refresh_all_skills(self) -> int: method _refresh_conditional_tools (line 664) | def _refresh_conditional_tools(agent): FILE: bridge/agent_event_handler.py class AgentEventHandler (line 8) | class AgentEventHandler: method __init__ (line 13) | def __init__(self, context=None, original_callback=None): method handle_event (line 33) | def handle_event(self, event): method _handle_turn_start (line 59) | def _handle_turn_start(self, data): method _handle_message_update (line 65) | def _handle_message_update(self, data): method _handle_message_end (line 70) | def _handle_message_end(self, data): method _handle_tool_execution_start (line 87) | def _handle_tool_execution_start(self, data): method _handle_tool_execution_end (line 91) | def _handle_tool_execution_end(self, data): method _send_to_channel (line 95) | def _send_to_channel(self, message): method log_summary (line 111) | def log_summary(self): FILE: bridge/agent_initializer.py class AgentInitializer (line 17) | class AgentInitializer: method __init__ (line 26) | def __init__(self, bridge, agent_bridge): method initialize_agent (line 37) | def initialize_agent(self, session_id: Optional[str] = None) -> Agent: method _restore_conversation_history (line 125) | def _restore_conversation_history(self, agent, session_id: str) -> None: method _filter_text_only_messages (line 166) | def _filter_text_only_messages(messages: list) -> list: method _load_env_file (line 240) | def _load_env_file(self): method _setup_memory_system (line 252) | def _setup_memory_system(self, workspace_root: str, session_id: Option... method _sync_memory (line 322) | def _sync_memory(self, memory_manager, session_id: Optional[str] = None): method _load_tools (line 340) | def _load_tools(self, workspace_root: str, memory_manager, memory_tool... method _initialize_scheduler (line 389) | def _initialize_scheduler(self, tools: List, session_id: Optional[str]... method _initialize_skill_manager (line 428) | def _initialize_skill_manager(self, workspace_root: str, session_id: O... method _get_runtime_info (line 438) | def _get_runtime_info(self, workspace_root: str): method _migrate_config_to_env (line 475) | def _migrate_config_to_env(self, workspace_root: str): method _start_daily_flush_timer (line 530) | def _start_daily_flush_timer(self): method _flush_all_agents (line 557) | def _flush_all_agents(self): FILE: bridge/bridge.py class Bridge (line 13) | class Bridge(object): method __init__ (line 14) | def __init__(self): method get_bot (line 83) | def get_bot(self, typename): method get_bot_type (line 96) | def get_bot_type(self, typename): method fetch_reply_content (line 99) | def fetch_reply_content(self, query, context: Context) -> Reply: method fetch_voice_to_text (line 102) | def fetch_voice_to_text(self, voiceFile) -> Reply: method fetch_text_to_voice (line 105) | def fetch_text_to_voice(self, text) -> Reply: method fetch_translate (line 108) | def fetch_translate(self, text, from_lang="", to_lang="en") -> Reply: method find_chat_bot (line 111) | def find_chat_bot(self, bot_type: str): method reset_bot (line 116) | def reset_bot(self): method get_agent_bridge (line 122) | def get_agent_bridge(self): method fetch_agent_reply (line 131) | def fetch_agent_reply(self, query: str, context: Context = None, FILE: bridge/context.py class ContextType (line 6) | class ContextType(Enum): method __str__ (line 22) | def __str__(self): class Context (line 26) | class Context: method __init__ (line 27) | def __init__(self, type: ContextType = None, content=None, kwargs=dict... method __contains__ (line 32) | def __contains__(self, key): method __getitem__ (line 40) | def __getitem__(self, key): method get (line 48) | def get(self, key, default=None): method __setitem__ (line 54) | def __setitem__(self, key, value): method __delitem__ (line 62) | def __delitem__(self, key): method __str__ (line 70) | def __str__(self): FILE: bridge/reply.py class ReplyType (line 6) | class ReplyType(Enum): method __str__ (line 21) | def __str__(self): class Reply (line 25) | class Reply: method __init__ (line 26) | def __init__(self, type: ReplyType = None, content=None): method __str__ (line 30) | def __str__(self): FILE: channel/channel.py class Channel (line 12) | class Channel(object): method __init__ (line 16) | def __init__(self): method startup (line 22) | def startup(self): method report_startup_success (line 28) | def report_startup_success(self): method report_startup_error (line 32) | def report_startup_error(self, error: str): method wait_startup (line 36) | def wait_startup(self, timeout: float = 3) -> (bool, str): method stop (line 48) | def stop(self): method handle_text (line 54) | def handle_text(self, msg): method send (line 62) | def send(self, reply: Reply, context: Context): method build_reply_content (line 71) | def build_reply_content(self, query, context: Context = None) -> Reply: method build_voice_to_text (line 104) | def build_voice_to_text(self, voice_file) -> Reply: method build_text_to_voice (line 107) | def build_text_to_voice(self, text) -> Reply: FILE: channel/channel_factory.py function create_channel (line 8) | def create_channel(channel_type) -> Channel: FILE: channel/chat_channel.py class ChatChannel (line 24) | class ChatChannel(Channel): method __init__ (line 28) | def __init__(self): method _compose_context (line 43) | def _compose_context(self, ctype: ContextType, content, **kwargs): method _handle (line 178) | def _handle(self, context: Context): method _generate_reply (line 194) | def _generate_reply(self, context: Context, reply: Reply = Reply()) ->... method _decorate_reply (line 248) | def _decorate_reply(self, context: Context, reply: Reply) -> Reply: method _send_reply (line 287) | def _send_reply(self, context: Context, reply: Reply): method _extract_and_send_images (line 313) | def _extract_and_send_images(self, reply: Reply, context: Context): method _send (line 393) | def _send(self, reply: Reply, context: Context, retry_cnt=0): method _success_callback (line 405) | def _success_callback(self, session_id, **kwargs): # 线程正常结束时的回调函数 method _fail_callback (line 408) | def _fail_callback(self, session_id, exception, **kwargs): # 线程异常结束时的... method _thread_pool_callback (line 411) | def _thread_pool_callback(self, session_id, **kwargs): method produce (line 428) | def produce(self, context: Context): method consume (line 442) | def consume(self): method cancel_session (line 469) | def cancel_session(self, session_id): method cancel_all_session (line 479) | def cancel_all_session(self): function check_prefix (line 490) | def check_prefix(content, prefix_list): function check_contain (line 499) | def check_contain(content, keyword_list): FILE: channel/chat_message.py class ChatMessage (line 36) | class ChatMessage(object): method __init__ (line 62) | def __init__(self, _rawmsg): method prepare (line 65) | def prepare(self): method __str__ (line 70) | def __str__(self): FILE: channel/dingtalk/dingtalk_channel.py class CustomAICardReplier (line 33) | class CustomAICardReplier(CardReplier): method __init__ (line 34) | def __init__(self, dingtalk_client, incoming_message): method start (line 37) | def start( function _check (line 68) | def _check(func): class DingTalkChanel (line 88) | class DingTalkChanel(ChatChannel, dingtalk_stream.ChatbotHandler): method setup_logger (line 92) | def setup_logger(self): method __init__ (line 97) | def __init__(self): method _open_connection (line 118) | def _open_connection(self, client): method startup (line 147) | def startup(self): method stop (line 230) | def stop(self): method get_access_token (line 243) | def get_access_token(self): method send_single_message (line 279) | def send_single_message(self, user_id: str, content: str, robot_code: ... method send_group_message (line 320) | def send_group_message(self, conversation_id: str, content: str, robot... method upload_media (line 366) | def upload_media(self, file_path: str, media_type: str = "image") -> str: method send_image_with_media_id (line 440) | def send_image_with_media_id(self, access_token: str, media_id: str, i... method send_image_message (line 492) | def send_image_message(self, receiver: str, media_id: str, is_group: b... method get_image_download_url (line 555) | def get_image_download_url(self, download_code: str) -> str: method process (line 575) | async def process(self, callback: dingtalk_stream.CallbackMessage): method handle_single (line 606) | def handle_single(self, cmsg: DingTalkMessage): method handle_group (line 664) | def handle_group(self, cmsg: DingTalkMessage): method send (line 724) | def send(self, reply: Reply, context: Context): method _send_file_message (line 899) | def _send_file_message(self, access_token: str, incoming_message, msg_... method generate_button_markdown_content (line 948) | def generate_button_markdown_content(self, context, reply): FILE: channel/dingtalk/dingtalk_message.py class DingTalkMessage (line 16) | class DingTalkMessage(ChatMessage): method __init__ (line 17) | def __init__(self, event: ChatbotMessage, image_download_handler): function download_image_file (line 116) | def download_image_file(image_url, temp_dir): FILE: channel/feishu/feishu_channel.py function _ensure_lark_imported (line 49) | def _ensure_lark_imported(): class FeiShuChanel (line 59) | class FeiShuChanel(ChatChannel): method __init__ (line 65) | def __init__(self): method startup (line 84) | def startup(self): method _fetch_bot_open_id (line 95) | def _fetch_bot_open_id(self): method stop (line 114) | def stop(self): method _startup_webhook (line 145) | def _startup_webhook(self): method _startup_websocket (line 162) | def _startup_websocket(self): method _is_mention_bot (line 264) | def _is_mention_bot(self, mentions: list) -> bool: method _handle_message_event (line 285) | def _handle_message_event(self, event: dict): method send (line 390) | def send(self, reply: Reply, context: Context): method fetch_access_token (line 484) | def fetch_access_token(self) -> str: method _upload_image_url (line 505) | def _upload_image_url(self, img_url, access_token): method _get_video_duration (line 556) | def _get_video_duration(self, file_path: str) -> int: method _upload_video_url (line 594) | def _upload_video_url(self, video_url, access_token): method _upload_file_url (line 690) | def _upload_file_url(self, file_url, access_token): method _compose_context (line 794) | def _compose_context(self, ctype: ContextType, content, **kwargs): class FeishuController (line 841) | class FeishuController: method GET (line 850) | def GET(self): method POST (line 853) | def POST(self): FILE: channel/feishu/feishu_message.py class FeishuMessage (line 13) | class FeishuMessage(ChatMessage): method __init__ (line 14) | def __init__(self, event: dict, is_group=False, access_token=None): FILE: channel/file_cache.py class FileCache (line 11) | class FileCache: method __init__ (line 14) | def __init__(self, ttl=120): method add (line 22) | def add(self, session_id: str, file_path: str, file_type: str = "image"): method get (line 43) | def get(self, session_id: str) -> list: method clear (line 66) | def clear(self, session_id: str): method cleanup_expired (line 77) | def cleanup_expired(self): function get_file_cache (line 98) | def get_file_cache() -> FileCache: FILE: channel/qq/qq_channel.py class QQChannel (line 54) | class QQChannel(ChatChannel): method __init__ (line 56) | def __init__(self): method startup (line 86) | def startup(self): method stop (line 106) | def stop(self): method _refresh_access_token (line 121) | def _refresh_access_token(self): method _get_access_token (line 137) | def _get_access_token(self) -> str: method _get_auth_headers (line 143) | def _get_auth_headers(self) -> dict: method _get_ws_url (line 153) | def _get_ws_url(self) -> str: method _start_ws (line 168) | def _start_ws(self): method _ws_send (line 223) | def _ws_send(self, data: dict): method _send_identify (line 231) | def _send_identify(self): method _send_resume (line 247) | def _send_resume(self): method _start_heartbeat (line 258) | def _start_heartbeat(self, interval_ms: int): method _handle_ws_message (line 283) | def _handle_ws_message(self, data: dict): method _handle_msg_event (line 351) | def _handle_msg_event(self, event_data: dict, event_type: str): method _compose_context (line 414) | def _compose_context(self, ctype: ContextType, content, **kwargs): method send (line 446) | def send(self, reply: Reply, context: Context): method _get_next_msg_seq (line 479) | def _get_next_msg_seq(self, msg_id: str) -> int: method _build_msg_url_and_base_body (line 484) | def _build_msg_url_and_base_body(self, msg: QQMessage, event_type: str... method _post_message (line 518) | def _post_message(self, url: str, body: dict, event_type: str): method _active_send_text (line 533) | def _active_send_text(self, content: str, receiver: str, is_group: bool): method _send_text (line 553) | def _send_text(self, content: str, msg: QQMessage, event_type: str, ms... method _upload_rich_media (line 566) | def _upload_rich_media(self, file_url: str, file_type: int, msg: QQMes... method _upload_rich_media_base64 (line 609) | def _upload_rich_media_base64(self, file_path: str, file_type: int, ms... method _send_media_msg (line 655) | def _send_media_msg(self, file_info: str, msg: QQMessage, event_type: ... method _send_image (line 664) | def _send_image(self, img_path_or_url: str, msg: QQMessage, event_type... method _send_file (line 689) | def _send_file(self, file_path_or_url: str, msg: QQMessage, event_type... method _send_media (line 714) | def _send_media(self, path_or_url: str, msg: QQMessage, event_type: str, FILE: channel/qq/qq_message.py function _get_tmp_dir (line 11) | def _get_tmp_dir() -> str: class QQMessage (line 19) | class QQMessage(ChatMessage): method __init__ (line 22) | def __init__(self, event_data: dict, event_type: str): FILE: channel/terminal/terminal_channel.py class TerminalMessage (line 11) | class TerminalMessage(ChatMessage): method __init__ (line 12) | def __init__( class TerminalChannel (line 29) | class TerminalChannel(ChatChannel): method send (line 32) | def send(self, reply: Reply, context: Context): method startup (line 63) | def startup(self): method get_input (line 87) | def get_input(self): FILE: channel/web/static/js/console.js constant APP_VERSION (line 8) | const APP_VERSION = 'v2.0.3'; constant I18N (line 13) | const I18N = { function t (line 110) | function t(key) { function applyI18n (line 114) | function applyI18n() { function toggleLanguage (line 127) | function toggleLanguage() { function applyTheme (line 138) | function applyTheme() { function toggleTheme (line 153) | function toggleTheme() { constant VIEW_META (line 162) | const VIEW_META = { function navigateTo (line 174) | function navigateTo(viewId) { function toggleSidebar (line 191) | function toggleSidebar() { function closeSidebar (line 203) | function closeSidebar() { function createMd (line 232) | function createMd() { function renderMarkdown (line 255) | function renderMarkdown(text) { constant SESSION_ID_KEY (line 269) | const SESSION_ID_KEY = 'cow_session_id'; function generateSessionId (line 271) | function generateSessionId() { function loadOrCreateSessionId (line 279) | function loadOrCreateSessionId() { function updateSendBtnState (line 315) | function updateSendBtnState() { function renderAttachmentPreview (line 319) | function renderAttachmentPreview() { function removeAttachment (line 350) | function removeAttachment(idx) { function handleFileSelect (line 356) | async function handleFileSelect(files) { function sendMessage (line 464) | function sendMessage() { function startSSE (line 518) | function startSSE(requestId, loadingEl, timestamp) { function startPolling (line 675) | function startPolling() { function createUserMessageEl (line 706) | function createUserMessageEl(content, timestamp, attachments) { function renderToolCallsHtml (line 734) | function renderToolCallsHtml(toolCalls) { function createBotMessageEl (line 762) | function createBotMessageEl(content, timestamp, requestId, toolCalls) { function addUserMessage (line 781) | function addUserMessage(content, timestamp, attachments) { function addBotMessage (line 787) | function addBotMessage(content, timestamp, requestId) { function loadHistory (line 795) | function loadHistory(page) { function addLoadingIndicator (line 866) | function addLoadingIndicator() { function newChat (line 884) | function newChat() { function formatTime (line 949) | function formatTime(date) { function escapeHtml (line 953) | function escapeHtml(str) { function ChannelsHandler_maskSecret (line 959) | function ChannelsHandler_maskSecret(val) { function formatToolArgs (line 964) | function formatToolArgs(args) { function scrollChatToBottom (line 973) | function scrollChatToBottom() { function applyHighlighting (line 977) | function applyHighlighting(container) { function initDropdown (line 999) | function initDropdown(el, options, selectedValue, onChange) { function getDropdownValue (line 1046) | function getDropdownValue(el) { return el._ddValue || ''; } function initConfigView (line 1049) | function initConfigView(data) { function detectProvider (line 1074) | function detectProvider(model) { function onProviderChange (line 1083) | function onProviderChange(pid) { function onModelSelectChange (line 1147) | function onModelSelectChange(val) { function syncModelSelection (line 1159) | function syncModelSelection(model) { function getSelectedModel (line 1180) | function getSelectedModel() { function toggleApiKeyVisibility (line 1187) | function toggleApiKeyVisibility() { function showStatus (line 1199) | function showStatus(elId, msgKey, isError) { function saveModelConfig (line 1208) | function saveModelConfig() { function saveAgentConfig (line 1274) | function saveAgentConfig() { function loadConfigView (line 1300) | function loadConfigView() { constant TOOL_ICONS (line 1313) | const TOOL_ICONS = { function getToolIcon (line 1328) | function getToolIcon(name) { function loadSkillsView (line 1332) | function loadSkillsView() { function loadToolsSection (line 1337) | function loadToolsSection() { function loadSkillsSection (line 1378) | function loadSkillsSection() { function renderSkillCard (line 1408) | function renderSkillCard(card, sk) { function toggleSkill (line 1436) | function toggleSkill(name, currentlyEnabled) { function loadMemoryView (line 1472) | function loadMemoryView(page) { function openMemoryFile (line 1521) | function openMemoryFile(filename) { function closeMemoryViewer (line 1533) | function closeMemoryViewer() { function showConfirmDialog (line 1541) | function showConfirmDialog({ title, message, okText, cancelText, onConfi... function loadChannelsView (line 1571) | function loadChannelsView() { function renderActiveChannels (line 1585) | function renderActiveChannels() { function buildChannelFieldsHtml (line 1649) | function buildChannelFieldsHtml(chName, fields) { function bindSecretFieldEvents (line 1687) | function bindSecretFieldEvents(container) { function showChannelStatus (line 1699) | function showChannelStatus(chName, msgKey, isError) { function saveChannelConfig (line 1709) | function saveChannelConfig(chName) { function disconnectChannel (line 1744) | function disconnectChannel(chName) { function openAddChannelPanel (line 1772) | function openAddChannelPanel() { function closeAddChannelPanel (line 1830) | function closeAddChannelPanel() { function onAddChannelSelect (line 1838) | function onAddChannelSelect(chName) { function submitAddChannel (line 1856) | function submitAddChannel() { function loadTasksView (line 1907) | function loadTasksView() { function startLogStream (line 1958) | function startLogStream() { function stopLogStream (line 1984) | function stopLogStream() { FILE: channel/web/web_channel.py function _get_upload_dir (line 27) | def _get_upload_dir() -> str: class WebMessage (line 35) | class WebMessage(ChatMessage): method __init__ (line 36) | def __init__( class WebChannel (line 54) | class WebChannel(ChatChannel): method __init__ (line 63) | def __init__(self): method _generate_msg_id (line 71) | def _generate_msg_id(self): method _generate_request_id (line 76) | def _generate_request_id(self): method send (line 80) | def send(self, reply: Reply, context: Context): method _make_sse_callback (line 127) | def _make_sse_callback(self, request_id: str): method upload_file (line 166) | def upload_file(self): method post_message (line 208) | def post_message(self): method stream_response (line 281) | def stream_response(self, request_id: str): method poll_response (line 310) | def poll_response(self): method chat_page (line 344) | def chat_page(self): method startup (line 350) | def startup(self): method stop (line 413) | def stop(self): class RootHandler (line 423) | class RootHandler: method GET (line 424) | def GET(self): class MessageHandler (line 429) | class MessageHandler: method POST (line 430) | def POST(self): class UploadHandler (line 434) | class UploadHandler: method POST (line 435) | def POST(self): class UploadsHandler (line 440) | class UploadsHandler: method GET (line 441) | def GET(self, file_name): class PollHandler (line 462) | class PollHandler: method POST (line 463) | def POST(self): class StreamHandler (line 467) | class StreamHandler: method GET (line 468) | def GET(self): class ChatHandler (line 482) | class ChatHandler: method GET (line 483) | def GET(self): class ConfigHandler (line 490) | class ConfigHandler: method _mask_key (line 588) | def _mask_key(value: str) -> str: method GET (line 594) | def GET(self): method POST (line 642) | def POST(self): class ChannelsHandler (line 684) | class ChannelsHandler: method _mask_secret (line 754) | def _mask_secret(value: str) -> str: method _parse_channel_list (line 760) | def _parse_channel_list(raw) -> list: method _active_channel_set (line 768) | def _active_channel_set(cls) -> set: method GET (line 771) | def GET(self): method POST (line 805) | def POST(self): method _handle_save (line 830) | def _handle_save(self, channel_name: str, updates: dict): method _handle_connect (line 892) | def _handle_connect(self, channel_name: str, updates: dict): method _handle_disconnect (line 974) | def _handle_disconnect(self, channel_name: str): function _get_workspace_root (line 1019) | def _get_workspace_root(): class ToolsHandler (line 1025) | class ToolsHandler: method GET (line 1026) | def GET(self): class SkillsHandler (line 1049) | class SkillsHandler: method GET (line 1050) | def GET(self): method POST (line 1064) | def POST(self): class MemoryHandler (line 1089) | class MemoryHandler: method GET (line 1090) | def GET(self): class MemoryContentHandler (line 1104) | class MemoryContentHandler: method GET (line 1105) | def GET(self): class SchedulerHandler (line 1123) | class SchedulerHandler: method GET (line 1124) | def GET(self): class HistoryHandler (line 1138) | class HistoryHandler: method GET (line 1139) | def GET(self): class LogsHandler (line 1169) | class LogsHandler: method GET (line 1170) | def GET(self): class AssetsHandler (line 1217) | class AssetsHandler: method GET (line 1218) | def GET(self, file_path): # 修改默认参数 FILE: channel/wechatcom/wechatcomapp_channel.py class WechatComAppChannel (line 29) | class WechatComAppChannel(ChatChannel): method __init__ (line 32) | def __init__(self): method startup (line 46) | def startup(self): method stop (line 65) | def stop(self): method send (line 74) | def send(self, reply: Reply, context: Context): class Query (line 161) | class Query: method GET (line 162) | def GET(self): method POST (line 176) | def POST(self): FILE: channel/wechatcom/wechatcomapp_client.py class WechatComAppClient (line 6) | class WechatComAppClient(WeChatClient): method __init__ (line 7) | def __init__(self, corp_id, secret, access_token=None, session=None, t... method _active_refresh (line 12) | def _active_refresh(self): method fetch_access_token (line 36) | def fetch_access_token(self): FILE: channel/wechatcom/wechatcomapp_message.py class WechatComAppMessage (line 9) | class WechatComAppMessage(ChatMessage): method __init__ (line 10) | def __init__(self, msg, client: WeChatClient, is_group=False): FILE: channel/wechatmp/active_reply.py class Query (line 17) | class Query: method GET (line 18) | def GET(self): method POST (line 21) | def POST(self): FILE: channel/wechatmp/common.py class WeChatAPIException (line 11) | class WeChatAPIException(Exception): function verify_server (line 15) | def verify_server(data): FILE: channel/wechatmp/passive_reply.py class Query (line 19) | class Query: method GET (line 20) | def GET(self): method POST (line 23) | def POST(self): FILE: channel/wechatmp/wechatmp_channel.py class WechatMPChannel (line 39) | class WechatMPChannel(ChatChannel): method __init__ (line 40) | def __init__(self, passive_reply=True): method startup (line 66) | def startup(self): method stop (line 82) | def stop(self): method start_loop (line 91) | def start_loop(self, loop): method delete_media (line 95) | async def delete_media(self, media_id): method send (line 101) | def send(self, reply: Reply, context: Context): method _success_callback (line 325) | def _success_callback(self, session_id, context, **kwargs): # 线程异常结束时... method _fail_callback (line 330) | def _fail_callback(self, session_id, exception, context, **kwargs): #... FILE: channel/wechatmp/wechatmp_client.py class WechatMPClient (line 11) | class WechatMPClient(WeChatClient): method __init__ (line 12) | def __init__(self, appid, secret, access_token=None, session=None, tim... method clear_quota (line 18) | def clear_quota(self): method clear_quota_v2 (line 21) | def clear_quota_v2(self): method fetch_access_token (line 24) | def fetch_access_token(self): # 重载父类方法,加锁避免多线程重复获取access_token method _request (line 35) | def _request(self, method, url_or_endpoint, **kwargs): # 重载父类方法,遇到API... FILE: channel/wechatmp/wechatmp_message.py class WeChatMPMessage (line 9) | class WeChatMPMessage(ChatMessage): method __init__ (line 10) | def __init__(self, msg, client=None): FILE: channel/wecom_bot/wecom_bot_channel.py class WecomBotChannel (line 37) | class WecomBotChannel(ChatChannel): method __init__ (line 39) | def __init__(self): method startup (line 60) | def startup(self): method stop (line 73) | def stop(self): method _start_ws (line 88) | def _start_ws(self): method _ws_send (line 132) | def _ws_send(self, data: dict): method _gen_req_id (line 136) | def _gen_req_id(self) -> str: method _send_subscribe (line 143) | def _send_subscribe(self): method _start_heartbeat (line 153) | def _start_heartbeat(self): method _send_and_wait (line 176) | def _send_and_wait(self, data: dict, timeout: float = 15) -> dict: method _handle_ws_message (line 189) | def _handle_ws_message(self, data: dict): method _handle_msg_callback (line 230) | def _handle_msg_callback(self, data: dict): method _handle_event_callback (line 311) | def _handle_event_callback(self, data: dict): method _make_stream_callback (line 327) | def _make_stream_callback(self, req_id: str): method _compose_context (line 387) | def _compose_context(self, ctype: ContextType, content, **kwargs): method send (line 422) | def send(self, reply: Reply, context: Context): method _send_text (line 449) | def _send_text(self, content: str, receiver: str, is_group: bool, req_... method _send_image (line 474) | def _send_image(self, img_path_or_url: str, receiver: str, is_group: b... method _ensure_image_format (line 550) | def _ensure_image_format(file_path: str) -> str: method _compress_image (line 584) | def _compress_image(file_path: str, max_bytes: int) -> str: method _send_file (line 618) | def _send_file(self, file_path: str, receiver: str, is_group: bool, method _active_send_markdown (line 668) | def _active_send_markdown(self, content: str, receiver: str, is_group:... method _upload_media (line 685) | def _upload_media(self, file_path: str, media_type: str = "file") -> str: FILE: channel/wecom_bot/wecom_bot_message.py function _guess_ext_from_bytes (line 36) | def _guess_ext_from_bytes(data: bytes) -> str: function _decrypt_media (line 56) | def _decrypt_media(url: str, aeskey: str) -> bytes: function _get_tmp_dir (line 79) | def _get_tmp_dir() -> str: class WecomBotMessage (line 87) | class WecomBotMessage(ChatMessage): method __init__ (line 90) | def __init__(self, msg_body: dict, is_group: bool = False): FILE: common/cloud_client.py class CloudClient (line 37) | class CloudClient(LinkAIClient): method __init__ (line 38) | def __init__(self, api_key: str, channel, host: str = ""): method skill_service (line 48) | def skill_service(self): method memory_service (line 65) | def memory_service(self): method chat_service (line 80) | def chat_service(self): method on_message (line 96) | def on_message(self, push_msg: PushMsg): method on_config (line 109) | def on_config(self, config: dict): method _dispatch_channel_action (line 188) | def _dispatch_channel_action(self, action: str, data: dict): method _handle_channel_create (line 202) | def _handle_channel_create(self, channel_type: str, data: dict): method _handle_channel_update (line 225) | def _handle_channel_update(self, channel_type: str, data: dict): method _handle_channel_delete (line 257) | def _handle_channel_delete(self, channel_type: str, data: dict): method _set_channel_credentials (line 272) | def _set_channel_credentials(local_config: dict, channel_type: str, method _clear_channel_credentials (line 298) | def _clear_channel_credentials(local_config: dict, channel_type: str): method _parse_channel_types (line 312) | def _parse_channel_types(local_config: dict) -> list: method _add_channel_type (line 321) | def _add_channel_type(local_config: dict, channel_type: str): method _remove_channel_type (line 328) | def _remove_channel_type(local_config: dict, channel_type: str): method _do_add_channel (line 337) | def _do_add_channel(self, channel_type: str): method _do_remove_channel (line 347) | def _do_remove_channel(self, channel_type: str): method _report_channel_startup (line 354) | def _report_channel_startup(self, channel_type: str): method on_skill (line 371) | def on_skill(self, data: dict) -> dict: method on_memory (line 392) | def on_memory(self, data: dict) -> dict: method on_chat (line 413) | def on_chat(self, data: dict, send_chunk_fn): method on_history (line 438) | def on_history(self, data: dict) -> dict: method _query_history (line 455) | def _query_history(self, payload: dict) -> dict: method _restart_channel (line 494) | def _restart_channel(self, new_channel_type: str): method _do_restart_channel (line 504) | def _do_restart_channel(self, mgr, new_channel_type: str): method _save_config_to_file (line 523) | def _save_config_to_file(self, local_config: dict): function get_root_domain (line 546) | def get_root_domain(host: str = "") -> str: function get_deployment_id (line 565) | def get_deployment_id() -> str: function get_website_base_url (line 570) | def get_website_base_url() -> str: function build_website_prompt (line 590) | def build_website_prompt(workspace_dir: str) -> list: function start (line 621) | def start(channel, channel_mgr=None): function _report_existing_channels (line 638) | def _report_existing_channels(client: CloudClient, mgr): function _build_config (line 650) | def _build_config(): FILE: common/dequeue.py class Dequeue (line 6) | class Dequeue(Queue): method putleft (line 7) | def putleft(self, item, block=True, timeout=None): method putleft_nowait (line 29) | def putleft_nowait(self, item): method _putleft (line 32) | def _putleft(self, item): FILE: common/expired_dict.py class ExpiredDict (line 4) | class ExpiredDict(dict): method __init__ (line 5) | def __init__(self, expires_in_seconds): method __getitem__ (line 9) | def __getitem__(self, key): method __setitem__ (line 17) | def __setitem__(self, key, value): method get (line 21) | def get(self, key, default=None): method __contains__ (line 27) | def __contains__(self, key): method keys (line 34) | def keys(self): method items (line 38) | def items(self): method __iter__ (line 41) | def __iter__(self): FILE: common/log.py function _reset_logger (line 5) | def _reset_logger(log): function _get_logger (line 30) | def _get_logger(): FILE: common/package_manager.py function install (line 9) | def install(package): function install_requirements (line 13) | def install_requirements(file): function check_dulwich (line 18) | def check_dulwich(): FILE: common/singleton.py function singleton (line 1) | def singleton(cls): FILE: common/sorted_dict.py class SortedDict (line 4) | class SortedDict(dict): method __init__ (line 5) | def __init__(self, sort_func=lambda k, v: k, init_dict=None, reverse=F... method __setitem__ (line 17) | def __setitem__(self, key, value): method __delitem__ (line 31) | def __delitem__(self, key): method keys (line 40) | def keys(self): method items (line 45) | def items(self): method _update_heap (line 51) | def _update_heap(self, key): method __iter__ (line 61) | def __iter__(self): method __repr__ (line 64) | def __repr__(self): FILE: common/time_check.py function time_checker (line 7) | def time_checker(f): FILE: common/tmp_dir.py class TmpDir (line 7) | class TmpDir(object): method __init__ (line 12) | def __init__(self): method path (line 17) | def path(self): FILE: common/token_bucket.py class TokenBucket (line 5) | class TokenBucket: method __init__ (line 6) | def __init__(self, tpm, timeout=None): method _generate_tokens (line 16) | def _generate_tokens(self): method get_token (line 25) | def get_token(self): method close (line 35) | def close(self): FILE: common/utils.py function fsize (line 7) | def fsize(file): function compress_imgfile (line 22) | def compress_imgfile(file, max_size): function split_string_by_utf8_length (line 38) | def split_string_by_utf8_length(string, max_length, max_split=0): function get_path_suffix (line 55) | def get_path_suffix(path): function convert_webp_to_png (line 60) | def convert_webp_to_png(webp_image): function remove_markdown_symbol (line 74) | def remove_markdown_symbol(text: str): function expand_path (line 81) | def expand_path(path: str) -> str: function get_cloud_headers (line 120) | def get_cloud_headers(api_key: str) -> dict: FILE: config.py class Config (line 200) | class Config(dict): method __init__ (line 201) | def __init__(self, d=None): method __getitem__ (line 210) | def __getitem__(self, key): method __setitem__ (line 216) | def __setitem__(self, key, value): method get (line 222) | def get(self, key, default=None): method get_user_data (line 239) | def get_user_data(self, user) -> dict: method load_user_datas (line 244) | def load_user_datas(self): method save_user_datas (line 255) | def save_user_datas(self): function drag_sensitive (line 267) | def drag_sensitive(config): function load_config (line 291) | def load_config(): function get_root (line 400) | def get_root(): function read_file (line 404) | def read_file(path): function conf (line 409) | def conf(): function get_appdata_dir (line 413) | def get_appdata_dir(): function subscribe_msg (line 421) | def subscribe_msg(): function write_plugin_config (line 431) | def write_plugin_config(pconf: dict): function remove_plugin_config (line 440) | def remove_plugin_config(name: str): function pconf (line 449) | def pconf(plugin_name: str) -> dict: FILE: models/ali/ali_qwen_bot.py class AliQwenBot (line 21) | class AliQwenBot(Bot): method __init__ (line 22) | def __init__(self): method api_key_client (line 27) | def api_key_client(self): method access_key_id (line 30) | def access_key_id(self): method access_key_secret (line 33) | def access_key_secret(self): method agent_key (line 36) | def agent_key(self): method app_id (line 39) | def app_id(self): method node_id (line 42) | def node_id(self): method temperature (line 45) | def temperature(self): method top_p (line 48) | def top_p(self): method reply (line 51) | def reply(self, query, context=None): method reply_text (line 96) | def reply_text(self, session: AliQwenSession, retry_count=0) -> dict: method set_api_key (line 148) | def set_api_key(self): method update_api_key_if_expired (line 153) | def update_api_key_if_expired(self): method convert_messages_format (line 157) | def convert_messages_format(self, messages) -> Tuple[str, List[ChatQaM... method get_completion_content (line 183) | def get_completion_content(self, response, node_id): method calc_tokens (line 209) | def calc_tokens(self, messages, completion_content): FILE: models/ali/ali_qwen_session.py class AliQwenSession (line 14) | class AliQwenSession(Session): method __init__ (line 15) | def __init__(self, session_id, system_prompt=None, model="qianwen"): method discard_exceeding (line 20) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 51) | def calc_tokens(self): function num_tokens_from_messages (line 54) | def num_tokens_from_messages(messages, model): FILE: models/baidu/baidu_unit_bot.py class BaiduUnitBot (line 10) | class BaiduUnitBot(Bot): method reply (line 11) | def reply(self, query, context=None): method get_token (line 29) | def get_token(self): FILE: models/baidu/baidu_wenxin.py class BaiduWenxinBot (line 17) | class BaiduWenxinBot(Bot): method __init__ (line 19) | def __init__(self): method reply (line 37) | def reply(self, query, context=None): method reply_text (line 77) | def reply_text(self, session: BaiduWenxinSession, retry_count=0): method get_access_token (line 113) | def get_access_token(self): FILE: models/baidu/baidu_wenxin_session.py class BaiduWenxinSession (line 13) | class BaiduWenxinSession(Session): method __init__ (line 14) | def __init__(self, session_id, system_prompt=None, model="gpt-3.5-turb... method discard_exceeding (line 20) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 42) | def calc_tokens(self): function num_tokens_from_messages (line 46) | def num_tokens_from_messages(messages, model): FILE: models/bot.py class Bot (line 10) | class Bot(object): method reply (line 11) | def reply(self, query, context: Context = None) -> Reply: FILE: models/bot_factory.py function create_bot (line 7) | def create_bot(bot_type): FILE: models/chatgpt/chat_gpt_bot.py class ChatGPTBot (line 23) | class ChatGPTBot(Bot, OpenAIImage, OpenAICompatibleBot): method __init__ (line 24) | def __init__(self): method get_api_config (line 57) | def get_api_config(self): method reply (line 69) | def reply(self, query, context=None): method reply_image (line 136) | def reply_image(self, context): method reply_text (line 222) | def reply_text(self, session: ChatGPTSession, api_key=None, args=None,... class AzureChatGPTBot (line 278) | class AzureChatGPTBot(ChatGPTBot): method __init__ (line 279) | def __init__(self): method create_img (line 285) | def create_img(self, query, retry_count=0, api_key=None): FILE: models/chatgpt/chat_gpt_session.py class ChatGPTSession (line 15) | class ChatGPTSession(Session): method __init__ (line 16) | def __init__(self, session_id, system_prompt=None, model="gpt-3.5-turb... method discard_exceeding (line 21) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 52) | def calc_tokens(self): function num_tokens_from_messages (line 57) | def num_tokens_from_messages(messages, model): function num_tokens_by_character (line 99) | def num_tokens_by_character(messages): FILE: models/claudeapi/claude_api_bot.py class ClaudeAPIBot (line 30) | class ClaudeAPIBot(Bot, OpenAIImage): method __init__ (line 31) | def __init__(self): method api_key (line 36) | def api_key(self): method api_base (line 40) | def api_base(self): method proxy (line 44) | def proxy(self): method reply (line 47) | def reply(self, query, context=None): method reply_text (line 88) | def reply_text(self, session: BaiduWenxinSession, retry_count=0, tools... method _model_mapping (line 200) | def _model_mapping(self, model) -> str: method _get_max_tokens (line 211) | def _get_max_tokens(self, model: str) -> int: method call_with_tools (line 227) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _handle_sync_response (line 290) | def _handle_sync_response(self, request_params): method _handle_stream_response (line 362) | def _handle_stream_response(self, request_params): FILE: models/dashscope/dashscope_bot.py class DashscopeBot (line 33) | class DashscopeBot(Bot): method __init__ (line 34) | def __init__(self): method api_key (line 44) | def api_key(self): method _is_multimodal_model (line 48) | def _is_multimodal_model(model_name: str) -> bool: method reply (line 52) | def reply(self, query, context=None): method reply_text (line 96) | def reply_text(self, session: DashscopeSession, retry_count=0) -> dict: method call_with_tools (line 156) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _handle_sync_response (line 257) | def _handle_sync_response(self, model_name, messages, parameters): method _handle_stream_response (line 328) | def _handle_stream_response(self, model_name, messages, parameters): method _response_to_dict (line 424) | def _response_to_dict(response) -> dict: method _convert_tools_to_dashscope_format (line 472) | def _convert_tools_to_dashscope_format(self, tools): method _prepare_messages_for_multimodal (line 501) | def _prepare_messages_for_multimodal(messages: list) -> list: method _convert_messages_to_dashscope_format (line 531) | def _convert_messages_to_dashscope_format(self, messages): method _convert_tool_calls_to_openai_format (line 611) | def _convert_tool_calls_to_openai_format(self, tool_calls): FILE: models/dashscope/dashscope_session.py class DashscopeSession (line 5) | class DashscopeSession(Session): method __init__ (line 6) | def __init__(self, session_id, system_prompt=None, model="qwen-turbo"): method discard_exceeding (line 10) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 42) | def calc_tokens(self): function num_tokens_from_messages (line 46) | def num_tokens_from_messages(messages): FILE: models/doubao/doubao_bot.py class DoubaoBot (line 17) | class DoubaoBot(Bot): method __init__ (line 18) | def __init__(self): method api_key (line 29) | def api_key(self): method base_url (line 33) | def base_url(self): method reply (line 39) | def reply(self, query, context=None): method reply_text (line 88) | def reply_text(self, session: DoubaoSession, args=None, retry_count: i... method call_with_tools (line 152) | def call_with_tools(self, messages, tools=None, stream: bool = False, ... method _handle_stream_response (line 231) | def _handle_stream_response(self, request_body: dict): method _handle_sync_response (line 349) | def _handle_sync_response(self, request_body: dict): method _convert_messages_to_openai_format (line 411) | def _convert_messages_to_openai_format(self, messages): method _convert_tools_to_openai_format (line 499) | def _convert_tools_to_openai_format(self, tools): FILE: models/doubao/doubao_session.py class DoubaoSession (line 5) | class DoubaoSession(Session): method __init__ (line 6) | def __init__(self, session_id, system_prompt=None, model="doubao-seed-... method discard_exceeding (line 11) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 43) | def calc_tokens(self): function num_tokens_from_messages (line 47) | def num_tokens_from_messages(messages, model): FILE: models/gemini/google_gemini_bot.py class GoogleGeminiBot (line 27) | class GoogleGeminiBot(Bot): method __init__ (line 29) | def __init__(self): method api_key (line 34) | def api_key(self): method api_base (line 38) | def api_base(self): method reply (line 44) | def reply(self, query, context: Context = None) -> Reply: method _convert_to_gemini_messages (line 96) | def _convert_to_gemini_messages(self, messages: list): method filter_messages (line 114) | def filter_messages(messages: list): method _extract_image_paths_from_text (line 135) | def _extract_image_paths_from_text(content: str): method _build_image_inline_part (line 145) | def _build_image_inline_part(image_path: str): method _build_inline_part_from_image_url (line 175) | def _build_inline_part_from_image_url(image_url): method call_with_tools (line 221) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _convert_tools_to_gemini_rest_format (line 454) | def _convert_tools_to_gemini_rest_format(self, tools_list): method _handle_gemini_rest_sync_response (line 492) | def _handle_gemini_rest_sync_response(self, response, model_name): method _handle_gemini_rest_stream_response (line 582) | def _handle_gemini_rest_stream_response(self, response, model_name): method _convert_tools_to_gemini_format (line 703) | def _convert_tools_to_gemini_format(self, openai_tools): method _handle_gemini_sync_response (line 723) | def _handle_gemini_sync_response(self, model, messages, request_params... method _handle_gemini_stream_response (line 780) | def _handle_gemini_stream_response(self, model, messages, request_para... FILE: models/linkai/link_ai_bot.py class LinkAIBot (line 22) | class LinkAIBot(Bot, OpenAICompatibleBot): method __init__ (line 27) | def __init__(self): method get_api_config (line 32) | def get_api_config(self): method reply (line 44) | def reply(self, query, context: Context = None) -> Reply: method _chat (line 61) | def _chat(self, query, context, retry_count=0) -> Reply: method _process_image_msg (line 193) | def _process_image_msg(self, app_code: str, session_id: str, query:str... method _find_group_mapping_code (line 216) | def _find_group_mapping_code(self, context): method _build_vision_msg (line 229) | def _build_vision_msg(self, query: str, path: str): method reply_text (line 253) | def reply_text(self, session: ChatGPTSession, app_code="", retry_count... method _fetch_app_info (line 318) | def _fetch_app_info(self, app_code: str): method create_img (line 329) | def create_img(self, query, retry_count=0, api_key=None): method _fetch_knowledge_search_suffix (line 355) | def _fetch_knowledge_search_suffix(self, response) -> str: method _fetch_agent_suffix (line 373) | def _fetch_agent_suffix(self, response): method _process_url (line 402) | def _process_url(self, text): method _send_image (line 411) | def _send_image(self, channel, context, image_urls): function _download_file (line 440) | def _download_file(url: str): class LinkAISessionManager (line 455) | class LinkAISessionManager(SessionManager): method session_msg_query (line 456) | def session_msg_query(self, query, session_id): method session_reply (line 461) | def session_reply(self, reply, session_id, total_tokens=None, query=No... class LinkAISession (line 475) | class LinkAISession(ChatGPTSession): method calc_tokens (line 476) | def calc_tokens(self): method discard_exceeding (line 481) | def discard_exceeding(self, max_tokens, cur_tokens=None): function _linkai_call_with_tools (line 493) | def _linkai_call_with_tools(self, messages, tools=None, stream=False, **... function _handle_linkai_sync_response (line 589) | def _handle_linkai_sync_response(self, base_url, headers, body): function _handle_linkai_stream_response (line 615) | def _handle_linkai_stream_response(self, base_url, headers, body): FILE: models/minimax/minimax_bot.py class MinimaxBot (line 19) | class MinimaxBot(Bot): method __init__ (line 20) | def __init__(self): method api_key (line 30) | def api_key(self): method api_base (line 37) | def api_base(self): method reply (line 40) | def reply(self, query, context: Context = None) -> Reply: method reply_text (line 88) | def reply_text(self, session: MinimaxSession, args=None, retry_count=0... method call_with_tools (line 178) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _convert_messages_to_openai_format (line 253) | def _convert_messages_to_openai_format(self, messages): method _convert_tools_to_openai_format (line 359) | def _convert_tools_to_openai_format(self, tools): method _handle_sync_response (line 394) | def _handle_sync_response(self, request_body): method _handle_stream_response (line 469) | def _handle_stream_response(self, request_body, show_thinking=False): FILE: models/minimax/minimax_session.py class MinimaxSession (line 15) | class MinimaxSession(Session): method __init__ (line 16) | def __init__(self, session_id, system_prompt=None, model="minimax"): method add_query (line 21) | def add_query(self, query): method add_reply (line 25) | def add_reply(self, reply): method discard_exceeding (line 29) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 60) | def calc_tokens(self): function num_tokens_from_messages (line 64) | def num_tokens_from_messages(messages, model): FILE: models/modelscope/modelscope_bot.py class ModelScopeBot (line 17) | class ModelScopeBot(Bot): method __init__ (line 18) | def __init__(self): method api_key (line 31) | def api_key(self): method base_url (line 35) | def base_url(self): method reply (line 42) | def reply(self, query, context=None): method reply_text (line 107) | def reply_text(self, session: ModelScopeSession, args=None, retry_coun... method reply_text_stream (line 175) | def reply_text_stream(self, session: ModelScopeSession, args=None, ret... method create_img (line 255) | def create_img(self, query, retry_count=0): FILE: models/modelscope/modelscope_session.py class ModelScopeSession (line 5) | class ModelScopeSession(Session): method __init__ (line 6) | def __init__(self, session_id, system_prompt=None, model="Qwen/Qwen2.5... method discard_exceeding (line 11) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 43) | def calc_tokens(self): function num_tokens_from_messages (line 47) | def num_tokens_from_messages(messages, model): FILE: models/moonshot/moonshot_bot.py class MoonshotBot (line 17) | class MoonshotBot(Bot): method __init__ (line 18) | def __init__(self): method api_key (line 31) | def api_key(self): method base_url (line 35) | def base_url(self): method reply (line 41) | def reply(self, query, context=None): method reply_text (line 90) | def reply_text(self, session: MoonshotSession, args=None, retry_count:... method call_with_tools (line 152) | def call_with_tools(self, messages, tools=None, stream: bool = False, ... method _handle_stream_response (line 232) | def _handle_stream_response(self, request_body: dict): method _handle_sync_response (line 350) | def _handle_sync_response(self, request_body: dict): method _convert_messages_to_openai_format (line 412) | def _convert_messages_to_openai_format(self, messages): method _convert_tools_to_openai_format (line 500) | def _convert_tools_to_openai_format(self, tools): FILE: models/moonshot/moonshot_session.py class MoonshotSession (line 5) | class MoonshotSession(Session): method __init__ (line 6) | def __init__(self, session_id, system_prompt=None, model="moonshot-v1-... method discard_exceeding (line 11) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 43) | def calc_tokens(self): function num_tokens_from_messages (line 47) | def num_tokens_from_messages(messages, model): FILE: models/openai/open_ai_bot.py class OpenAIBot (line 22) | class OpenAIBot(Bot, OpenAIImage, OpenAICompatibleBot): method __init__ (line 23) | def __init__(self): method get_api_config (line 45) | def get_api_config(self): method reply (line 57) | def reply(self, query, context=None): method reply_text (line 97) | def reply_text(self, session: OpenAISession, retry_count=0): method call_with_tools (line 137) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _handle_sync_response (line 202) | def _handle_sync_response(self, request_params): method _handle_stream_response (line 216) | def _handle_stream_response(self, request_params): FILE: models/openai/open_ai_image.py class OpenAIImage (line 12) | class OpenAIImage(object): method __init__ (line 13) | def __init__(self): method create_img (line 18) | def create_img(self, query, retry_count=0, api_key=None, api_base=None): FILE: models/openai/open_ai_session.py class OpenAISession (line 5) | class OpenAISession(Session): method __init__ (line 6) | def __init__(self, session_id, system_prompt=None, model="text-davinci... method __str__ (line 11) | def __str__(self): method discard_exceeding (line 31) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 62) | def calc_tokens(self): function num_tokens_from_string (line 67) | def num_tokens_from_string(string: str, model: str) -> int: FILE: models/openai/openai_compat.py class ErrorModule (line 22) | class ErrorModule: class OpenAIError (line 54) | class OpenAIError(Exception): class RateLimitError (line 57) | class RateLimitError(OpenAIError): class APIError (line 60) | class APIError(OpenAIError): class APIConnectionError (line 63) | class APIConnectionError(OpenAIError): class AuthenticationError (line 66) | class AuthenticationError(OpenAIError): class InvalidRequestError (line 69) | class InvalidRequestError(OpenAIError): class Timeout (line 72) | class Timeout(OpenAIError): class ErrorModule (line 79) | class ErrorModule: FILE: models/openai_compatible_bot.py class OpenAICompatibleBot (line 16) | class OpenAICompatibleBot: method get_api_config (line 30) | def get_api_config(self): method call_with_tools (line 49) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _handle_sync_response (line 136) | def _handle_sync_response(self, request_params, api_key, api_base): method _handle_stream_response (line 157) | def _handle_stream_response(self, request_params, api_key, api_base): method _convert_tools_to_openai_format (line 181) | def _convert_tools_to_openai_format(self, tools): method _convert_messages_to_openai_format (line 209) | def _convert_messages_to_openai_format(self, messages): FILE: models/session_manager.py class Session (line 6) | class Session(object): method __init__ (line 7) | def __init__(self, session_id, system_prompt=None): method reset (line 16) | def reset(self): method set_system_prompt (line 20) | def set_system_prompt(self, system_prompt): method add_query (line 24) | def add_query(self, query): method add_reply (line 28) | def add_reply(self, reply): method discard_exceeding (line 32) | def discard_exceeding(self, max_tokens=None, cur_tokens=None): method calc_tokens (line 35) | def calc_tokens(self): class SessionManager (line 39) | class SessionManager(object): method __init__ (line 40) | def __init__(self, sessioncls, **session_args): method build_session (line 49) | def build_session(self, session_id, system_prompt=None): method session_query (line 64) | def session_query(self, query, session_id): method session_reply (line 75) | def session_reply(self, reply, session_id, total_tokens=None): method clear_session (line 86) | def clear_session(self, session_id): method clear_all_session (line 90) | def clear_all_session(self): FILE: models/xunfei/xunfei_spark_bot.py class XunFeiBot (line 37) | class XunFeiBot(Bot): method __init__ (line 38) | def __init__(self): method reply (line 58) | def reply(self, query, context: Context = None) -> Reply: method create_web_socket (line 106) | def create_web_socket(self, prompt, session_id, temperature=0.5): method gen_request_id (line 124) | def gen_request_id(self, session_id: str): method create_url (line 129) | def create_url(self): method gen_params (line 160) | def gen_params(self, appid, domain, question): class ReplyItem (line 186) | class ReplyItem: method __init__ (line 187) | def __init__(self, reply, usage=None, is_end=False): function on_error (line 194) | def on_error(ws, error): function on_close (line 199) | def on_close(ws, one, two): function on_open (line 205) | def on_open(ws): function run (line 210) | def run(ws, *args): function on_message (line 221) | def on_message(ws, message): function gen_params (line 245) | def gen_params(appid, domain, question, temperature=0.5): FILE: models/zhipuai/zhipu_ai_image.py class ZhipuAIImage (line 7) | class ZhipuAIImage(object): method __init__ (line 8) | def __init__(self): method create_img (line 19) | def create_img(self, query, retry_count=0, api_key=None, api_base=None): FILE: models/zhipuai/zhipu_ai_session.py class ZhipuAISession (line 5) | class ZhipuAISession(Session): method __init__ (line 6) | def __init__(self, session_id, system_prompt=None, model="glm-4"): method discard_exceeding (line 13) | def discard_exceeding(self, max_tokens, cur_tokens=None): method calc_tokens (line 45) | def calc_tokens(self): function num_tokens_from_messages (line 49) | def num_tokens_from_messages(messages, model): FILE: models/zhipuai/zhipuai_bot.py class ZHIPUAIBot (line 18) | class ZHIPUAIBot(Bot, ZhipuAIImage): method __init__ (line 19) | def __init__(self): method reply (line 36) | def reply(self, query, context=None): method reply_text (line 95) | def reply_text(self, session: ZhipuAISession, args=None, retry_count=0... method call_with_tools (line 152) | def call_with_tools(self, messages, tools=None, stream=False, **kwargs): method _handle_sync_response (line 241) | def _handle_sync_response(self, request_params): method _handle_stream_response (line 278) | def _handle_stream_response(self, request_params): method _convert_tools_to_zhipu_format (line 349) | def _convert_tools_to_zhipu_format(self, tools): method _convert_messages_to_zhipu_format (line 377) | def _convert_messages_to_zhipu_format(self, messages): method _convert_tool_calls_to_openai_format (line 449) | def _convert_tool_calls_to_openai_format(self, tool_calls): FILE: plugins/agent/agent.py class AgentPlugin (line 24) | class AgentPlugin(Plugin): method __init__ (line 27) | def __init__(self): method _load_config (line 37) | def _load_config(self) -> Dict: method get_help_text (line 47) | def get_help_text(self, verbose=False, **kwargs): method get_available_teams (line 68) | def get_available_teams(self) -> List[str]: method create_team_from_config (line 74) | def create_team_from_config(self, team_name: str) -> Optional[AgentTeam]: method on_handle_context (line 146) | def on_handle_context(self, e_context: EventContext): method create_llm_model (line 256) | def create_llm_model(self, model_name) -> LLMModel: function _send_text (line 279) | def _send_text(e_context: EventContext, content: str): FILE: plugins/banwords/banwords.py class Banwords (line 23) | class Banwords(Plugin): method __init__ (line 24) | def __init__(self): method on_handle_context (line 57) | def on_handle_context(self, e_context: EventContext): method on_decorate_reply (line 79) | def on_decorate_reply(self, e_context: EventContext): method get_help_text (line 99) | def get_help_text(self, **kwargs): FILE: plugins/banwords/lib/WordsSearch.py class TrieNode (line 14) | class TrieNode(): method __init__ (line 15) | def __init__(self): method Add (line 26) | def Add(self,c): method SetResults (line 35) | def SetResults(self,index): class TrieNode2 (line 40) | class TrieNode2(): method __init__ (line 41) | def __init__(self): method Add (line 48) | def Add(self,c,node3): method SetResults (line 55) | def SetResults(self,index): method HasKey (line 61) | def HasKey(self,c): method TryGetValue (line 65) | def TryGetValue(self,c): class WordsSearch (line 72) | class WordsSearch(): method __init__ (line 73) | def __init__(self): method SetKeywords (line 78) | def SetKeywords(self,keywords): method FindFirst (line 165) | def FindFirst(self,text): method FindAll (line 186) | def FindAll(self,text): method ContainsAny (line 211) | def ContainsAny(self,text): method Replace (line 229) | def Replace(self,text, replaceChar = '*'): FILE: plugins/dungeon/dungeon.py class StoryTeller (line 15) | class StoryTeller: method __init__ (line 16) | def __init__(self, bot, sessionid, story): method reset (line 23) | def reset(self): method action (line 27) | def action(self, user_action): class Dungeon (line 52) | class Dungeon(Plugin): method __init__ (line 53) | def __init__(self): method on_handle_context (line 63) | def on_handle_context(self, e_context: EventContext): method get_help_text (line 98) | def get_help_text(self, **kwargs): FILE: plugins/finish/finish.py class Finish (line 19) | class Finish(Plugin): method __init__ (line 20) | def __init__(self): method on_handle_context (line 25) | def on_handle_context(self, e_context: EventContext): method get_help_text (line 39) | def get_help_text(self, **kwargs): FILE: plugins/godcmd/godcmd.py function get_help_text (line 138) | def get_help_text(isadmin, isgroup): class Godcmd (line 183) | class Godcmd(Plugin): method __init__ (line 184) | def __init__(self): method on_handle_context (line 214) | def on_handle_context(self, e_context: EventContext): method authenticate (line 445) | def authenticate(self, userid, args, isadmin, isgroup) -> Tuple[bool, ... method get_help_text (line 467) | def get_help_text(self, isadmin=False, isgroup=False, **kwargs): method is_admin_in_group (line 471) | def is_admin_in_group(self, context): method model_mapping (line 477) | def model_mapping(self, model) -> str: method reload (line 482) | def reload(self): FILE: plugins/hello/hello.py class Hello (line 22) | class Hello(Plugin): method __init__ (line 28) | def __init__(self): method on_handle_context (line 44) | def on_handle_context(self, e_context: EventContext): method get_help_text (line 114) | def get_help_text(self, **kwargs): method _load_config_template (line 118) | def _load_config_template(self): FILE: plugins/keyword/keyword.py class Keyword (line 21) | class Keyword(Plugin): method __init__ (line 22) | def __init__(self): method on_handle_context (line 47) | def on_handle_context(self, e_context: EventContext): method get_help_text (line 93) | def get_help_text(self, **kwargs): FILE: plugins/linkai/linkai.py class LinkAI (line 22) | class LinkAI(Plugin): method __init__ (line 23) | def __init__(self): method on_handle_context (line 37) | def on_handle_context(self, e_context: EventContext): method _process_admin_cmd (line 131) | def _process_admin_cmd(self, e_context: EventContext): method _is_summary_open (line 196) | def _is_summary_open(self, context) -> bool: method _is_chat_task (line 229) | def _is_chat_task(self, e_context: EventContext): method _process_chat_task (line 234) | def _process_chat_task(self, e_context: EventContext): method _fetch_group_app_code (line 246) | def _fetch_group_app_code(self, group_name: str) -> str: method _fetch_app_code (line 257) | def _fetch_app_code(self, context) -> str: method get_help_text (line 270) | def get_help_text(self, verbose=False, **kwargs): method _load_config_template (line 285) | def _load_config_template(self): method reload (line 299) | def reload(self): function _send_info (line 303) | def _send_info(e_context: EventContext, content: str): function _find_user_id (line 309) | def _find_user_id(context): function _set_reply_text (line 316) | def _set_reply_text(content: str, e_context: EventContext, level: ReplyT... function _get_trigger_prefix (line 322) | def _get_trigger_prefix(): function _find_sum_id (line 326) | def _find_sum_id(context): function _find_file_id (line 330) | def _find_file_id(context): FILE: plugins/linkai/midjourney.py class TaskType (line 19) | class TaskType(Enum): method __str__ (line 25) | def __str__(self): class Status (line 29) | class Status(Enum): method __str__ (line 35) | def __str__(self): class TaskMode (line 39) | class TaskMode(Enum): class MJTask (line 52) | class MJTask: method __init__ (line 53) | def __init__(self, id, user_id: str, task_type: TaskType, raw_prompt=N... method __str__ (line 65) | def __str__(self): class MJBot (line 70) | class MJBot: method __init__ (line 71) | def __init__(self, config, fetch_group_app_code): method judge_mj_task_type (line 81) | def judge_mj_task_type(self, e_context: EventContext): method process_mj_task (line 106) | def process_mj_task(self, mj_type: TaskType, e_context: EventContext): method generate (line 189) | def generate(self, prompt: str, user_id: str, e_context: EventContext)... method do_operate (line 235) | def do_operate(self, task_type: TaskType, user_id: str, img_id: str, e... method check_task_sync (line 270) | def check_task_sync(self, task: MJTask, e_context: EventContext): method _do_check_task (line 300) | def _do_check_task(self, task: MJTask, e_context: EventContext): method _process_success_task (line 303) | def _process_success_task(self, task: MJTask, res: dict, e_context: Ev... method _check_rate_limit (line 341) | def _check_rate_limit(self, user_id: str, e_context: EventContext) -> ... method _fetch_mode (line 363) | def _fetch_mode(self, prompt) -> str: method _run_loop (line 369) | def _run_loop(self, loop: asyncio.BaseEventLoop): method _print_tasks (line 377) | def _print_tasks(self): method _set_reply_text (line 381) | def _set_reply_text(self, content: str, e_context: EventContext, level... method get_help_text (line 392) | def get_help_text(self, verbose=False, **kwargs): method find_tasks_by_user_id (line 402) | def find_tasks_by_user_id(self, user_id) -> list: method _is_mj_open (line 414) | def _is_mj_open(self, context) -> bool: function _send (line 434) | def _send(channel, reply: Reply, context, retry_cnt=0): function check_prefix (line 447) | def check_prefix(content, prefix_list): FILE: plugins/linkai/summary.py class LinkSummary (line 8) | class LinkSummary: method __init__ (line 9) | def __init__(self): method summary_file (line 12) | def summary_file(self, file_path: str, app_code: str): method summary_url (line 25) | def summary_url(self, url: str, app_code: str): method summary_chat (line 35) | def summary_chat(self, summary_id: str): method _parse_summary_res (line 54) | def _parse_summary_res(self, res): method base_url (line 69) | def base_url(self): method headers (line 72) | def headers(self): method check_file (line 75) | def check_file(self, file_path: str, sum_config: dict) -> bool: method check_url (line 90) | def check_url(self, url: str): FILE: plugins/linkai/utils.py class Util (line 8) | class Util: method is_admin (line 10) | def is_admin(e_context: EventContext) -> bool: method set_reply_text (line 27) | def set_reply_text(content: str, e_context: EventContext, level: Reply... method fetch_app_plugin (line 33) | def fetch_app_plugin(app_code: str, plugin_name: str) -> bool: FILE: plugins/role/role.py class RolePlay (line 16) | class RolePlay: method __init__ (line 17) | def __init__(self, bot, sessionid, desc, wrapper=None): method reset (line 24) | def reset(self): method action (line 27) | def action(self, user_action): class Role (line 43) | class Role(Plugin): method __init__ (line 44) | def __init__(self): method get_role (line 77) | def get_role(self, name, find_closest=True, min_sim=0.35): method on_handle_context (line 98) | def on_handle_context(self, e_context: EventContext): method get_help_text (line 189) | def get_help_text(self, verbose=False, **kwargs): FILE: plugins/tool/tool.py class Tool (line 21) | class Tool(Plugin): method __init__ (line 22) | def __init__(self): method get_help_text (line 32) | def get_help_text(self, verbose=False, **kwargs): method on_handle_context (line 49) | def on_handle_context(self, e_context: EventContext): method _read_json (line 133) | def _read_json(self) -> dict: method _build_tool_kwargs (line 137) | def _build_tool_kwargs(self, kwargs: dict): method _filter_tool_list (line 226) | def _filter_tool_list(self, tool_list: list): method _reset_app (line 235) | def _reset_app(self) -> App: FILE: skills/skill-creator/scripts/init_skill.py function title_case_skill_name (line 189) | def title_case_skill_name(skill_name): function init_skill (line 194) | def init_skill(skill_name, path): function main (line 273) | def main(): FILE: skills/skill-creator/scripts/package_skill.py function package_skill (line 25) | def package_skill(skill_path, output_dir=None): function main (line 91) | def main(): FILE: skills/skill-creator/scripts/quick_validate.py function validate_skill (line 12) | def validate_skill(skill_path): FILE: translate/baidu/baidu_translate.py class BaiduTranslator (line 12) | class BaiduTranslator(Translator): method __init__ (line 13) | def __init__(self) -> None: method translate (line 24) | def translate(self, query: str, from_lang: str = "", to_lang: str = "e... method make_md5 (line 48) | def make_md5(self, s, encoding="utf-8"): FILE: translate/factory.py function create_translator (line 1) | def create_translator(voice_type): FILE: translate/translator.py class Translator (line 6) | class Translator(object): method translate (line 8) | def translate(self, query: str, from_lang: str = "", to_lang: str = "e... FILE: voice/ali/ali_api.py function text_to_speech_aliyun (line 26) | def text_to_speech_aliyun(url, text, appkey, token): function speech_to_text_aliyun (line 65) | def speech_to_text_aliyun(url, audioContent, appkey, token): class AliyunTokenGenerator (line 129) | class AliyunTokenGenerator: method __init__ (line 138) | def __init__(self, access_key_id, access_key_secret): method sign_request (line 142) | def sign_request(self, parameters): method percent_encode (line 169) | def percent_encode(self, encode_str): method get_token (line 186) | def get_token(self): FILE: voice/ali/ali_voice.py class AliVoice (line 28) | class AliVoice(Voice): method __init__ (line 29) | def __init__(self): method textToVoice (line 49) | def textToVoice(self, text): method voiceToText (line 69) | def voiceToText(self, voice_file): method get_valid_token (line 88) | def get_valid_token(self): FILE: voice/audio_convert.py function find_closest_sil_supports (line 22) | def find_closest_sil_supports(sample_rate): function get_pcm_from_wav (line 38) | def get_pcm_from_wav(wav_path): function any_to_mp3 (line 49) | def any_to_mp3(any_path, mp3_path): function any_to_wav (line 65) | def any_to_wav(any_path, wav_path): function any_to_sil (line 82) | def any_to_sil(any_path, sil_path): function any_to_amr (line 103) | def any_to_amr(any_path, amr_path): function sil_to_wav (line 120) | def sil_to_wav(silk_path, wav_path, rate: int = 24000): function split_audio (line 129) | def split_audio(file_path, max_segment_length_ms=60000): FILE: voice/azure/azure_voice.py class AzureVoice (line 26) | class AzureVoice(Voice): method __init__ (line 27) | def __init__(self): method voiceToText (line 59) | def voiceToText(self, voice_file): method textToVoice (line 72) | def textToVoice(self, text): FILE: voice/baidu/baidu_voice.py class BaiduVoice (line 23) | class BaiduVoice(Voice): method __init__ (line 24) | def __init__(self): method _get_access_token (line 59) | def _get_access_token(self): method voiceToText (line 82) | def voiceToText(self, voice_file): method _long_text_synthesis (line 95) | def _long_text_synthesis(self, text): method textToVoice (line 151) | def textToVoice(self, text): FILE: voice/edge/edge_voice.py class EdgeVoice (line 12) | class EdgeVoice(Voice): method __init__ (line 14) | def __init__(self): method voiceToText (line 37) | def voiceToText(self, voice_file): method gen_voice (line 40) | async def gen_voice(self, text, fileName): method textToVoice (line 44) | def textToVoice(self, text): FILE: voice/elevent/elevent_voice.py class ElevenLabsVoice (line 15) | class ElevenLabsVoice(Voice): method __init__ (line 17) | def __init__(self): method voiceToText (line 20) | def voiceToText(self, voice_file): method textToVoice (line 23) | def textToVoice(self, text): FILE: voice/factory.py function create_voice (line 6) | def create_voice(voice_type): FILE: voice/google/google_voice.py class GoogleVoice (line 16) | class GoogleVoice(Voice): method __init__ (line 19) | def __init__(self): method voiceToText (line 22) | def voiceToText(self, voice_file): method textToVoice (line 36) | def textToVoice(self, text): FILE: voice/linkai/linkai_voice.py class LinkAIVoice (line 15) | class LinkAIVoice(Voice): method __init__ (line 16) | def __init__(self): method voiceToText (line 19) | def voiceToText(self, voice_file): method textToVoice (line 55) | def textToVoice(self, text): FILE: voice/openai/openai_voice.py class OpenaiVoice (line 16) | class OpenaiVoice(Voice): method __init__ (line 17) | def __init__(self): method voiceToText (line 20) | def voiceToText(self, voice_file): method textToVoice (line 47) | def textToVoice(self, text): FILE: voice/pytts/pytts_voice.py class PyttsVoice (line 17) | class PyttsVoice(Voice): method __init__ (line 20) | def __init__(self): method textToVoice (line 35) | def textToVoice(self, text): FILE: voice/tencent/tencent_voice.py class TencentVoice (line 13) | class TencentVoice(Voice): method __init__ (line 14) | def __init__(self): method _load_config (line 21) | def _load_config(self): method setup (line 37) | def setup(self, config): method voiceToText (line 43) | def voiceToText(self, voice_file): method textToVoice (line 86) | def textToVoice(self, text): FILE: voice/voice.py class Voice (line 6) | class Voice(object): method voiceToText (line 7) | def voiceToText(self, voice_file): method textToVoice (line 13) | def textToVoice(self, text): FILE: voice/xunfei/xunfei_asr.py class Ws_Param (line 47) | class Ws_Param(object): method __init__ (line 49) | def __init__(self, APPID, APIKey, APISecret,BusinessArgs, AudioFile): method create_url (line 61) | def create_url(self): function on_message (line 95) | def on_message(ws, message): function on_error (line 135) | def on_error(ws, error): function on_close (line 140) | def on_close(ws,a,b): function on_open (line 145) | def on_open(ws): function xunfei_asr (line 189) | def xunfei_asr(APPID,APISecret,APIKey,BusinessArgsASR,AudioFile): FILE: voice/xunfei/xunfei_tts.py class Ws_Param (line 46) | class Ws_Param(object): method __init__ (line 48) | def __init__(self, APPID, APIKey, APISecret,BusinessArgs,Text): method create_url (line 64) | def create_url(self): function on_message (line 96) | def on_message(ws, message): function on_open (line 123) | def on_open(ws): function on_error (line 140) | def on_error(ws, error): function on_close (line 146) | def on_close(ws): function xunfei_tts (line 151) | def xunfei_tts(APPID, APIKey, APISecret,BusinessArgsTTS, Text, OutFile): FILE: voice/xunfei/xunfei_voice.py class XunfeiVoice (line 42) | class XunfeiVoice(Voice): method __init__ (line 43) | def __init__(self): method voiceToText (line 60) | def voiceToText(self, voice_file): method textToVoice (line 82) | def textToVoice(self, text):