diff --git a/notebooks/Chapter 1_ Prompt Chaining (Code Example) b/notebooks/.ipynb_checkpoints/Chapter 1_ Prompt Chaining (Code Example)-checkpoint similarity index 100% rename from notebooks/Chapter 1_ Prompt Chaining (Code Example) rename to notebooks/.ipynb_checkpoints/Chapter 1_ Prompt Chaining (Code Example)-checkpoint diff --git a/notebooks/Appendix C_ b/notebooks/Appendix C_.ipynb similarity index 100% rename from notebooks/Appendix C_ rename to notebooks/Appendix C_.ipynb diff --git a/notebooks/Appendix_ Pydantic b/notebooks/Appendix_ Pydantic.ipynb similarity index 100% rename from notebooks/Appendix_ Pydantic rename to notebooks/Appendix_ Pydantic.ipynb diff --git a/notebooks/Chapter 10_ Model Context Protocol (ADK Agent Consuming FastMCP Server) b/notebooks/Chapter 10_ Model Context Protocol (ADK Agent Consuming FastMCP Server).ipynb similarity index 100% rename from notebooks/Chapter 10_ Model Context Protocol (ADK Agent Consuming FastMCP Server) rename to notebooks/Chapter 10_ Model Context Protocol (ADK Agent Consuming FastMCP Server).ipynb diff --git a/notebooks/Chapter 10_ Model Context Protocol (FastMCP Server Example) b/notebooks/Chapter 10_ Model Context Protocol (FastMCP Server Example).ipynb similarity index 100% rename from notebooks/Chapter 10_ Model Context Protocol (FastMCP Server Example) rename to notebooks/Chapter 10_ Model Context Protocol (FastMCP Server Example).ipynb diff --git a/notebooks/Chapter 10_ Model Context Protocol (__init__.py for FastMCP Client Agent) b/notebooks/Chapter 10_ Model Context Protocol (__init__.py for FastMCP Client Agent).ipynb similarity index 100% rename from notebooks/Chapter 10_ Model Context Protocol (__init__.py for FastMCP Client Agent) rename to notebooks/Chapter 10_ Model Context Protocol (__init__.py for FastMCP Client Agent).ipynb diff --git a/notebooks/Chapter 10_ Model Context Protocol (__init__.py for MCP Filesystem Example) b/notebooks/Chapter 10_ Model Context Protocol (__init__.py for MCP Filesystem Example).ipynb similarity index 100% rename from notebooks/Chapter 10_ Model Context Protocol (__init__.py for MCP Filesystem Example) rename to notebooks/Chapter 10_ Model Context Protocol (__init__.py for MCP Filesystem Example).ipynb diff --git a/notebooks/Chapter 10_ Model Context Protocol (agent.py for MCP Filesystem Example) b/notebooks/Chapter 10_ Model Context Protocol (agent.py for MCP Filesystem Example).ipynb similarity index 100% rename from notebooks/Chapter 10_ Model Context Protocol (agent.py for MCP Filesystem Example) rename to notebooks/Chapter 10_ Model Context Protocol (agent.py for MCP Filesystem Example).ipynb diff --git a/notebooks/Chapter 12_ Exception Handling and Recovery (Agent with Fallback) b/notebooks/Chapter 12_ Exception Handling and Recovery (Agent with Fallback).ipynb similarity index 100% rename from notebooks/Chapter 12_ Exception Handling and Recovery (Agent with Fallback) rename to notebooks/Chapter 12_ Exception Handling and Recovery (Agent with Fallback).ipynb diff --git a/notebooks/Chapter 13_ Human-in-the-Loop (Customer Support Agent with Personalization and Escalation) b/notebooks/Chapter 13_ Human-in-the-Loop (Customer Support Agent with Personalization and Escalation).ipynb similarity index 100% rename from notebooks/Chapter 13_ Human-in-the-Loop (Customer Support Agent with Personalization and Escalation) rename to notebooks/Chapter 13_ Human-in-the-Loop (Customer Support Agent with Personalization and Escalation).ipynb diff --git a/notebooks/Chapter 14_ Knowledge Retrieval (RAG LangChain) b/notebooks/Chapter 14_ Knowledge Retrieval (RAG LangChain).ipynb similarity index 100% rename from notebooks/Chapter 14_ Knowledge Retrieval (RAG LangChain) rename to notebooks/Chapter 14_ Knowledge Retrieval (RAG LangChain).ipynb diff --git a/notebooks/Chapter 14_ Knowledge Retrieval (RAG Google Search) b/notebooks/Chapter 14_ Knowledge Retrieval (RAG Google Search).ipynb similarity index 100% rename from notebooks/Chapter 14_ Knowledge Retrieval (RAG Google Search) rename to notebooks/Chapter 14_ Knowledge Retrieval (RAG Google Search).ipynb diff --git a/notebooks/Chapter 14_ Knowledge Retrieval (RAG VertexAI) b/notebooks/Chapter 14_ Knowledge Retrieval (RAG VertexAI).ipynb similarity index 100% rename from notebooks/Chapter 14_ Knowledge Retrieval (RAG VertexAI) rename to notebooks/Chapter 14_ Knowledge Retrieval (RAG VertexAI).ipynb diff --git a/notebooks/Chapter 15_ Inter-Agent Communication (A2A AgentCard for an Agent acting as a WeatherBot) b/notebooks/Chapter 15_ Inter-Agent Communication (A2A AgentCard for an Agent acting as a WeatherBot).ipynb similarity index 100% rename from notebooks/Chapter 15_ Inter-Agent Communication (A2A AgentCard for an Agent acting as a WeatherBot) rename to notebooks/Chapter 15_ Inter-Agent Communication (A2A AgentCard for an Agent acting as a WeatherBot).ipynb diff --git a/notebooks/Chapter 15_ Inter-Agent Communication (A2A) b/notebooks/Chapter 15_ Inter-Agent Communication (A2A).ipynb similarity index 100% rename from notebooks/Chapter 15_ Inter-Agent Communication (A2A) rename to notebooks/Chapter 15_ Inter-Agent Communication (A2A).ipynb diff --git a/notebooks/Chapter 15_ Inter-Agent Communication (Synchronous and Streaming Requests) b/notebooks/Chapter 15_ Inter-Agent Communication (Synchronous and Streaming Requests).ipynb similarity index 100% rename from notebooks/Chapter 15_ Inter-Agent Communication (Synchronous and Streaming Requests) rename to notebooks/Chapter 15_ Inter-Agent Communication (Synchronous and Streaming Requests).ipynb diff --git a/notebooks/Chapter 16_ Resource-Aware Optimization (OI and Google search) b/notebooks/Chapter 16_ Resource-Aware Optimization (OI and Google search).ipynb similarity index 100% rename from notebooks/Chapter 16_ Resource-Aware Optimization (OI and Google search) rename to notebooks/Chapter 16_ Resource-Aware Optimization (OI and Google search).ipynb diff --git a/notebooks/Chapter 16_ Resource-Aware Optimization (code snippets) b/notebooks/Chapter 16_ Resource-Aware Optimization (code snippets).ipynb similarity index 100% rename from notebooks/Chapter 16_ Resource-Aware Optimization (code snippets) rename to notebooks/Chapter 16_ Resource-Aware Optimization (code snippets).ipynb diff --git a/notebooks/Chapter 17_ Reasoning Techniques (Executing code) b/notebooks/Chapter 17_ Reasoning Techniques (Executing code).ipynb similarity index 100% rename from notebooks/Chapter 17_ Reasoning Techniques (Executing code) rename to notebooks/Chapter 17_ Reasoning Techniques (Executing code).ipynb diff --git a/notebooks/Chapter 17_ Reasoning Techniques (Google DeepSearch) b/notebooks/Chapter 17_ Reasoning Techniques (Google DeepSearch).ipynb similarity index 100% rename from notebooks/Chapter 17_ Reasoning Techniques (Google DeepSearch) rename to notebooks/Chapter 17_ Reasoning Techniques (Google DeepSearch).ipynb diff --git a/notebooks/Chapter 17_ Reasoning Techniques (Prompt with CoT for Agent) b/notebooks/Chapter 17_ Reasoning Techniques (Prompt with CoT for Agent).ipynb similarity index 100% rename from notebooks/Chapter 17_ Reasoning Techniques (Prompt with CoT for Agent) rename to notebooks/Chapter 17_ Reasoning Techniques (Prompt with CoT for Agent).ipynb diff --git a/notebooks/Chapter 17_ Reasoning Techniques (Prompt with Self-correction with Agents) b/notebooks/Chapter 17_ Reasoning Techniques (Prompt with Self-correction with Agents).ipynb similarity index 100% rename from notebooks/Chapter 17_ Reasoning Techniques (Prompt with Self-correction with Agents) rename to notebooks/Chapter 17_ Reasoning Techniques (Prompt with Self-correction with Agents).ipynb diff --git a/notebooks/Chapter 18_ Guardrails_Safety Patterns (ADK validate tool) b/notebooks/Chapter 18_ Guardrails_Safety Patterns (ADK validate tool).ipynb similarity index 100% rename from notebooks/Chapter 18_ Guardrails_Safety Patterns (ADK validate tool) rename to notebooks/Chapter 18_ Guardrails_Safety Patterns (ADK validate tool).ipynb diff --git a/notebooks/Chapter 18_ Guardrails_Safety Patterns (LLM as a Guardrail) b/notebooks/Chapter 18_ Guardrails_Safety Patterns (LLM as a Guardrail).ipynb similarity index 100% rename from notebooks/Chapter 18_ Guardrails_Safety Patterns (LLM as a Guardrail) rename to notebooks/Chapter 18_ Guardrails_Safety Patterns (LLM as a Guardrail).ipynb diff --git a/notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails)(1) b/notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails)(1).ipynb similarity index 100% rename from notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails)(1) rename to notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails)(1).ipynb diff --git a/notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails) b/notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails).ipynb similarity index 100% rename from notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails) rename to notebooks/Chapter 18_ Guardrails_Safety Patterns (Practical Code Examples for Guardrails).ipynb diff --git a/notebooks/Chapter 19_ Evaluation and Monitoring (Basic Agent Response Evaluation (Correctness_Relevance)) b/notebooks/Chapter 19_ Evaluation and Monitoring (Basic Agent Response Evaluation (Correctness_Relevance)).ipynb similarity index 100% rename from notebooks/Chapter 19_ Evaluation and Monitoring (Basic Agent Response Evaluation (Correctness_Relevance)) rename to notebooks/Chapter 19_ Evaluation and Monitoring (Basic Agent Response Evaluation (Correctness_Relevance)).ipynb diff --git a/notebooks/Chapter 19_ Evaluation and Monitoring (LLM as a Judge) b/notebooks/Chapter 19_ Evaluation and Monitoring (LLM as a Judge).ipynb similarity index 100% rename from notebooks/Chapter 19_ Evaluation and Monitoring (LLM as a Judge) rename to notebooks/Chapter 19_ Evaluation and Monitoring (LLM as a Judge).ipynb diff --git a/notebooks/Chapter 1_ Prompt Chaining (Code Example).ipynb b/notebooks/Chapter 1_ Prompt Chaining (Code Example).ipynb new file mode 100644 index 00000000..3ff2b00d --- /dev/null +++ b/notebooks/Chapter 1_ Prompt Chaining (Code Example).ipynb @@ -0,0 +1 @@ +{"cells":[{"cell_type":"code","source":["import os\n","from langchain_openai import ChatOpenAI\n","from langchain_core.prompts import ChatPromptTemplate\n","from langchain_core.output_parsers import StrOutputParser\n","\n","# For better security, load environment variables from a .env file\n","# from dotenv import load_dotenv\n","# load_dotenv()\n","# Make sure your OPENAI_API_KEY is set in the .env file\n","\n","# Initialize the Language Model (using ChatOpenAI is recommended)\n","llm = ChatOpenAI(temperature=0)\n","\n","# --- Prompt 1: Extract Information ---\n","prompt_extract = ChatPromptTemplate.from_template(\n"," \"Extract the technical specifications from the following text:\\n\\n{text_input}\"\n",")\n","\n","# --- Prompt 2: Transform to JSON ---\n","prompt_transform = ChatPromptTemplate.from_template(\n"," \"Transform the following specifications into a JSON object with 'cpu', 'memory', and 'storage' as keys:\\n\\n{specifications}\"\n",")\n","\n","# --- Build the Chain using LCEL ---\n","# The StrOutputParser() converts the LLM's message output to a simple string.\n","extraction_chain = prompt_extract | llm | StrOutputParser()\n","\n","# The full chain passes the output of the extraction chain into the 'specifications'\n","# variable for the transformation prompt.\n","full_chain = (\n"," {\"specifications\": extraction_chain}\n"," | prompt_transform\n"," | llm\n"," | StrOutputParser()\n",")\n","\n","# --- Run the Chain ---\n","input_text = \"The new laptop model features a 3.5 GHz octa-core processor, 16GB of RAM, and a 1TB NVMe SSD.\"\n","\n","# Execute the chain with the input text dictionary.\n","final_result = full_chain.invoke({\"text_input\": input_text})\n","\n","print(\"\\n--- Final JSON Output ---\")\n","print(final_result)"],"outputs":[],"execution_count":null,"metadata":{"id":"NhfdOggSqMrH"}}],"metadata":{"colab":{"provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"}},"nbformat":4,"nbformat_minor":0} \ No newline at end of file diff --git a/notebooks/Chapter 1_ Prompt Chaining (JSON example) b/notebooks/Chapter 1_ Prompt Chaining (JSON example).ipynb similarity index 100% rename from notebooks/Chapter 1_ Prompt Chaining (JSON example) rename to notebooks/Chapter 1_ Prompt Chaining (JSON example).ipynb diff --git a/notebooks/Chapter 20_ Prioritization (SuperSimplePM) b/notebooks/Chapter 20_ Prioritization (SuperSimplePM).ipynb similarity index 100% rename from notebooks/Chapter 20_ Prioritization (SuperSimplePM) rename to notebooks/Chapter 20_ Prioritization (SuperSimplePM).ipynb diff --git a/notebooks/Chapter 21_ Chapter 21_ Exploration and Discovery(Agent Laboratory) b/notebooks/Chapter 21_ Chapter 21_ Exploration and Discovery(Agent Laboratory).ipynb similarity index 100% rename from notebooks/Chapter 21_ Chapter 21_ Exploration and Discovery(Agent Laboratory) rename to notebooks/Chapter 21_ Chapter 21_ Exploration and Discovery(Agent Laboratory).ipynb diff --git a/notebooks/Chapter 2_ Routing (Google ADK Code Example) b/notebooks/Chapter 2_ Routing (Google ADK Code Example).ipynb similarity index 100% rename from notebooks/Chapter 2_ Routing (Google ADK Code Example) rename to notebooks/Chapter 2_ Routing (Google ADK Code Example).ipynb diff --git a/notebooks/Chapter 2_ Routing (LangGraph Code Example) b/notebooks/Chapter 2_ Routing (LangGraph Code Example).ipynb similarity index 100% rename from notebooks/Chapter 2_ Routing (LangGraph Code Example) rename to notebooks/Chapter 2_ Routing (LangGraph Code Example).ipynb diff --git a/notebooks/Chapter 2_ Routing (Openrouter example) b/notebooks/Chapter 2_ Routing (Openrouter example).ipynb similarity index 100% rename from notebooks/Chapter 2_ Routing (Openrouter example) rename to notebooks/Chapter 2_ Routing (Openrouter example).ipynb diff --git a/notebooks/Chapter 3_ Parallelization (LangChain Code Example) b/notebooks/Chapter 3_ Parallelization (LangChain Code Example).ipynb similarity index 100% rename from notebooks/Chapter 3_ Parallelization (LangChain Code Example) rename to notebooks/Chapter 3_ Parallelization (LangChain Code Example).ipynb diff --git a/notebooks/Chapter 4_ Reflection (ADK Code Example) b/notebooks/Chapter 4_ Reflection (ADK Code Example).ipynb similarity index 100% rename from notebooks/Chapter 4_ Reflection (ADK Code Example) rename to notebooks/Chapter 4_ Reflection (ADK Code Example).ipynb diff --git a/notebooks/Chapter 4_ Reflection (Iterative Loop reflection) b/notebooks/Chapter 4_ Reflection (Iterative Loop reflection).ipynb similarity index 100% rename from notebooks/Chapter 4_ Reflection (Iterative Loop reflection) rename to notebooks/Chapter 4_ Reflection (Iterative Loop reflection).ipynb diff --git a/notebooks/Chapter 4_ Reflection (LangChain Code Example) b/notebooks/Chapter 4_ Reflection (LangChain Code Example).ipynb similarity index 100% rename from notebooks/Chapter 4_ Reflection (LangChain Code Example) rename to notebooks/Chapter 4_ Reflection (LangChain Code Example).ipynb diff --git a/notebooks/Chapter 5_ Tool Use (CrewAI Function Calling Example) b/notebooks/Chapter 5_ Tool Use (CrewAI Function Calling Example).ipynb similarity index 100% rename from notebooks/Chapter 5_ Tool Use (CrewAI Function Calling Example) rename to notebooks/Chapter 5_ Tool Use (CrewAI Function Calling Example).ipynb diff --git a/notebooks/Chapter 5_ Tool Use (LangChain Code Example ) b/notebooks/Chapter 5_ Tool Use (LangChain Code Example ).ipynb similarity index 100% rename from notebooks/Chapter 5_ Tool Use (LangChain Code Example ) rename to notebooks/Chapter 5_ Tool Use (LangChain Code Example ).ipynb diff --git a/notebooks/Chapter 6_ Planning - Code Example b/notebooks/Chapter 6_ Planning - Code Example.ipynb similarity index 100% rename from notebooks/Chapter 6_ Planning - Code Example rename to notebooks/Chapter 6_ Planning - Code Example.ipynb diff --git a/notebooks/Chapter 6_ Planning - Deep Research API Example b/notebooks/Chapter 6_ Planning - Deep Research API Example.ipynb similarity index 100% rename from notebooks/Chapter 6_ Planning - Deep Research API Example rename to notebooks/Chapter 6_ Planning - Deep Research API Example.ipynb diff --git a/notebooks/Chapter 7_ Multi-Agent Collaboration - Code Example (CrewAI + Gemini) b/notebooks/Chapter 7_ Multi-Agent Collaboration - Code Example (CrewAI + Gemini).ipynb similarity index 100% rename from notebooks/Chapter 7_ Multi-Agent Collaboration - Code Example (CrewAI + Gemini) rename to notebooks/Chapter 7_ Multi-Agent Collaboration - Code Example (CrewAI + Gemini).ipynb diff --git a/notebooks/Chapter 8_ Memory Management - Code Example (ADK Conceptual Example_ Explicit State Update via EventActions) b/notebooks/Chapter 8_ Memory Management - Code Example (ADK Conceptual Example_ Explicit State Update via EventActions).ipynb similarity index 100% rename from notebooks/Chapter 8_ Memory Management - Code Example (ADK Conceptual Example_ Explicit State Update via EventActions) rename to notebooks/Chapter 8_ Memory Management - Code Example (ADK Conceptual Example_ Explicit State Update via EventActions).ipynb diff --git a/notebooks/Chapter 8_ Memory Management - Code Example (ADK LlmAgent output_key Example) b/notebooks/Chapter 8_ Memory Management - Code Example (ADK LlmAgent output_key Example).ipynb similarity index 100% rename from notebooks/Chapter 8_ Memory Management - Code Example (ADK LlmAgent output_key Example) rename to notebooks/Chapter 8_ Memory Management - Code Example (ADK LlmAgent output_key Example).ipynb diff --git a/notebooks/Chapter 8_ Memory Management - Code Example (ADK MemoryService InMemory Example) b/notebooks/Chapter 8_ Memory Management - Code Example (ADK MemoryService InMemory Example).ipynb similarity index 100% rename from notebooks/Chapter 8_ Memory Management - Code Example (ADK MemoryService InMemory Example) rename to notebooks/Chapter 8_ Memory Management - Code Example (ADK MemoryService InMemory Example).ipynb diff --git a/notebooks/Chapter 8_ Memory Management - Code Example (ADK SessionService InMemory and Database) b/notebooks/Chapter 8_ Memory Management - Code Example (ADK SessionService InMemory and Database).ipynb similarity index 100% rename from notebooks/Chapter 8_ Memory Management - Code Example (ADK SessionService InMemory and Database) rename to notebooks/Chapter 8_ Memory Management - Code Example (ADK SessionService InMemory and Database).ipynb diff --git a/notebooks/Chapter 8_ Memory Management - Code Example (LangChain and LangGraph) b/notebooks/Chapter 8_ Memory Management - Code Example (LangChain and LangGraph).ipynb similarity index 100% rename from notebooks/Chapter 8_ Memory Management - Code Example (LangChain and LangGraph) rename to notebooks/Chapter 8_ Memory Management - Code Example (LangChain and LangGraph).ipynb diff --git a/notebooks/Chapter 9_ Adaptation - Code Example (OpenEvolve) b/notebooks/Chapter 9_ Adaptation - Code Example (OpenEvolve).ipynb similarity index 100% rename from notebooks/Chapter 9_ Adaptation - Code Example (OpenEvolve) rename to notebooks/Chapter 9_ Adaptation - Code Example (OpenEvolve).ipynb diff --git a/notebooks/Copy of Chapter 8_ Memory Management - Code Example (LangChain and LangGraph) b/notebooks/Copy of Chapter 8_ Memory Management - Code Example (LangChain and LangGraph).ipynb similarity index 100% rename from notebooks/Copy of Chapter 8_ Memory Management - Code Example (LangChain and LangGraph) rename to notebooks/Copy of Chapter 8_ Memory Management - Code Example (LangChain and LangGraph).ipynb