Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/The-Pocket/PocketFlow-Tutorial-Website-Chatbot
/ functions
Functions
57 in github.com/The-Pocket/PocketFlow-Tutorial-Website-Chatbot
⨍
Functions
57
◇
Types & classes
4
↳
Endpoints
3
↓ 9 callers
Function
addMessage
(content, isUser = false, isSystem = false)
static/chatbot.js:1033
↓ 5 callers
Function
hideTyping
()
static/chatbot.js:1131
↓ 5 callers
Function
setStatus
(status)
static/chatbot.js:943
↓ 4 callers
Function
loadResource
(url, type = 'script')
static/chatbot.js:652
↓ 3 callers
Function
call_llm
(prompt: str)
utils/call_llm.py:4
↓ 3 callers
Function
clearChatHistory
()
static/chatbot.js:1135
↓ 3 callers
Function
connectWebSocket
()
static/chatbot.js:1180
↓ 3 callers
Function
create_support_bot_flow
Create and return an AI support bot flow.
flow.py:4
↓ 3 callers
Function
filter_valid_urls
Filter URLs based on allowed prefixes or domains. If allowed_prefixes_or_domains is empty, all valid URLs are returned (no domain filtering).
utils/url_validator.py:37
↓ 3 callers
Function
is_valid_url
Check if URL is valid based on allowed prefixes or domains.
utils/url_validator.py:8
↓ 2 callers
Function
crawl_webpage
Crawl webpage to extract markdown content and all links using crawl4ai. This is a synchronous wrapper around an async implementation.
utils/web_crawler.py:4
↓ 2 callers
Function
createChatElements
()
static/chatbot.js:674
↓ 2 callers
Function
detectTheme
()
static/chatbot.js:50
↓ 2 callers
Function
enableInput
()
static/chatbot.js:1211
↓ 2 callers
Function
initializeChatbotLogic
(currentUrl, extraUrls, prefixes, chatbotName, wsUrl, instruction = '', isOpenByDefault = false, wasCurrentUrl
static/chatbot.js:884
↓ 2 callers
Function
showTyping
()
static/chatbot.js:1126
↓ 2 callers
Function
toggleChat
(forceOpen = null)
static/chatbot.js:950
↓ 2 callers
Function
updateChatbotTheme
(newTheme)
static/chatbot.js:76
↓ 1 callers
Function
_async_crawl
()
utils/web_crawler.py:9
↓ 1 callers
Method
connect
(self, websocket: WebSocket)
server.py:65
↓ 1 callers
Method
disconnect
(self, websocket: WebSocket)
server.py:71
↓ 1 callers
Function
get_domain_from_url
Extract domain from URL for allowed_domains
main.py:5
↓ 1 callers
Method
get_flow
(self, websocket: WebSocket)
server.py:84
↓ 1 callers
Method
get_shared_state
(self, websocket: WebSocket)
server.py:78
↓ 1 callers
Function
is_basic_valid_url
Check if URL has basic validity (proper scheme and netloc) without domain restrictions.
utils/url_validator.py:3
↓ 1 callers
Function
main
()
main.py:10
↓ 1 callers
Function
renderMarkdownWithMermaid
(markdownText)
static/chatbot.js:984
↓ 1 callers
Function
sendMessage
()
static/chatbot.js:1248
↓ 1 callers
Method
set_shared_state
(self, websocket: WebSocket, state: Dict)
server.py:81
↓ 1 callers
Function
setupAutomaticUrlDetection
(onPageChangeCallback)
static/chatbot.js:1361
↓ 1 callers
Function
setupThemeObserver
()
static/chatbot.js:87
↓ 1 callers
Function
validate_and_sanitize_input
Validate and sanitize user inputs for safety.
server.py:18
↓ 1 callers
Function
waitForConnection
()
static/chatbot.js:1290
Method
__init__
(self)
server.py:61
Function
checkThemeChange
()
static/chatbot.js:88
Method
exec
Process a single URL to extract content and links
nodes.py:20
Method
exec
Make decision using LLM - focus purely on decision-making
nodes.py:148
Method
exec
Generate comprehensive answer based on collected knowledge
nodes.py:314
Method
exec_fallback
Fallback when crawling fails. The 'None' for links signals a failure.
nodes.py:26
Method
exec_fallback
Fallback when LLM decision fails
nodes.py:257
Method
exec_fallback
Fallback when answer generation fails
nodes.py:387
Function
get_chatbot
Serve the chatbot page.
server.py:47
Function
get_chatbot_js
Serve the chatbot JavaScript for embedding.
server.py:53
Function
get_root
Serve the main configuration page.
server.py:41
Function
handlePageChange
(newUrl)
static/chatbot.js:1325
Function
handleUrlChange
()
static/chatbot.js:1364
Function
initializeChatbot
* PocketFlow Chatbot - Standalone Embeddable Chatbot * * Usage: * <script src="chatbot.js"></script> * <script> * document.addEventListener('DOM
static/chatbot.js:22
Method
post
Store results and update URL tracking
nodes.py:32
Method
post
Handle the agent's decision
nodes.py:267
Method
post
Store the final answer
nodes.py:392
Method
prep
(self, shared)
nodes.py:10
Method
prep
(self, shared)
nodes.py:90
Method
prep
(self, shared)
nodes.py:292
Function
run_sync_flow_in_thread
()
server.py:155
Function
startNewConversation
()
static/chatbot.js:1149
Function
toggleMaximize
()
static/chatbot.js:973
Function
websocket_endpoint
(websocket: WebSocket)
server.py:90