Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/daveebbelaar/ai-cookbook
/ functions
Functions
176 in github.com/daveebbelaar/ai-cookbook
⨍
Functions
176
◇
Types & classes
74
↓ 1 callers
Method
process_email
Process an email and store it in Mem0 memory Args: email_content (str): Raw email content user_id (str): Use
knowledge/mem0/cloud/email_example.py:17
↓ 1 callers
Function
process_query
Process a query using OpenAI and available MCP tools. Args: query: The user query. Returns: The response from OpenAI.
mcp/crash-course/4-openai-integration/client-simple.py:78
↓ 1 callers
Method
process_query
Process a query using OpenAI and available MCP tools. Args: query: The user query. Returns: The response fro
mcp/crash-course/4-openai-integration/client.py:85
↓ 1 callers
Function
process_request
(request: str)
agents/building-blocks/5-control.py:54
↓ 1 callers
Function
process_ticket
(ticket: str)
agents/agent-complexity/2-prompt-chains.py:81
↓ 1 callers
Function
read_file
Read one markdown file by relative path.
knowledge/agentic-rag/1-build-tools.py:112
↓ 1 callers
Function
read_file
Read a markdown file by relative path. Refuses paths outside the notes directory.
knowledge/agentic-rag/utils/tools.py:38
↓ 1 callers
Function
reciprocal_rank_fusion
Fuse multiple ranked lists of doc_ids into one ranked list.
knowledge/hybrid-retrieval/4-rrf.py:27
↓ 1 callers
Function
reciprocal_rank_fusion
( rankings: list[list[str]], k: int = 60 )
knowledge/hybrid-retrieval/utils/fusion.py:11
↓ 1 callers
Function
requires_approval
(tool_name: str, args: dict)
models/openai/10-human-in-the-loop/2-tool-call-approval.py:104
↓ 1 callers
Function
reranked_topk
(query: str, candidate_k: int = 50, k: int = 10)
knowledge/hybrid-retrieval/6-evaluate.py:84
↓ 1 callers
Function
resilient_intelligence
(prompt: str)
agents/building-blocks/6-recovery.py:17
↓ 1 callers
Function
resize_image
(image_path: str, target_size: tuple[int, int] = (720, 1280))
models/openai/08-video/utils/resizer.py:4
↓ 1 callers
Method
review_post
Reviewer: Analyze and improve overall cohesion
patterns/workflows/2-workflow-patterns/4-orchestrator.py:192
↓ 1 callers
Function
route_based_on_intent
(user_input: str)
agents/building-blocks/5-control.py:17
↓ 1 callers
Function
route_calendar_request
Router LLM call to determine the type of calendar request
patterns/workflows/2-workflow-patterns/2-routing.py:73
↓ 1 callers
Function
run_harness
(task: str)
agents/agent-complexity/4-agent-harness.py:93
↓ 1 callers
Function
run_orchestrator
(task: str)
agents/agent-complexity/5-multi-agent.py:145
↓ 1 callers
Function
run_suspicious_example
()
patterns/workflows/2-workflow-patterns/3-parallizaton.py:124
↓ 1 callers
Function
run_valid_example
()
patterns/workflows/2-workflow-patterns/3-parallizaton.py:110
↓ 1 callers
Function
run_with_visible_steps
(question: str, debug: bool = False)
knowledge/agentic-rag/4-streaming-steps.py:40
↓ 1 callers
Function
search_bm25
Return the top-k (doc_id, score) pairs for a query.
knowledge/hybrid-retrieval/2-bm25.py:66
↓ 1 callers
Function
search_dense
Return the top-k (doc_id, similarity) pairs for a query.
knowledge/hybrid-retrieval/3-embed.py:80
↓ 1 callers
Method
search_emails
Search through stored emails Args: query (str): Search query user_id (str): User identifier
knowledge/mem0/cloud/email_example.py:72
↓ 1 callers
Function
search_handbook
Retrieve the handbook content for the agent to interpret. Note: The query parameter is accepted but not used - we return the full handbook. T
context/web/3-search-handbook.py:38
↓ 1 callers
Function
search_hybrid
Retrieve top candidate_k from each retriever, fuse, return top k.
knowledge/hybrid-retrieval/4-rrf.py:52
↓ 1 callers
Function
search_kb
Load the whole knowledge base from the JSON file. (This is a mock function for demonstration purposes, we don't search)
patterns/workflows/1-introduction/4-retrieval.py:18
↓ 1 callers
Function
search_reranked
( query: str, k: int = 10, candidate_k: int = 50 )
knowledge/hybrid-retrieval/5-rerank.py:41
↓ 1 callers
Function
send_reply
(message: str)
models/openai/04-structured-output/Instructor/03-content-filtering.py:9
↓ 1 callers
Function
send_reply
(message: str)
models/openai/04-structured-output/Instructor/01-instructor.py:7
↓ 1 callers
Function
structured_intelligence
(prompt: str)
agents/building-blocks/4-validation.py:22
↓ 1 callers
Function
transfer_money
(to_account: str, amount: float)
models/openai/10-human-in-the-loop/2-tool-call-approval.py:75
↓ 1 callers
Function
transfer_money
(to_account: str, amount: float)
models/openai/10-human-in-the-loop/1-structured-output.py:39
↓ 1 callers
Function
validate_calendar_request
Check if the input is a valid calendar request
patterns/workflows/2-workflow-patterns/3-parallizaton.py:46
↓ 1 callers
Method
write_blog
Process the entire blog writing task
patterns/workflows/2-workflow-patterns/4-orchestrator.py:217
↓ 1 callers
Method
write_section
Worker: Write a specific blog section with context from previous sections. Args: topic: The main blog topic section:
patterns/workflows/2-workflow-patterns/4-orchestrator.py:153
Method
__init__
( self, model: str = "gpt-4.1", system_prompt: str = None, verbose: bool = Tru
context/web/tools/agent.py:26
Method
__init__
(self)
knowledge/hybrid-retrieval/utils/retrievers.py:38
Method
__init__
(self)
knowledge/hybrid-retrieval/utils/retrievers.py:54
Method
__init__
Initialize the tokenizer. Args: model_name: The name of the OpenAI encoding to use max_length: Maximum sequence lengt
knowledge/docling/utils/tokenizer.py:11
Method
__init__
Initialize the Email Processor with Mem0 memory client
knowledge/mem0/cloud/email_example.py:13
Method
__init__
Initialize the CustomerSupportAIAgent with memory configuration and OpenAI client.
knowledge/mem0/oss/support_agent.py:9
Method
__init__
(self)
patterns/workflows/2-workflow-patterns/4-orchestrator.py:134
Method
__init__
Initialize the OpenAI MCP client. Args: model: The OpenAI model to use.
mcp/crash-course/4-openai-integration/client.py:22
Method
__init__
(self, use_proxy: bool = True)
mcp/servers/youtube/src/service.py:16
Method
__init__
(self)
models/openai/08-video/utils/director.py:10
Method
_convert_id_to_token
(self, index: int)
knowledge/docling/utils/tokenizer.py:34
Method
_convert_token_to_id
(self, token: str)
knowledge/docling/utils/tokenizer.py:31
Method
_tokenize
(self, text: str)
knowledge/docling/utils/tokenizer.py:28
Function
add
Add two numbers together
mcp/crash-course/6-run-with-docker/server.py:16
Function
add
Add two numbers together
mcp/crash-course/3-simple-server-setup/server.py:17
Function
check_payment_gateway
(args)
agents/agent-complexity/5-multi-agent.py:42
Function
check_payment_gateway
(args)
agents/agent-complexity/4-agent-harness.py:39
Function
check_refund_policy
( ctx: RunContext[CustomerDeps], charge_description: str )
agents/agent-complexity/3-tool-calling-agent.py:71
Method
cleanup
Clean up resources.
mcp/crash-course/4-openai-integration/client.py:146
Method
enforce_confirmation_rule
(self)
models/openai/10-human-in-the-loop/1-structured-output.py:65
Method
from_pretrained
Class method to match HuggingFace's interface.
knowledge/docling/utils/tokenizer.py:48
Function
get_customer_balance
(ctx: RunContext[CustomerDeps])
agents/agent-complexity/3-tool-calling-agent.py:57
Method
get_email_thread
Retrieve all emails in a thread based on subject Args: subject (str): Email subject to match user_id (str):
knowledge/mem0/cloud/email_example.py:91
Function
get_knowledge_base
Retrieve the entire knowledge base as a formatted string. Returns: A formatted string containing all Q&A pairs from the knowledge base.
mcp/crash-course/4-openai-integration/server.py:14
Method
get_memories
Retrieve all memories associated with the given customer ID. :param user_id: Optional user ID to filter memories. :return: L
knowledge/mem0/oss/support_agent.py:46
Function
get_recent_charges
(ctx: RunContext[CustomerDeps])
agents/agent-complexity/3-tool-calling-agent.py:63
Function
get_tool_definition
()
context/web/tools/get_web_page.py:12
Function
get_tool_definition
()
context/web/tools/search_handbook.py:19
Function
get_tool_definition
Get web search tool definition for responses API.
context/web/tools/web_search.py:1
Method
get_vocab
(self)
knowledge/docling/utils/tokenizer.py:37
Function
grep
Search markdown notes with ripgrep and return matching `file:line:text` lines. Set `context` to include N surrounding lines around each match (rg
knowledge/agentic-rag/6-production.py:66
Function
issue_refund
(args)
agents/agent-complexity/5-multi-agent.py:65
Function
issue_refund
( ctx: RunContext[CustomerDeps], amount: float, reason: str )
agents/agent-complexity/3-tool-calling-agent.py:82
Function
issue_refund
(args)
agents/agent-complexity/4-agent-harness.py:62
Function
list_files
List files in the notes directory using a glob pattern.
knowledge/agentic-rag/6-production.py:133
Function
read_file
Read a bounded line range from a file relative to the notes root.
knowledge/agentic-rag/6-production.py:160
Method
save_vocabulary
(self, *args)
knowledge/docling/utils/tokenizer.py:44
Method
search
(self, query: str, k: int = 10)
knowledge/hybrid-retrieval/utils/retrievers.py:65
Function
search_reranked
( query: str, bm25: BM25Retriever, dense: DenseRetriever, corpus_by_id: pd.DataFrame, k: i
knowledge/hybrid-retrieval/utils/reranker.py:29
Method
vocab_size
(self)
knowledge/docling/utils/tokenizer.py:41
← previous
101–176 of 176, ranked by callers