MCPcopy Create free account

hub / github.com/GautamVhavle/CatGPT-Gateway / functions

Functions289 in github.com/GautamVhavle/CatGPT-Gateway

↓ 40 callersFunctionassert_eq
(label: str, actual, expected)
scripts/test_responses_api.py:85
↓ 23 callersFunctionassert_truthy
(label, value)
scripts/test_codex_cli.py:146
↓ 20 callersFunctionsetup_logging
Configure and return a logger that writes to file (and optionally console). Args: name: Logger name. log_file: Optional file
src/log.py:28
↓ 17 callersMethod_mount_system
(self, text: str, css_class: str = "system-msg")
src/cli/app.py:627
↓ 15 callersFunctionassert_truthy
(label: str, value)
scripts/test_responses_api.py:106
↓ 15 callersFunctionassert_type
(label: str, value, expected_type)
scripts/test_responses_api.py:99
↓ 14 callersMethodstop
Disconnect the MutationObserver.
src/dom_observer.py:62
↓ 13 callersFunction_event
(event_type: str, data: dict)
src/api/openai_routes.py:1100
↓ 13 callersFunctionok
(msg: str)
scripts/test_codex_cli.py:112
↓ 12 callersMethodsend_message
Send a message to Claude and wait for the complete response. Args: text: The message text to send. image_pat
src/claude/client.py:51
↓ 12 callersFunctionseparator
(title: str)
scripts/test_responses_api.py:60
↓ 11 callersFunctionassert_eq
(label, actual, expected)
scripts/test_codex_cli.py:125
↓ 11 callersFunctionfail
(msg: str)
scripts/test_responses_api.py:72
↓ 10 callersFunctionassert_in
(label, value, container)
scripts/test_codex_cli.py:132
↓ 10 callersFunctionassert_nonempty_string
(label: str, value)
scripts/test_responses_api.py:113
↓ 9 callersMethodclose
Gracefully close the browser context and playwright instance.
src/browser/manager.py:503
↓ 9 callersMethodis_logged_in
Check if user is logged in by looking for chat input vs login indicators. Returns True if the chat interface is visible, False if lo
src/browser/manager.py:447
↓ 8 callersFunctionassert_nonempty_string
(label, value)
scripts/test_codex_cli.py:153
↓ 8 callersFunctionfail
(msg: str)
scripts/test_codex_cli.py:118
↓ 8 callersMethodnew_chat
Start a new conversation by navigating to /new.
src/claude/client.py:160
↓ 8 callersFunctionpost_responses
POST to /v1/responses. Returns parsed JSON or raw response for streaming.
scripts/test_responses_api.py:120
↓ 8 callersFunctionseparator
(title: str)
scripts/test_codex_cli.py:106
↓ 8 callersFunctionvalidate_response_object
Validate that a response object has all required fields with correct types.
scripts/test_responses_api.py:164
↓ 7 callersMethod_refresh_status
(self)
src/cli/app.py:642
↓ 7 callersFunctionok
(msg: str)
scripts/test_responses_api.py:66
↓ 7 callersFunctionpost_responses
(client: httpx.Client, body: dict, stream: bool = False)
scripts/test_codex_cli.py:188
↓ 7 callersMethodprovider_url
Return the target URL for the active provider.
src/config.py:47
↓ 7 callersFunctionseparator
(title: str)
scripts/test_langchain_tools.py:96
↓ 6 callersFunction_extract_content_text
Extract text from message content (handles both string and list format).
src/api/openai_routes.py:153
↓ 6 callersFunction_latest_assistant_turn_snapshot
Return metadata for the latest assistant turn in Claude.ai. Claude wraps each assistant response in a div with data-is-streaming attribute.
src/claude/detector.py:66
↓ 6 callersMethodnavigate
Navigate to a URL and wait for page load.
src/browser/manager.py:369
↓ 6 callersFunctionrandom_delay
Sleep for a random duration (milliseconds).
src/browser/human.py:20
↓ 6 callersMethodstart
Inject a MutationObserver that logs DOM changes to the console. We capture those via page console listener.
src/dom_observer.py:23
↓ 6 callersMethodstart
Launch a persistent Chrome context with stealth and human-like settings. Automatically cleans up stale lock files from previous cras
src/browser/manager.py:190
↓ 5 callersFunction_get_client
()
src/api/routes.py:50
↓ 5 callersFunction_latest_assistant_turn_snapshot
Return metadata for the latest assistant turn (article ordered). signature format: "<article-index>:<stable-id>" where stable-id is best
src/chatgpt/detector.py:102
↓ 5 callersMethodclear
Clear captured requests.
src/network_recorder.py:63
↓ 5 callersFunctioncount_turns
(page)
scripts/test_input_methods.py:96
↓ 5 callersFunctionseparator
(title: str)
scripts/test_image_generation.py:59
↓ 4 callersFunction_estimate_tokens
Rough token estimate (~4 chars per token).
src/api/openai_routes.py:148
↓ 4 callersFunction_get_client
()
src/api/openai_routes.py:139
↓ 4 callersFunctioncheck_textarea_state
Check the current state of the textarea and send button.
scripts/test_input_methods.py:57
↓ 4 callersFunctionextract_last_response_via_copy
Extract latest assistant response by clicking copy on the latest turn.
src/claude/detector.py:371
↓ 4 callersFunctionis_incomplete_response_text
Heuristic: true when text looks like transient "thinking/searching" UI status.
src/chatgpt/detector.py:33
↓ 3 callersMethod__init__
(self)
src/cli/app.py:256
↓ 3 callersFunction_build_response
Convert internal ChatResponse to API ChatResponse with image data.
src/api/routes.py:56
↓ 3 callersMethod_detect_page_error
Check if the current page shows a browser or ChatGPT error.
src/chatgpt/client.py:373
↓ 3 callersFunction_ensure_fresh_chat
Enforce cooldown between messages and start new chat if thread is full. ChatGPT's web UI degrades after ~6-8 messages in a thread (stops gene
src/api/openai_routes.py:79
↓ 3 callersMethod_extract_thread_id
Extract the thread/conversation ID from the current URL.
src/claude/client.py:300
↓ 3 callersMethod_find_selector
Try each selector in the fallback list. Return the first one that matches.
src/chatgpt/client.py:496
↓ 3 callersFunction_get_lock
Get or create the global request lock (lazy init).
src/api/openai_routes.py:64
↓ 3 callersFunction_image_to_data_url
Read a local image and return an OpenAI-compatible base64 data URL.
scripts/test_langchain_tools.py:102
↓ 3 callersFunction_increment_thread_count
Increment the thread message counter after a successful response.
src/api/openai_routes.py:118
↓ 3 callersFunction_inject_stealth_js
Inject stealth JS into the current page via evaluate().
src/browser/stealth.py:32
↓ 3 callersMethod_wait_for_chat_input
Wait for the chat input to become visible and interactive.
src/chatgpt/client.py:360
↓ 3 callersMethodaction_quit_app
(self)
src/cli/app.py:622
↓ 3 callersFunctioncount_assistant_messages
Count assistant turns (article based, newest-UI friendly).
src/chatgpt/detector.py:174
↓ 3 callersMethodensure_dirs
Create required directories if they don't exist.
src/config.py:83
↓ 3 callersFunctionextract_last_response_via_copy
Extract latest assistant response by clicking copy on the latest turn. Never intentionally copies from previous_turn_signature when provided
src/chatgpt/detector.py:519
↓ 3 callersFunctionidle_mouse_movement
Simulate idle mouse movement — small random movements to look alive. Call this periodically while waiting for responses.
src/browser/human.py:144
↓ 3 callersFunctionis_incomplete_response_text
Heuristic: true when text looks like transient thinking/analyzing status.
src/claude/detector.py:31
↓ 3 callersFunctionprint_header
(text: str)
scripts/test_multi_turn.py:57
↓ 3 callersFunctionsave_b64_image
Save a base64-encoded image to disk. Returns the file path.
scripts/test_image_generation.py:65
↓ 2 callersFunction_build_prompt
Flatten an OpenAI-style message array into a single prompt string that we can paste into ChatGPT's input box. The browser already mainta
src/api/openai_routes.py:309
↓ 2 callersFunction_build_tool_system_prompt
Build a system-level instruction that tells the model about available tools. *tool_choice* controls how insistent the instructions are:
src/api/openai_routes.py:380
↓ 2 callersFunction_count_copy_buttons
Count assistant turns that currently expose a copy button.
src/claude/detector.py:149
↓ 2 callersMethod_dismiss_overlays
Check for and dismiss any blocking dialogs/overlays on the page.
src/chatgpt/client.py:517
↓ 2 callersMethod_do_export
(self, filename: str)
src/cli/app.py:560
↓ 2 callersFunction_download_file
Download / decode a file (image, PDF, etc.) from URL, base64 data URL, or a file attachment dict. Returns the local file path.
src/api/openai_routes.py:226
↓ 2 callersFunction_dump_all_turns
Dump info about all conversation turns for debugging.
src/chatgpt/detector.py:73
↓ 2 callersFunction_empty_snapshot
()
src/chatgpt/detector.py:62
↓ 2 callersFunction_empty_snapshot
()
src/claude/detector.py:55
↓ 2 callersMethod_find_selector
Try each selector in the fallback list. Return the first one that matches.
src/claude/client.py:224
↓ 2 callersFunction_find_test_images
Return up to *n* image files from IMAGE_DIR.
scripts/test_langchain_tools.py:118
↓ 2 callersFunction_parse_tool_calls
Try to parse tool calls from the model's response text. Uses robust brace-matching extraction (handles nested JSON, arrays, etc.) then v
src/api/openai_routes.py:555
↓ 2 callersMethod_status_text
(self)
src/cli/app.py:631
↓ 2 callersFunction_wait_for_new_turn_signature
Wait until latest assistant-turn signature differs from previous one.
src/chatgpt/detector.py:230
↓ 2 callersFunction_wait_for_new_turn_signature
Wait until latest assistant-turn signature differs from previous one.
src/claude/detector.py:168
↓ 2 callersFunctionassert_in
(label: str, value, container)
scripts/test_responses_api.py:92
↓ 2 callersFunctioncount_assistant_messages
Count assistant turns (based on data-is-streaming divs).
src/claude/detector.py:137
↓ 2 callersFunctionhuman_click
Click an element with human-like behavior: 1. Hover over element (triggers mouseover) 2. Brief pause 3. Click Uses .first to han
src/browser/human.py:128
↓ 2 callersFunctionhuman_type
Insert text into a contenteditable input field. Uses execCommand('insertText') which fires proper beforeinput/input events that ProseMir
src/browser/human.py:29
↓ 2 callersFunctionnormalize_assistant_text
Normalize extracted assistant text for validation and comparisons.
src/chatgpt/detector.py:25
↓ 2 callersFunctionnormalize_assistant_text
Normalize extracted assistant text for validation and comparisons.
src/claude/detector.py:23
↓ 2 callersFunctionparse_sse_events
Parse SSE event stream text into list of {event, data} dicts.
scripts/test_responses_api.py:129
↓ 2 callersFunctionparse_sse_events
(text: str)
scripts/test_codex_cli.py:160
↓ 2 callersFunctionprint_header
(text: str)
scripts/test_robust.py:88
↓ 2 callersFunctionprint_header
(text: str)
scripts/test_images.py:63
↓ 2 callersMethodrecover_page
Recover from DNS / page errors by re-navigating to ChatGPT. Tries JS navigation first (avoids DNS lookup), then page.goto(). Returns
src/browser/manager.py:375
↓ 2 callersFunctionrun_round
Send a series of messages and collect results. Returns thread_id.
scripts/test_multi_turn.py:71
↓ 2 callersFunctionsend_and_wait
(msg, msg_num, delay_before=0)
scripts/test_insert_text.py:29
↓ 2 callersMethodstop_animation
(self)
src/cli/app.py:201
↓ 2 callersFunctionvalidate_output_message
Validate a message output item.
scripts/test_responses_api.py:189
↓ 2 callersFunctionwait_for_response_complete
Wait until ChatGPT finishes generating the current response. Uses latest-turn alignment to avoid returning stale previous-turn output.
src/chatgpt/detector.py:257
↓ 2 callersFunctionwait_for_response_complete
Wait until Claude finishes generating the current response. Primary signal: data-is-streaming attribute changes from "true" to "false".
src/claude/detector.py:195
↓ 1 callersFunction_apply_stealth_docker
Docker-safe stealth: evaluate JS on every page and listen for navigations. add_init_script() is broken in Docker (kills DNS), so we: 1.
src/browser/stealth.py:55
↓ 1 callersFunction_build_response_object
Build a full ResponseObject from the model output.
src/api/openai_routes.py:1019
↓ 1 callersMethod_check_connection
(self)
src/cli/app.py:321
↓ 1 callersFunction_check_page_error
Check if the page is showing an error state (DNS failure, crash, etc.). Returns error description string if an error is detected, None otherwise.
src/chatgpt/detector.py:313
↓ 1 callersFunction_cleanup_stale_locks
Remove stale lock / journal / WAL files that prevent browser launch. After a crash, Chromium leaves behind: - SingletonLock/Socket/Cooki
src/browser/manager.py:72
next →1–100 of 289, ranked by callers