From 67fc5dde5b08cca4f9771e0f233131b16598355c Mon Sep 17 00:00:00 2001 From: 05satyam Date: Fri, 14 Mar 2025 12:06:21 -0500 Subject: [PATCH] Adding AI-Powered Currency Conversion and Arithmetic with PydanticAI-Agnets-Tools-OpenAI Implementation --- .../PydanticAI_Agents_Tools_OpenAI.ipynb | 744 ++++++++++++++++++ registry.yaml | 12 +- 2 files changed, 755 insertions(+), 1 deletion(-) create mode 100644 examples/third_party/PydanticAI_Agents_Tools_OpenAI.ipynb diff --git a/examples/third_party/PydanticAI_Agents_Tools_OpenAI.ipynb b/examples/third_party/PydanticAI_Agents_Tools_OpenAI.ipynb new file mode 100644 index 0000000000..d881d3895f --- /dev/null +++ b/examples/third_party/PydanticAI_Agents_Tools_OpenAI.ipynb @@ -0,0 +1,744 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "epsmeGSqDxJ5" + }, + "source": [ + "# **PydanticAI-Agents-Tools-OpenAI**\n", + "It is a Python agent framework designed to make it less painful to build production grade applications with Generative AI.\n", + "https://github.com/pydantic/pydantic-ai\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Dc4_wLcMD8Ri" + }, + "source": [ + "## **Why Use PydanticAI?**\n", + "- Provides structured data validation using **Pydantic**.\n", + "- Supports multiple **LLM providers**, but this guide focuses on **OpenAI’s models**.\n", + "- Ensures AI agents return **well-formatted and validated responses**.\n", + "\n", + "### **Prerequisite:**\n", + "- You must have an **OpenAI API key**. Store it securely as an environment variable (`OPENAI_API_KEY`) to prevent exposure in the code.\n", + "- You must have an **https://exchangerate.host/access_key=\"\"**. It provides monthly 100 free access with zero charge.\n", + "\n", + "---\n", + "\n", + "## **Setup**: Install Required Dependencies\n", + "\n", + "Ensure you have the required libraries installed before running the code:\n", + "\n", + "```python\n", + "%pip install pydantic-ai openai\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "id": "NRff-7L0Drzl" + }, + "outputs": [], + "source": [ + "%pip install pydantic-ai openai" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "PXKe7xgfEHhP" + }, + "source": [ + "> We import **BaseModel** from Pydantic to define our data schema.\n", + "**Agent** from PydanticAI to create our AI agent.\n", + "We also imported **Field** from Pydantic, which allows us to add extra metadata to model fields (like descriptions or value constraints), though it’s optional for basic usage.\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "metadata": { + "id": "O2r0h2E2ECQS" + }, + "outputs": [], + "source": [ + "import os\n", + "from pydantic import BaseModel, Field\n", + "from pydantic_ai import Agent\n", + "from pydantic_ai import Agent, RunContext\n" + ] + }, + { + "cell_type": "code", + "execution_count": 118, + "metadata": { + "id": "L3LxxdTtHSIQ" + }, + "outputs": [], + "source": [ + "'''\n", + "Since Jupyter notebooks run an event loop in the background, you may need to use\n", + "'''\n", + "import nest_asyncio\n", + "nest_asyncio.apply()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "lEg80plFEy01" + }, + "source": [ + "\n", + "\n", + "> (In a real application, you’d load this from a secure config or environment, not hard-code it.)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "metadata": { + "id": "MSUinpYwEgbo" + }, + "outputs": [], + "source": [ + "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", + "os.environ[\"EXCHANGE_RATE_API_KEY\"] = \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "IQwk3fzcE12V" + }, + "source": [ + "## Step 1: Define a Pydantic Model for AI Agent’s Output\n", + "We need a structured model for AI-generated responses. In this example, our agent provides information about cities, so we define a Pydantic model:\n", + "\n", + "### Expected Output Fields\n", + "```\n", + "city: Name of the city.\n", + "country: The country where the city is located.\n", + "reason: Why the city has that nickname.\n", + "famous_person_from_city: A well-known person from that city.\n", + "```\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 120, + "metadata": { + "id": "ARKAtzAHFOde" + }, + "outputs": [], + "source": [ + "class CityInfo(BaseModel):\n", + " \"\"\"\n", + " Represents structured information about a city.\n", + "\n", + " Attributes:\n", + " city (str): Name of the city.\n", + " country (str): Country where the city is located.\n", + " reason (str): Reason behind the city's nickname or significance.\n", + " famous_person_from_city (str): A well-known individual from the city.\n", + " \"\"\"\n", + " city: str\n", + " country: str\n", + " reason: str\n", + " famous_person_from_city: str\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "K807io2qFeUs" + }, + "source": [ + "## Step 2: Create an AI Agent with OpenAI Model and Pydantic Schema\n", + "We create an instance of Agent from pydantic_ai, specifying:\n", + "\n", + "- Model Name: \"openai:gpt-4o\" (you can replace it with another supported model).\n", + "- Result Type: CityInfo (the Pydantic model for structured output).\n", + "\n", + "### Why This Matters?\n", + "- The framework validates responses against the schema.\n", + "- If the LLM response lacks fields or incorrect formatting, PydanticAI prompts the model to retry.\n", + "\n", + "### Using System Prompts in PydanticAI:\n", + "- You can use static or dynamic prompts.\n", + "- Example: system_prompt=\"You are an AI assistant that provides brief city information.\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 121, + "metadata": { + "id": "ByN7aF6wFlWJ" + }, + "outputs": [], + "source": [ + "\"\"\"\n", + " Initializes an AI agent using GPT-4o via the pydantic_ai library.\n", + " Agent: An instance of the Agent class configured to return CityInfo objects.\n", + "\"\"\"\n", + "\n", + "# Choose an OpenAI model (GPT-4o in this example)\n", + "model_name = \"openai:gpt-4o\"\n", + "\n", + "# Initialize the agent with the model and expected result type\n", + "agent = Agent(model_name, result_type=CityInfo)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": { + "id": "ZMp2-vbhGds0" + }, + "outputs": [], + "source": [ + "\"\"\"\n", + "Demonstrates how to run a synchronous query to fetch city information.\n", + "agent (Agent): The AI agent used for generating city information.\n", + "\"\"\"\n", + "query = \"The windy city in the US of A.\"\n", + "result = agent.run_sync(query)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "GdVCHn-5GsFT" + }, + "source": [] + }, + { + "cell_type": "code", + "execution_count": 126, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-NhjQYJ-GhFw", + "outputId": "5c4dcf7f-92cb-4a3c-a45d-ed3c7e06a14c" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "city='Chicago' country='United States' reason=\"Known as 'The Windy City' due to its breezes off Lake Michigan and historically because of its reputation for verbose politicians.\" famous_person_from_city='Walt Disney'\n" + ] + } + ], + "source": [ + "'''\n", + "When you run this, you should see that:\n", + "result: is an AgentRunResult (a wrapper class that PydanticAI uses to encapsulate the outcome of the run, including metadata like tokens used or the message history).\n", + "result.data: is an instance of our CityInfo Pydantic model (or whatever type you specified as result_type).\n", + "Printing result.data will display the field values that the model provided.\n", + "'''\n", + "print(type(result)) # What type is result?\n", + "print(type(result.data)) # What type is the data attribute?\n", + "print(result.data) # The structured data output\n" + ] + }, + { + "cell_type": "code", + "execution_count": 127, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "tlHeqUpMHjU6", + "outputId": "1d1f1c52-b289-45ed-f305-41c12e7db997" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Chicago\n", + "Walt Disney\n", + "{'city': 'Chicago', 'country': 'United States', 'reason': \"Known as 'The Windy City' due to its breezes off Lake Michigan and historically because of its reputation for verbose politicians.\", 'famous_person_from_city': 'Walt Disney'}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + ":6: PydanticDeprecatedSince20: The `dict` method is deprecated; use `model_dump` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.10/migration/\n", + " print(city_info.dict())\n" + ] + } + ], + "source": [ + "city_info = result.data # This is a CityInfo instance\n", + "print(city_info.city) # Access the city field\n", + "print(city_info.famous_person_from_city) # Access the famous person field\n", + "\n", + "# Convert the result to a dictionary (e.g., to return as JSON in an API)\n", + "print(city_info.dict())\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "z3DeFAvrLLSq" + }, + "source": [ + "# Using PydanticAI Tools for AI Agents\n", + "We extend our AI agent with tools for additional functionality.\n", + "\n", + "\n", + "> PydanticAI Agent with Math and Currency Conversion Tools\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "FJXqxR9vL3-w" + }, + "source": [ + "## Tool 1: Math Tool (Performing Arithmetic Operations)\n", + "\n", + "### We define two models:\n", + "\n", + "- MathInput: Takes two numbers and an operation (add, subtract, multiply, divide).\n", + "- MathOutput: Stores the result.\n", + "- To ensure correct inputs, we use Python Literals or Enums for the operation field." + ] + }, + { + "cell_type": "code", + "execution_count": 128, + "metadata": { + "id": "5GMSr_QSLWEM" + }, + "outputs": [], + "source": [ + "'''\n", + "Tool 1: Math Calculation Tool\n", + "\n", + "'''\n", + "\n", + "from pydantic import BaseModel\n", + "from typing import Literal\n", + "\n", + "class MathInput(BaseModel):\n", + " \"\"\"\n", + " Represents the input format for performing mathematical operations.\n", + "\n", + " Attributes:\n", + " x (float): First operand.\n", + " y (float): Second operand.\n", + " operation (Literal[str]): Type of operation ('add', 'subtract',\n", + " 'multiply', or 'divide').\n", + " \"\"\"\n", + " x: float\n", + " y: float\n", + " operation: Literal['add', 'subtract', 'multiply', 'divide']\n", + "\n", + "class MathOutput(BaseModel):\n", + " \"\"\"\n", + " Represents the output format of a math calculation.\n", + "\n", + " Attributes:\n", + " result (float): The numerical result of the performed operation.\n", + " \"\"\"\n", + " result: float\n" + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "metadata": { + "id": "_ayXSjNTMLmU" + }, + "outputs": [], + "source": [ + "\n", + "def calculate(ctx: RunContext, x: float, y: float, operation: str) -> MathOutput:\n", + " \"\"\"\n", + " Perform basic arithmetic operations based on the specified operation.\n", + "\n", + " Args:\n", + " ctx (RunContext): Execution context (provided automatically by pydantic_ai).\n", + " x (float): First operand.\n", + " y (float): Second operand.\n", + " operation (str): The operation to perform, e.g. 'add', 'subtract',\n", + " 'multiply', or 'divide'. Various synonyms are also accepted.\n", + "\n", + " Raises:\n", + " ValueError: If the operation is invalid or if attempting to divide by zero.\n", + "\n", + " Returns:\n", + " MathOutput: A MathOutput instance containing the computed result.\n", + " \"\"\"\n", + "\n", + " print(f\"operation: {operation}\")\n", + " # Expanded operation mapping to handle more variations\n", + " operation_mapping = {\n", + " \"plus\": \"add\", \"add\": \"add\",\n", + " \"minus\": \"subtract\", \"subtract\": \"subtract\",\n", + " \"times\": \"multiply\", \"multiplied\": \"multiply\", \"multiply\": \"multiply\",\n", + " \"divided\": \"divide\", \"division\": \"divide\", \"divide\": \"divide\",\n", + " \"sum\": \"add\", \"difference\": \"subtract\", \"product\": \"multiply\", \"quotient\": \"divide\"\n", + " }\n", + "\n", + " # Normalize operation (if invalid, return an error)\n", + " operation = operation_mapping.get(operation.lower())\n", + " if operation is None:\n", + " raise ValueError(\"Invalid operation. Use: 'add', 'subtract', 'multiply', 'divide'.\")\n", + "\n", + "\n", + " # Perform calculation\n", + " if operation == 'add':\n", + " result_value = x + y\n", + " elif operation == 'subtract':\n", + " result_value = x - y\n", + " elif operation == 'multiply':\n", + " result_value = x * y\n", + " elif operation == 'divide':\n", + " if y == 0:\n", + " raise ValueError(\"Cannot divide by zero.\")\n", + " result_value = x / y\n", + " else:\n", + " raise ValueError(\"Unsupported operation. Choose from 'add', 'subtract', 'multiply', 'divide'.\")\n", + "\n", + " return MathOutput(result=result_value)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "OANkFhIuMbKm" + }, + "source": [ + "## Tool 2: Currency Conversion Tool\n", + "- This tool converts an amount from one currency to another using ExchangeRate.host.\n", + "\n", + "### Pydantic Models for Currency Tool\n", + "- ConversionInput:\n", + "```\n", + "amount (float): The value to convert.\n", + "from_currency (str): Currency code (e.g., \"USD\").\n", + "to_currency (str): Target currency (e.g., \"EUR\").\n", + "```\n", + "\n", + "- ConversionOutput:\n", + "```\n", + "converted_amount (float): The final amount.\n", + "rate (float): The exchange rate applied.\n", + "```\n" + ] + }, + { + "cell_type": "code", + "execution_count": 130, + "metadata": { + "id": "OhwPYiZ2Mktw" + }, + "outputs": [], + "source": [ + "class ConversionInput(BaseModel):\n", + " \"\"\"\n", + " Represents the input schema for performing currency conversions.\n", + "\n", + " Attributes:\n", + " amount (float): The amount of money to convert.\n", + " from_currency (str): Source currency code (e.g., 'USD').\n", + " to_currency (str): Target currency code (e.g., 'EUR').\n", + " \"\"\"\n", + " amount: float\n", + " from_currency: str\n", + " to_currency: str\n", + "\n", + "class ConversionOutput(BaseModel):\n", + " \"\"\"\n", + " Represents the output schema for a currency conversion.\n", + "\n", + " Attributes:\n", + " converted_amount (float): The converted monetary amount.\n", + " rate (float): The exchange rate applied for the conversion.\n", + " \"\"\"\n", + " converted_amount: float\n", + " rate: float\n" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "metadata": { + "id": "lyk42GMeM3BA" + }, + "outputs": [], + "source": [ + "'''\n", + "Note: In a real application, you should handle API errors and possibly cache results, and other posible scenaios. This is just a demo example\n", + "'''\n", + "import requests\n", + "\n", + "def exchange_currency(ctx: RunContext, amount: float, from_currency: str, to_currency: str) -> ConversionOutput:\n", + " \"\"\"Convert a monetary amount from one currency to another using real-time exchange rates.\n", + "\n", + " Args:\n", + " ctx (RunContext): PydanticAI context.\n", + " amount (float): Amount to convert.\n", + " from_currency (str): Source currency (ISO 4217).\n", + " to_currency (str): Target currency (ISO 4217).\n", + "\n", + " Returns:\n", + " ConversionOutput: Converted amount and exchange rate.\n", + "\n", + " Note: This function fetches live exchange rates from an API.\n", + " Consider caching results to reduce API calls.\n", + " \"\"\"\n", + "\n", + " API_KEY = \"EXCHANGE RATE API KEY\"\n", + " BASE_URL = \"https://api.exchangerate.host/convert\"\n", + "\n", + " # Construct API request URL\n", + " params = {\n", + " \"access_key\": API_KEY,\n", + " \"from\": from_currency.upper(),\n", + " \"to\": to_currency.upper(),\n", + " \"amount\": amount\n", + " }\n", + "\n", + " try:\n", + " response = requests.get(BASE_URL, params=params, timeout=5) # Add timeout for reliability\n", + " response.raise_for_status() # Raise exception for HTTP errors\n", + " data = response.json()\n", + "\n", + " # Extract required data\n", + " converted = data.get(\"result\")\n", + " rate = data.get(\"info\", {}).get(\"quote\") if data.get(\"info\") else None\n", + "\n", + " if converted is None or rate is None:\n", + " raise ValueError(f\"Failed to retrieve exchange rate from {from_currency} to {to_currency}.\")\n", + "\n", + " print(f\"✅ Successfully converted {amount} {from_currency} to {converted} {to_currency} at rate {rate}\")\n", + "\n", + " # Return structured output\n", + " return ConversionOutput(converted_amount=converted, rate=rate)\n", + "\n", + " except requests.exceptions.RequestException as e:\n", + " raise ValueError(f\"❌ API request failed: {e}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "d3xEdFbhNOOT" + }, + "source": [ + "## Integrating Tools into the AI Agent\n", + "PydanticAI allows seamless integration of tools, ensuring structured inputs and outputs." + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "metadata": { + "id": "7GRF4cX7QCxO" + }, + "outputs": [], + "source": [ + "# Initialize the agent with a model (e.g., OpenAI GPT-4o etc).\n", + "agent = Agent(\"openai:gpt-4o\", tools=[calculate, exchange_currency])" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "metadata": { + "id": "A-nXT7ECNNSM" + }, + "outputs": [], + "source": [ + "\"\"\"\n", + " (Optional) Set a system prompt to guide the agent's behavior for calculations and currency conversions.\n", + "\"\"\"\n", + "\n", + "agent.system_prompt = (\n", + " \"You are a helpful AI that can perform arithmetic operations using the 'calculate' tool \"\n", + " \"and convert currencies using the 'exchange_currency' tool. \"\n", + "\n", + " \"For calculations, always format your tool calls using one of these operations: 'add', 'subtract', 'multiply', or 'divide'. \"\n", + " \"Instead of saying 'minus', use 'subtract', and instead of 'times', use 'multiply'. \"\n", + " \"If a user provides a multi-step arithmetic expression, break it down step by step and compute each part separately before proceeding. \"\n", + "\n", + " \"For currency conversions, ensure that both currencies are valid ISO 4217 currency codes (e.g., 'USD', 'EUR', 'JPY'). \"\n", + " \"Always return the conversion result in numerical form along with the exchange rate. \"\n", + "\n", + " \"⚠️ Do not make assumptions about exchange rates; always use the 'exchange_currency' tool to get real-time data. \"\n", + " \"⚠️ Do not attempt to perform arithmetic manually; always call the 'calculate' tool for computations. \"\n", + " \"⚠️ If a request does not match a valid calculation or currency conversion, do not make up information—return an appropriate error response. \"\n", + ")\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 111, + "metadata": { + "id": "VmnvlQCUMOkC" + }, + "outputs": [], + "source": [ + "# Test operation mapping and calculation\n", + "# print(calculate(None, 15, 4, \"minus\")) # Should return MathOutput(result=11)\n", + "# print(calculate(None, 15, 4, \"subtract\")) # Should return MathOutput(result=11)\n", + "# print(calculate(None, 15, 4, \"times\")) # Should return MathOutput(result=60)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "QNEi-QhiNXKF" + }, + "source": [ + "## Example Usage\n", + "- **Putting It All Together**\n", + "- The AI agent can now perform math calculations and convert currencies dynamically.\n", + "- PydanticAI ensures correct parameter passing and validates tool responses.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 134, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "GPyWDrI0QVFg", + "outputId": "f39219e6-b0a8-4506-e480-9d63afec835a" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "operation: subtract\n", + "operation: multiply\n", + "AgentRunResult(data='15 minus 4 is 11, and when you multiply 11 by 100, the result is 1100.')\n" + ] + } + ], + "source": [ + "\"\"\"\n", + "Demonstrates how the agent can respond to a query involving arithmetic calculations.\n", + "\"\"\"\n", + "result = agent.run_sync(\"What is 15 minus 4 and multiple 100 ?\")\n", + "print(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 135, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "R6jX0B2BQf2x", + "outputId": "beb680e9-b86a-4146-999f-74e37e3bfae6" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "✅ Successfully converted 100000.0 USD to 8694475.3 INR at rate 86.944753\n", + "AgentRunResult(data='100,000 USD is approximately 8,694,475.30 INR, based on the current exchange rate of 1 USD = 86.944753 INR.')\n" + ] + } + ], + "source": [ + "\"\"\"\n", + "Demonstrates how the agent can respond to a query involving currency conversion.\n", + "\"\"\"\n", + "result = agent.run_sync(\"convert 100k usd to inr\")\n", + "print(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "QJ_Cbhl5R6aE", + "outputId": "68f1ef3e-6e56-44af-a836-a93f9177319f" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "✅ Successfully converted 50.0 USD to 45.94575 EUR at rate 0.918915\n", + "operation: add\n", + "AgentRunResult(data='Converting 50 USD to EUR gives approximately 45.95 EUR. Adding this to 100 results in 145.95.')\n" + ] + } + ], + "source": [ + "'''\n", + "Demonstrates a combined query that requires both currency conversion and arithmetic.\n", + "'''\n", + "result = agent.run_sync(\"Convert 50 USD to EUR and then add the result to 100.\")\n", + "print(result)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "QFKWdDNKZC8S" + }, + "source": [ + "# **Conclusion**\n", + "\n", + "In this tutorial, we:\n", + "- ✅ Built a PydanticAI-powered AI agent.\n", + "- ✅ Defined structured Pydantic schemas for validation.\n", + "- ✅ Integrated math & currency conversion tools into the agent.\n", + "- ✅ Ensured LLM responses match predefined formats automatically.\n", + "- ✅ This is a very basic fundamental implementation and can be extended with more agents, optimizations, custom tools, state managemnt.\n", + "\n", + "By using PydanticAI, AI agents become more reliable, structured, and error-resistant.\n", + "And, special thanks to pydantic-ai documentation and openai documentations." + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/registry.yaml b/registry.yaml index 96f439a841..8a650c8ae3 100644 --- a/registry.yaml +++ b/registry.yaml @@ -1827,4 +1827,14 @@ - pap-openai tags: - responses - - functions \ No newline at end of file + - functions +- title: AI-Powered Currency Conversion and Arithmetic with PydanticAI-agents and Openai-llm + path: examples/third_party/PydanticAI_Agents_Tools_OpenAI.ipynb + date: 2025-03-14 + authors: - 05satyam + tags: + - pydantic + - functions + - tools + - agents + - openai \ No newline at end of file