Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GautamVhavle/CatGPT-Gateway
/ functions
Functions
289 in github.com/GautamVhavle/CatGPT-Gateway
⨍
Functions
289
◇
Types & classes
51
↳
Endpoints
10
↓ 40 callers
Function
assert_eq
(label: str, actual, expected)
scripts/test_responses_api.py:85
↓ 23 callers
Function
assert_truthy
(label, value)
scripts/test_codex_cli.py:146
↓ 20 callers
Function
setup_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 callers
Method
_mount_system
(self, text: str, css_class: str = "system-msg")
src/cli/app.py:627
↓ 15 callers
Function
assert_truthy
(label: str, value)
scripts/test_responses_api.py:106
↓ 15 callers
Function
assert_type
(label: str, value, expected_type)
scripts/test_responses_api.py:99
↓ 14 callers
Method
stop
Disconnect the MutationObserver.
src/dom_observer.py:62
↓ 13 callers
Function
_event
(event_type: str, data: dict)
src/api/openai_routes.py:1100
↓ 13 callers
Function
ok
(msg: str)
scripts/test_codex_cli.py:112
↓ 12 callers
Method
send_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 callers
Function
separator
(title: str)
scripts/test_responses_api.py:60
↓ 11 callers
Function
assert_eq
(label, actual, expected)
scripts/test_codex_cli.py:125
↓ 11 callers
Function
fail
(msg: str)
scripts/test_responses_api.py:72
↓ 10 callers
Function
assert_in
(label, value, container)
scripts/test_codex_cli.py:132
↓ 10 callers
Function
assert_nonempty_string
(label: str, value)
scripts/test_responses_api.py:113
↓ 9 callers
Method
close
Gracefully close the browser context and playwright instance.
src/browser/manager.py:503
↓ 9 callers
Method
is_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 callers
Function
assert_nonempty_string
(label, value)
scripts/test_codex_cli.py:153
↓ 8 callers
Function
fail
(msg: str)
scripts/test_codex_cli.py:118
↓ 8 callers
Method
new_chat
Start a new conversation by navigating to /new.
src/claude/client.py:160
↓ 8 callers
Function
post_responses
POST to /v1/responses. Returns parsed JSON or raw response for streaming.
scripts/test_responses_api.py:120
↓ 8 callers
Function
separator
(title: str)
scripts/test_codex_cli.py:106
↓ 8 callers
Function
validate_response_object
Validate that a response object has all required fields with correct types.
scripts/test_responses_api.py:164
↓ 7 callers
Method
_refresh_status
(self)
src/cli/app.py:642
↓ 7 callers
Function
ok
(msg: str)
scripts/test_responses_api.py:66
↓ 7 callers
Function
post_responses
(client: httpx.Client, body: dict, stream: bool = False)
scripts/test_codex_cli.py:188
↓ 7 callers
Method
provider_url
Return the target URL for the active provider.
src/config.py:47
↓ 7 callers
Function
separator
(title: str)
scripts/test_langchain_tools.py:96
↓ 6 callers
Function
_extract_content_text
Extract text from message content (handles both string and list format).
src/api/openai_routes.py:153
↓ 6 callers
Function
_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 callers
Method
navigate
Navigate to a URL and wait for page load.
src/browser/manager.py:369
↓ 6 callers
Function
random_delay
Sleep for a random duration (milliseconds).
src/browser/human.py:20
↓ 6 callers
Method
start
Inject a MutationObserver that logs DOM changes to the console. We capture those via page console listener.
src/dom_observer.py:23
↓ 6 callers
Method
start
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 callers
Function
_get_client
()
src/api/routes.py:50
↓ 5 callers
Function
_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 callers
Method
clear
Clear captured requests.
src/network_recorder.py:63
↓ 5 callers
Function
count_turns
(page)
scripts/test_input_methods.py:96
↓ 5 callers
Function
separator
(title: str)
scripts/test_image_generation.py:59
↓ 4 callers
Function
_estimate_tokens
Rough token estimate (~4 chars per token).
src/api/openai_routes.py:148
↓ 4 callers
Function
_get_client
()
src/api/openai_routes.py:139
↓ 4 callers
Function
check_textarea_state
Check the current state of the textarea and send button.
scripts/test_input_methods.py:57
↓ 4 callers
Function
extract_last_response_via_copy
Extract latest assistant response by clicking copy on the latest turn.
src/claude/detector.py:371
↓ 4 callers
Function
is_incomplete_response_text
Heuristic: true when text looks like transient "thinking/searching" UI status.
src/chatgpt/detector.py:33
↓ 3 callers
Method
__init__
(self)
src/cli/app.py:256
↓ 3 callers
Function
_build_response
Convert internal ChatResponse to API ChatResponse with image data.
src/api/routes.py:56
↓ 3 callers
Method
_detect_page_error
Check if the current page shows a browser or ChatGPT error.
src/chatgpt/client.py:373
↓ 3 callers
Function
_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 callers
Method
_extract_thread_id
Extract the thread/conversation ID from the current URL.
src/claude/client.py:300
↓ 3 callers
Method
_find_selector
Try each selector in the fallback list. Return the first one that matches.
src/chatgpt/client.py:496
↓ 3 callers
Function
_get_lock
Get or create the global request lock (lazy init).
src/api/openai_routes.py:64
↓ 3 callers
Function
_image_to_data_url
Read a local image and return an OpenAI-compatible base64 data URL.
scripts/test_langchain_tools.py:102
↓ 3 callers
Function
_increment_thread_count
Increment the thread message counter after a successful response.
src/api/openai_routes.py:118
↓ 3 callers
Function
_inject_stealth_js
Inject stealth JS into the current page via evaluate().
src/browser/stealth.py:32
↓ 3 callers
Method
_wait_for_chat_input
Wait for the chat input to become visible and interactive.
src/chatgpt/client.py:360
↓ 3 callers
Method
action_quit_app
(self)
src/cli/app.py:622
↓ 3 callers
Function
count_assistant_messages
Count assistant turns (article based, newest-UI friendly).
src/chatgpt/detector.py:174
↓ 3 callers
Method
ensure_dirs
Create required directories if they don't exist.
src/config.py:83
↓ 3 callers
Function
extract_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 callers
Function
idle_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 callers
Function
is_incomplete_response_text
Heuristic: true when text looks like transient thinking/analyzing status.
src/claude/detector.py:31
↓ 3 callers
Function
print_header
(text: str)
scripts/test_multi_turn.py:57
↓ 3 callers
Function
save_b64_image
Save a base64-encoded image to disk. Returns the file path.
scripts/test_image_generation.py:65
↓ 2 callers
Function
_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 callers
Function
_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 callers
Function
_count_copy_buttons
Count assistant turns that currently expose a copy button.
src/claude/detector.py:149
↓ 2 callers
Method
_dismiss_overlays
Check for and dismiss any blocking dialogs/overlays on the page.
src/chatgpt/client.py:517
↓ 2 callers
Method
_do_export
(self, filename: str)
src/cli/app.py:560
↓ 2 callers
Function
_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 callers
Function
_dump_all_turns
Dump info about all conversation turns for debugging.
src/chatgpt/detector.py:73
↓ 2 callers
Function
_empty_snapshot
()
src/chatgpt/detector.py:62
↓ 2 callers
Function
_empty_snapshot
()
src/claude/detector.py:55
↓ 2 callers
Method
_find_selector
Try each selector in the fallback list. Return the first one that matches.
src/claude/client.py:224
↓ 2 callers
Function
_find_test_images
Return up to *n* image files from IMAGE_DIR.
scripts/test_langchain_tools.py:118
↓ 2 callers
Function
_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 callers
Method
_status_text
(self)
src/cli/app.py:631
↓ 2 callers
Function
_wait_for_new_turn_signature
Wait until latest assistant-turn signature differs from previous one.
src/chatgpt/detector.py:230
↓ 2 callers
Function
_wait_for_new_turn_signature
Wait until latest assistant-turn signature differs from previous one.
src/claude/detector.py:168
↓ 2 callers
Function
assert_in
(label: str, value, container)
scripts/test_responses_api.py:92
↓ 2 callers
Function
count_assistant_messages
Count assistant turns (based on data-is-streaming divs).
src/claude/detector.py:137
↓ 2 callers
Function
human_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 callers
Function
human_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 callers
Function
normalize_assistant_text
Normalize extracted assistant text for validation and comparisons.
src/chatgpt/detector.py:25
↓ 2 callers
Function
normalize_assistant_text
Normalize extracted assistant text for validation and comparisons.
src/claude/detector.py:23
↓ 2 callers
Function
parse_sse_events
Parse SSE event stream text into list of {event, data} dicts.
scripts/test_responses_api.py:129
↓ 2 callers
Function
parse_sse_events
(text: str)
scripts/test_codex_cli.py:160
↓ 2 callers
Function
print_header
(text: str)
scripts/test_robust.py:88
↓ 2 callers
Function
print_header
(text: str)
scripts/test_images.py:63
↓ 2 callers
Method
recover_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 callers
Function
run_round
Send a series of messages and collect results. Returns thread_id.
scripts/test_multi_turn.py:71
↓ 2 callers
Function
send_and_wait
(msg, msg_num, delay_before=0)
scripts/test_insert_text.py:29
↓ 2 callers
Method
stop_animation
(self)
src/cli/app.py:201
↓ 2 callers
Function
validate_output_message
Validate a message output item.
scripts/test_responses_api.py:189
↓ 2 callers
Function
wait_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 callers
Function
wait_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 callers
Function
_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 callers
Function
_build_response_object
Build a full ResponseObject from the model output.
src/api/openai_routes.py:1019
↓ 1 callers
Method
_check_connection
(self)
src/cli/app.py:321
↓ 1 callers
Function
_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 callers
Function
_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