{"_id":"@ag-ui/pydantic-ai","_rev":"3-df0a86658c3d9d8514ced54494759b39","name":"@ag-ui/pydantic-ai","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@ag-ui/pydantic-ai","version":"0.0.1","author":{"name":"Steven Hartland","email":"steve@rocketscience.gg"},"_id":"@ag-ui/pydantic-ai@0.0.1","maintainers":[{"name":"_mme","email":"markus.ecker@gmail.com"},{"name":"copilotkit","email":"devops@copilotkit.ai"}],"dist":{"shasum":"012c34ae3a465f133da1da5c6d71ed01c11dbb57","tarball":"https://registry.npmjs.org/@ag-ui/pydantic-ai/-/pydantic-ai-0.0.1.tgz","fileCount":9,"integrity":"sha512-1KS8jmYqMpDrATLpuKfc+LN6rfnu6ecPAmiNPxdTKn6g5+Z9pE6vPflcvCVpKW6tH4GOhRATrNIU179D28UB1Q==","signatures":[{"sig":"MEUCIQDnesRxCjoN62BlBJzhF7nd/mBo1QLPRRzYfkVhOSdUNAIgV8rxwQmIQwP46oeTAqZGKJIvKVW7ildgLsRLFCo2xKU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8424},"main":"./dist/index.js","_from":"file:ag-ui-pydantic-ai-0.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","scripts":{"dev":"tsup --watch","test":"jest","build":"tsup","clean":"rm -rf dist .turbo node_modules","typecheck":"tsc --noEmit","link:global":"pnpm link --global","unlink:global":"pnpm unlink --global"},"_npmUser":{"name":"_mme","email":"markus.ecker@gmail.com"},"_resolved":"/private/var/folders/0t/pq2_7rn97834lcsvc_qy4t8r0000gn/T/b09f5226e3f407570816d8945e0b0b4b/ag-ui-pydantic-ai-0.0.1.tgz","_integrity":"sha512-1KS8jmYqMpDrATLpuKfc+LN6rfnu6ecPAmiNPxdTKn6g5+Z9pE6vPflcvCVpKW6tH4GOhRATrNIU179D28UB1Q==","_npmVersion":"10.8.2","description":"Implementation of the AG-UI protocol for [Pydantic AI](https://ai.pydantic.dev/).","directories":{},"sideEffects":false,"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.0.2","ts-jest":"^29.1.2","typescript":"^5.3.3","@ag-ui/core":"0.0.38-alpha.2","@types/jest":"^29.5.14","@types/node":"^20.11.19","@ag-ui/client":"0.0.38-alpha.2"},"peerDependencies":{"rxjs":"7.8.1","@ag-ui/core":">=0.0.37","@ag-ui/client":">=0.0.37"},"_npmOperationalInternal":{"tmp":"tmp/pydantic-ai_0.0.1_1758293042968_0.4110407967084089","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@ag-ui/pydantic-ai","version":"0.0.2","author":{"name":"Steven Hartland","email":"steve@rocketscience.gg"},"_id":"@ag-ui/pydantic-ai@0.0.2","maintainers":[{"name":"_mme","email":"markus.ecker@gmail.com"},{"name":"copilotkit","email":"devops@copilotkit.ai"}],"dist":{"shasum":"d0d4d5a184f982dde64e6373fa60dfb23db3b7e0","tarball":"https://registry.npmjs.org/@ag-ui/pydantic-ai/-/pydantic-ai-0.0.2.tgz","fileCount":9,"integrity":"sha512-fTNoNLz6QAVQZkoCntduTmQVNGZx3Mm1BRbTLOBXm64PTodK2Sjl7RsB8gdNK5DStq6+nmCWqm0PrQksmae1Rw==","signatures":[{"sig":"MEUCIBytF1z3lMbfi47bI6n06+w+YNXZfxP1Pa/1HefC35TjAiEApYi8AM9PcvaKDOjN6pnBZKtm4DKrhd9CRHAgnV0f44o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8684},"main":"./dist/index.js","_from":"file:ag-ui-pydantic-ai-0.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","scripts":{"dev":"tsup --watch","test":"jest","build":"tsup","clean":"rm -rf dist .turbo node_modules","typecheck":"tsc --noEmit","link:global":"pnpm link --global","unlink:global":"pnpm unlink --global"},"_npmUser":{"name":"_mme","email":"markus.ecker@gmail.com"},"_resolved":"/private/var/folders/0t/pq2_7rn97834lcsvc_qy4t8r0000gn/T/98c1ab381818831766852d090482f763/ag-ui-pydantic-ai-0.0.2.tgz","_integrity":"sha512-fTNoNLz6QAVQZkoCntduTmQVNGZx3Mm1BRbTLOBXm64PTodK2Sjl7RsB8gdNK5DStq6+nmCWqm0PrQksmae1Rw==","_npmVersion":"10.9.3","description":"Implementation of the AG-UI protocol for [Pydantic AI](https://ai.pydantic.dev/).","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.0.2","ts-jest":"^29.1.2","typescript":"^5.3.3","@ag-ui/core":"0.0.40","@types/jest":"^29.5.14","@types/node":"^20.11.19","@ag-ui/client":"0.0.40"},"peerDependencies":{"rxjs":"7.8.1","@ag-ui/core":">=0.0.37","@ag-ui/client":">=0.0.37"},"_npmOperationalInternal":{"tmp":"tmp/pydantic-ai_0.0.2_1762442318037_0.25000773622727457","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@ag-ui/pydantic-ai","author":{"name":"Steven Hartland","email":"steve@rocketscience.gg"},"version":"0.0.3","license":"MIT","repository":{"type":"git","url":"git+https://github.com/ag-ui-protocol/ag-ui.git"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","sideEffects":false,"peerDependencies":{"@ag-ui/core":">=0.0.37","@ag-ui/client":">=0.0.37","rxjs":"7.8.1"},"devDependencies":{"@types/node":"^20.11.19","@vitest/coverage-istanbul":"^4.0.18","publint":"^0.3.12","@arethetypeswrong/cli":"^0.17.4","vitest":"^4.0.18","tsdown":"^0.20.1","typescript":"^5.3.3","@ag-ui/core":"0.0.58","@ag-ui/client":"0.0.58"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsdown","dev":"tsdown --watch","clean":"git clean -fdX --exclude=\"!.env\"","typecheck":"tsc --noEmit","test":"vitest run","test:coverage":"vitest run --coverage","test:watch":"vitest","test:exports":"publint --strict && attw --pack","link:global":"pnpm link --global","unlink:global":"pnpm unlink --global"},"_id":"@ag-ui/pydantic-ai@0.0.3","description":"Implementation of the AG-UI protocol for [Pydantic AI](https://ai.pydantic.dev/).","bugs":{"url":"https://github.com/ag-ui-protocol/ag-ui/issues"},"homepage":"https://github.com/ag-ui-protocol/ag-ui#readme","_integrity":"sha512-eFJ60yphaktBp1FJQZf8yQTsTgYw1nWc3nUqor2eD/pjw0rEOsRZAC1yx3wQdCg/X8TizCyflmcYAtiVWzXIfQ==","_resolved":"/home/runner/work/ag-ui/ag-ui/integrations/pydantic-ai/typescript/ag-ui-pydantic-ai-0.0.3.tgz","_from":"file:ag-ui-pydantic-ai-0.0.3.tgz","_nodeVersion":"22.23.2","_npmVersion":"11.15.0","dist":{"integrity":"sha512-eFJ60yphaktBp1FJQZf8yQTsTgYw1nWc3nUqor2eD/pjw0rEOsRZAC1yx3wQdCg/X8TizCyflmcYAtiVWzXIfQ==","shasum":"daa43f0fd2bc27d0292fa41bf55b08f4c36d9069","tarball":"https://registry.npmjs.org/@ag-ui/pydantic-ai/-/pydantic-ai-0.0.3.tgz","fileCount":11,"unpackedSize":8529,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ag-ui%2fpydantic-ai@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDnRkZj6Mh7CpVi6pRSjxt29SGoTM+TDOUMYWxGpBcvHAIgetQUGNwAb7ZgxC0IuCEIV3nDjkf5Nb9rSfDywIvWe8I="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6d725b77-632b-407c-a8a0-ad706d0e5a52"}},"directories":{},"maintainers":[{"name":"_mme","email":"markus.ecker@gmail.com"},{"name":"copilotkit","email":"devops@copilotkit.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pydantic-ai_0.0.3_1786972357255_0.8552391257579928"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-19T14:44:02.885Z","modified":"2026-08-17T13:12:37.825Z","0.0.1":"2025-09-19T14:44:03.158Z","0.0.2":"2025-11-06T15:18:38.230Z","0.0.3":"2026-08-17T13:12:37.401Z"},"author":{"name":"Steven Hartland","email":"steve@rocketscience.gg"},"description":"Implementation of the AG-UI protocol for [Pydantic AI](https://ai.pydantic.dev/).","maintainers":[{"name":"_mme","email":"markus.ecker@gmail.com"},{"name":"copilotkit","email":"devops@copilotkit.ai"}],"readme":"# Pydantic AI\n\nImplementation of the AG-UI protocol for [Pydantic AI](https://ai.pydantic.dev/).\n\nFor more information on the Pydantic AI implementation see\nthe [Pydantic AI AG-UI docs](https://ai.pydantic.dev/ag-ui/).\n\n## Prerequisites\n\nThis example uses a Pydantic AI agent using an OpenAI model and the AG-UI dojo.\n\n- An [OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key)\n\n## Running\n\nTo run this integration you need to:\n\n1. Clone the [AG-UI repository](https://github.com/ag-ui-protocol/ag-ui)\n\n    ```shell\n    git clone https://github.com/ag-ui-protocol/ag-ui.git\n    ```\n\n2. Change into the integrations/pydantic-ai/python` directory\n\n    ```shell\n    cd integrations/pydantic-ai/python\n    ```\n\n3. Install the `pydantic-ai-examples` package, for example:\n\n    ```shell\n    pip install pydantic-ai-examples\n    ```\n\n    or:\n\n    ```shell\n    uv venv\n    uv pip install pydantic-ai-examples\n    ```\n\n4. Run the example dojo server\n\n    ```shell\n    export OPENAI_API_KEY=<your api key>\n    python -m pydantic_ai_examples.ag_ui\n    ```\n\n    or:\n\n    ```shell\n    export OPENAI_API_KEY=<your api key>\n    uv run python -m pydantic_ai_examples.ag_ui\n    ```\n\n5. Open another terminal in root directory of the `ag-ui` repository clone\n6. Start the integration ag-ui dojo:\n\n    ```shell\n    pnpm install && pnpm run dev\n    ```\n\n7. Visit [http://localhost:3000/pydantic-ai](http://localhost:3000/pydantic-ai)\n8. Select View `Pydantic AI` from the sidebar\n\n\n## Feature Examples\n\n### Agentic Chat\n\nThis demonstrates a basic agent interaction including Pydantic AI server side\ntools and AG-UI client side tools.\n\nView the [Agentic Chat example](http://localhost:3000/pydantic-ai/feature/agentic_chat).\n\n#### Agent Tools\n\n- `time` - Pydantic AI tool to check the current time for a time zone\n- `background` - AG-UI tool to set the background color of the client window\n\n#### Agent Prompts\n\n```text\nWhat is the time in New York?\n```\n\n```text\nChange the background to blue\n```\n\nA complex example which mixes both AG-UI and Pydantic AI tools:\n\n```text\nPerform the following steps, waiting for the response of each step before continuing:\n1. Get the time\n2. Set the background to red\n3. Get the time\n4. Report how long the background set took by diffing the two times\n```\n\n### Agentic Generative UI\n\nDemonstrates a long running task where the agent sends updates to the frontend\nto let the user know what's happening.\n\nView the [Agentic Generative UI example](http://localhost:3000/pydantic-ai/feature/agentic_generative_ui).\n\n#### Plan Prompts\n\n```text\nCreate a plan for breakfast and execute it\n```\n\n### Human in the Loop\n\nDemonstrates simple human in the loop workflow where the agent comes up with a\nplan and the user can approve it using checkboxes.\n\n#### Task Planning Tools\n\n- `generate_task_steps` - AG-UI tool to generate and confirm steps\n\n#### Task Planning Prompt\n\n```text\nGenerate a list of steps for cleaning a car for me to review\n```\n\n### Predictive State Updates\n\nDemonstrates how to use the predictive state updates feature to update the state\nof the UI based on agent responses, including user interaction via user\nconfirmation.\n\nView the [Predictive State Updates example](http://localhost:3000/pydantic-ai/feature/predictive_state_updates).\n\n#### Story Tools\n\n- `write_document` - AG-UI tool to write the document to a window\n- `document_predict_state` - Pydantic AI tool that enables document state\n  prediction for the `write_document` tool\n\nThis also shows how to use custom instructions based on shared state information.\n\n#### Story Example\n\nStarting document text\n\n```markdown\nBruce was a good dog,\n```\n\nAgent prompt\n\n```text\nHelp me complete my story about bruce the dog, is should be no longer than a sentence.\n```\n\n### Shared State\n\nDemonstrates how to use the shared state between the UI and the agent.\n\nState sent to the agent is detected by a function based instruction. This then\nvalidates the data using a custom pydantic model before using to create the\ninstructions for the agent to follow and send to the client using a AG-UI tool.\n\nView the [Shared State example](http://localhost:3000/pydantic-ai/feature/shared_state).\n\n#### Recipe Tools\n\n- `display_recipe` - AG-UI tool to display the recipe in a graphical format\n\n#### Recipe Example\n\n1. Customise the basic settings of your recipe\n2. Click `Improve with AI`\n\n### Tool Based Generative UI\n\nDemonstrates customised rendering for tool output with used confirmation.\n\nView the [Tool Based Generative UI example](http://localhost:3000/pydantic-ai/feature/tool_based_generative_ui).\n\n#### Haiku Tools\n\n- `generate_haiku` - AG-UI tool to display a haiku in English and Japanese\n\n#### Haiku Prompt\n\n```text\nGenerate a haiku about formula 1\n```\n","readmeFilename":"README.md","homepage":"https://github.com/ag-ui-protocol/ag-ui#readme","repository":{"type":"git","url":"git+https://github.com/ag-ui-protocol/ag-ui.git"},"bugs":{"url":"https://github.com/ag-ui-protocol/ag-ui/issues"},"license":"MIT"}