MCPcopy Create free account

hub / github.com/daveebbelaar/ai-cookbook / functions

Functions176 in github.com/daveebbelaar/ai-cookbook

↓ 21 callersMethodsearch
(self, query: str, k: int = 10)
knowledge/hybrid-retrieval/utils/retrievers.py:42
↓ 9 callersMethod_log
Print log message if verbose.
context/web/tools/agent.py:57
↓ 6 callersFunctiondownload_sora_video
( video: Video, output_folder: str, filename: str = None, extension: str = ".mp4", )
models/openai/08-video/utils/downloader.py:8
↓ 4 callersFunctionhybrid_candidates
( query: str, bm25: BM25Retriever, dense: DenseRetriever, candidate_k: int = 50, )
knowledge/hybrid-retrieval/utils/fusion.py:21
↓ 4 callersFunctionload_corpus
()
knowledge/hybrid-retrieval/utils/retrievers.py:28
↓ 4 callersFunctionndcg_at_k
Normalized discounted cumulative gain for a single query.
knowledge/hybrid-retrieval/6-evaluate.py:42
↓ 4 callersMethodtokenize
Main method used by HybridChunker.
knowledge/docling/utils/tokenizer.py:24
↓ 3 callersFunctionprocess_calendar_request
Main function implementing the routing workflow
patterns/workflows/2-workflow-patterns/2-routing.py:151
↓ 3 callersFunctionrun_with_approval
(prompt: str)
models/openai/10-human-in-the-loop/2-tool-call-approval.py:123
↓ 3 callersFunctionrun_with_confirmation
(prompt: str)
models/openai/10-human-in-the-loop/1-structured-output.py:94
↓ 3 callersFunctionsend_reply
(message: str)
models/openai/04-structured-output/02-json-mode.py:8
↓ 3 callersFunctionshow
(label: str, results: list[tuple[str, float]])
knowledge/hybrid-retrieval/4-rrf.py:61
↓ 2 callersMethod_call_function
Execute a tool function.
context/web/tools/agent.py:49
↓ 2 callersFunctioncall_function
Execute a tool function.
context/web/4-search-agent.py:33
↓ 2 callersFunctionembed_batch
Embed a batch of texts and return a (len(texts), 1536) array.
knowledge/hybrid-retrieval/3-embed.py:35
↓ 2 callersMethodgenerate_sora_prompt
( self, idea: str, prompt_template: str = PIXAR_PROMPT )
models/openai/08-video/utils/director.py:13
↓ 2 callersFunctionget_sitemap_urls
Fetches and parses a sitemap XML file to extract URLs. Args: base_url: The base URL of the website sitemap_filename: The filename
knowledge/docling/utils/sitemap.py:8
↓ 2 callersFunctionget_web_page
Fetch and convert a web page to markdown.
context/web/tools/get_web_page.py:6
↓ 2 callersFunctionhybrid_topk
(query: str, candidate_k: int = 50)
knowledge/hybrid-retrieval/6-evaluate.py:78
↓ 2 callersFunctionprocess_calendar_request
Main function implementing the prompt chain with gate check
patterns/workflows/2-workflow-patterns/1-prompt-chaining.py:138
↓ 2 callersFunctionprocess_ticket
(customer_message: str)
models/openai/04-structured-output/Instructor/04-ticket-system.py:38
↓ 2 callersFunctionrerank_with_cohere
( query: str, candidate_ids: list[str], corpus_by_id: pd.DataFrame, k: int = 10, )
knowledge/hybrid-retrieval/utils/reranker.py:18
↓ 2 callersFunctionsearch_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/tools/search_handbook.py:6
↓ 2 callersFunctionsend_reply
(message: str)
models/openai/04-structured-output/03-function-calling.py:7
↓ 2 callersFunctionsend_reply
(message: str)
models/openai/04-structured-output/01-introduction.py:7
↓ 2 callersFunctionshow
(label: str, results: list[tuple[str, float]])
knowledge/hybrid-retrieval/5-rerank.py:63
↓ 2 callersFunctionvalidate_request
Run validation checks in parallel
patterns/workflows/2-workflow-patterns/3-parallizaton.py:83
↓ 1 callersMethod_create_api
Create API instance with optional proxy support.
mcp/servers/youtube/src/service.py:19
↓ 1 callersMethod_embed_query
(self, query: str)
knowledge/hybrid-retrieval/utils/retrievers.py:60
↓ 1 callersMethod_get_email_body
Extract the body content from an email
knowledge/mem0/cloud/email_example.py:62
↓ 1 callersFunction_ripgrep_install_hint
Return the most relevant ripgrep install command for this OS.
knowledge/agentic-rag/6-production.py:36
↓ 1 callersFunction_safe_path
Resolve a user-supplied path against NOTES_DIR.
knowledge/agentic-rag/6-production.py:53
↓ 1 callersFunctionadd
Add two numbers together
mcp/crash-course/5-mcp-vs-function-calling/tools.py:1
↓ 1 callersFunctionanswer_question
(question: str)
agents/building-blocks/5-control.py:46
↓ 1 callersMethodask
Ask the agent a question. Maintains conversation history.
context/web/tools/agent.py:62
↓ 1 callersFunctionask_agent
Ask the agent a question. It will decide whether to search the handbook.
context/web/3-search-handbook.py:91
↓ 1 callersFunctionask_agent
Ask the agent a question. It will decide which tools to use.
context/web/4-search-agent.py:42
↓ 1 callersFunctionask_followup_with_memory
(joke_response: str)
agents/building-blocks/2-memory.py:33
↓ 1 callersFunctionask_followup_without_memory
()
agents/building-blocks/2-memory.py:23
↓ 1 callersFunctionask_joke_without_memory
()
agents/building-blocks/2-memory.py:13
↓ 1 callersFunctionbasic_intelligence
(prompt: str)
agents/building-blocks/1-intelligence.py:11
↓ 1 callersFunctionbuild_index
Embed the full corpus in batches with a progress bar.
knowledge/hybrid-retrieval/3-embed.py:41
↓ 1 callersFunctioncall_function
(name: str, args: dict)
context/web/3-search-handbook.py:85
↓ 1 callersFunctioncall_function
(name, args)
patterns/workflows/1-introduction/4-retrieval.py:74
↓ 1 callersFunctioncall_function
(name, args)
patterns/workflows/1-introduction/3-tools.py:76
↓ 1 callersFunctioncall_function
(name, args)
agents/building-blocks/3-tools.py:22
↓ 1 callersFunctionchat_with_memories
(message: str, user_id: str = "default_user")
knowledge/mem0/oss/memory_demo.py:18
↓ 1 callersFunctioncheck_security
Check for potential security risks
patterns/workflows/2-workflow-patterns/3-parallizaton.py:62
↓ 1 callersFunctioncleanup
Clean up resources.
mcp/crash-course/4-openai-integration/client-simple.py:142
↓ 1 callersFunctionconnect_to_server
Connect to an MCP server. Args: server_script_path: Path to the server script.
mcp/crash-course/4-openai-integration/client-simple.py:27
↓ 1 callersMethodconnect_to_server
Connect to an MCP server. Args: server_script_path: Path to the server script.
mcp/crash-course/4-openai-integration/client.py:36
↓ 1 callersFunctioncreate_file
(client, file_path)
models/openai/05-responses/07-file-search.py:18
↓ 1 callersFunctiondeposit_money
(amount: float)
models/openai/10-human-in-the-loop/2-tool-call-approval.py:83
↓ 1 callersFunctiondeposit_money
(amount: float)
models/openai/10-human-in-the-loop/1-structured-output.py:47
↓ 1 callersFunctionexecute_tool
(name: str, args: dict)
models/openai/10-human-in-the-loop/2-tool-call-approval.py:89
↓ 1 callersFunctionextract_event_info
First LLM call to determine if input is a calendar event
patterns/workflows/2-workflow-patterns/1-prompt-chaining.py:61
↓ 1 callersFunctionextract_video_id
Extract video ID from URL or return as-is if already an ID.
mcp/servers/youtube/src/utils.py:4
↓ 1 callersMethodfetch
Fetch transcript.
mcp/servers/youtube/src/service.py:38
↓ 1 callersFunctionformat_tool_result
( event: FunctionToolResultEvent, tool_names: dict[str, str], )
knowledge/agentic-rag/utils/streaming.py:14
↓ 1 callersFunctiongenerate_confirmation
Third LLM call to generate a confirmation message
patterns/workflows/2-workflow-patterns/1-prompt-chaining.py:113
↓ 1 callersFunctionget_article_content
(url)
models/openai/04-structured-output/04-structured-output.py:152
↓ 1 callersFunctionget_article_summary
(text: str)
models/openai/04-structured-output/04-structured-output.py:197
↓ 1 callersFunctionget_balance
()
models/openai/10-human-in-the-loop/2-tool-call-approval.py:71
↓ 1 callersFunctionget_balance
()
models/openai/10-human-in-the-loop/1-structured-output.py:35
↓ 1 callersFunctionget_chat_response
Get streaming response from OpenAI API. Args: messages: Chat history context: Retrieved context from database Returns:
knowledge/docling/5-chat.py:61
↓ 1 callersFunctionget_context
Search the database for relevant context. Args: query: User's question table: LanceDB table object num_results: Number of
knowledge/docling/5-chat.py:25
↓ 1 callersFunctionget_human_approval
(content: str)
agents/building-blocks/7-feedback.py:9
↓ 1 callersFunctionget_mcp_tools
Get available tools from the MCP server in OpenAI format. Returns: A list of tools in OpenAI format.
mcp/crash-course/4-openai-integration/client-simple.py:56
↓ 1 callersMethodget_mcp_tools
Get available tools from the MCP server in OpenAI format. Returns: A list of tools in OpenAI format.
mcp/crash-course/4-openai-integration/client.py:66
↓ 1 callersMethodget_plan
Get orchestrator's blog structure plan
patterns/workflows/2-workflow-patterns/4-orchestrator.py:137
↓ 1 callersFunctionget_ticket_response_json
(query)
models/openai/04-structured-output/04-structured-output.py:29
↓ 1 callersFunctionget_ticket_response_pydantic
(query: str)
models/openai/04-structured-output/04-structured-output.py:87
↓ 1 callersFunctionget_transcript
Get transcript as plain text.
mcp/servers/youtube/server.py:25
↓ 1 callersMethodget_transcript_text
Get transcript as plain text.
mcp/servers/youtube/src/service.py:46
↓ 1 callersFunctionget_user_approval
(tool_name: str, args: dict)
models/openai/10-human-in-the-loop/2-tool-call-approval.py:110
↓ 1 callersFunctionget_weather
This is a publically available API that returns the weather for a given location.
patterns/workflows/1-introduction/3-tools.py:19
↓ 1 callersFunctionget_weather
(latitude, longitude)
agents/building-blocks/3-tools.py:14
↓ 1 callersFunctiongrep
Search markdown files for matching lines.
knowledge/agentic-rag/1-build-tools.py:77
↓ 1 callersFunctiongrep
Search all markdown files in the notes directory for lines matching `pattern` (case-insensitive regex). Returns lines as 'file:lineno: text'.
knowledge/agentic-rag/utils/tools.py:21
↓ 1 callersFunctionhandle_complaint
(complaint: str)
agents/building-blocks/5-control.py:58
↓ 1 callersFunctionhandle_modify_event
Process an event modification request
patterns/workflows/2-workflow-patterns/2-routing.py:123
↓ 1 callersFunctionhandle_new_event
Process a new event request
patterns/workflows/2-workflow-patterns/2-routing.py:95
↓ 1 callersMethodhandle_query
Handle a customer query and store the relevant information in memory. :param query: The customer query to handle. :param use
knowledge/mem0/oss/support_agent.py:27
↓ 1 callersFunctioninit_db
Initialize database connection. Returns: LanceDB table object
knowledge/docling/5-chat.py:15
↓ 1 callersFunctionintelligence_with_human_feedback
(prompt: str)
agents/building-blocks/7-feedback.py:15
↓ 1 callersFunctionintelligence_with_tools
(prompt: str)
agents/building-blocks/3-tools.py:28
↓ 1 callersFunctionlist_files
List markdown files in notes/ matching a glob pattern.
knowledge/agentic-rag/1-build-tools.py:33
↓ 1 callersFunctionlist_files
List markdown files in the notes directory matching a glob pattern.
knowledge/agentic-rag/utils/tools.py:16
↓ 1 callersFunctionmain
Run interactive terminal agent.
context/web/5-interactive-agent.py:4
↓ 1 callersFunctionmain
()
knowledge/mem0/oss/memory_demo.py:45
↓ 1 callersFunctionmain
()
mcp/crash-course/6-run-with-docker/client.py:19
↓ 1 callersFunctionmain
Main entry point for the client.
mcp/crash-course/4-openai-integration/client.py:151
↓ 1 callersFunctionmain
Main entry point for the client.
mcp/crash-course/4-openai-integration/client-simple.py:148
↓ 1 callersFunctionmain
()
mcp/crash-course/3-simple-server-setup/client-stdio.py:9
↓ 1 callersFunctionmain
()
mcp/crash-course/3-simple-server-setup/client-sse.py:19
↓ 1 callersFunctionmain
()
mcp/crash-course/3-simple-server-setup/client-streamable-http.py:19
↓ 1 callersFunctionmain
()
models/openai/06-agents/02-handoffs.py:24
↓ 1 callersFunctionparse_event_details
Second LLM call to extract specific event details
patterns/workflows/2-workflow-patterns/1-prompt-chaining.py:87
↓ 1 callersFunctionpreview
(content: Any)
knowledge/agentic-rag/utils/streaming.py:6
↓ 1 callersFunctionprint_agent_trace
(result)
agents/agent-complexity/utils.py:4
next →1–100 of 176, ranked by callers