Pydantic AI

Pydantic AI provides a typed Python framework for building agents with validated outputs and model-provider integrations

출처 원문 · EN

실제 예시 보기

제품 화면

Pydantic AI: inspect a complete two-turn chat

The FastAPI example stores history between requests: a German Shepherd preference is followed by a recall question. This original screenshot includes both complete turns and replies, transcribed below with turn labels. The guide links the capture to its chat-app example without identifying a generation model.

Pydantic AI: inspect a complete two-turn chat
전체 이미지 보기

입력 예시

User turn 1:
My favorite dog breed is the German Shepherd. What's yours?

User turn 2:
Can you remember what my favorite breed is?

출력 예시

Assistant turn 1:
I don't have personal preferences or feelings, but I can help share information about various dog breeds if you'd like! German Shepherds are known for their intelligence, loyalty, and versatility. They're often used in working roles like police and service dogs. Is there anything specific you'd like to know about them or another breed?

Assistant turn 2:
You mentioned that your favorite dog breed is the German Shepherd.
라이선스

Complete original license and any source copyright retained. Source-authored examples are separate from site-reproduced results; no original scripts, installations, model/API requests, account creation, memory writes, graph queries or tests were executed. Complete visible messages/queries and selected replies are manually transcribed from the native author image; turn labels only identify sequence. Original PNG converted at native resolution to lossless WebP with identical decoded RGBA; no crop, retouch or upscaling.

The MIT License (MIT)

Copyright (c) Pydantic Services Inc. 2024 to present

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
제품 화면

Pydantic AI: preview the built-in web chat

The built-in browser UI brings conversation history, tool controls and model selection together. This original guide capture displays Claude Haiku 4.5 and the complete user question. The guide positions the UI for local development and debugging; production use calls for the documented authenticated frontend setup.

Pydantic AI: preview the built-in web chat
전체 이미지 보기

입력 예시

tell me something about yourself
라이선스

Complete original license and any source copyright retained. Source-authored examples are separate from site-reproduced results; no original scripts, installations, model/API requests, account creation, memory writes, graph queries or tests were executed. Complete visible messages/queries and selected replies are manually transcribed from the native author image; turn labels only identify sequence. Original PNG converted at native resolution to lossless WebP with identical decoded RGBA; no crop, retouch or upscaling.

The MIT License (MIT)

Copyright (c) Pydantic Services Inc. 2024 to present

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
사용 예시

Pydantic AI: return a typed sentiment object

The author’s full script defines a typed Sentiment result, supplies a review-snippet tool, and asks about an app’s feedback. Its positive/0.9 source comment illustrates the output shape. Keep the declared provider/model and supply valid credentials when trying the recipe.

입력 예시

from typing import Literal

from pydantic import BaseModel, Field

from pydantic_ai import Agent, RunContext


class Sentiment(BaseModel):
    label: Literal['positive', 'negative', 'neutral']
    score: float = Field(ge=-1, le=1)


agent = Agent('openai:gpt-6.1-sol', output_type=Sentiment)


@agent.tool
def recent_reviews(ctx: RunContext, product: str) -> list[str]:
    """Fetch recent review snippets for a product."""
    return ['The new release fixed everything I complained about!']


result = agent.run_sync('How are people feeling about the Extract app?')
print(result.output)
#> label='positive' score=0.9

출력 예시

label='positive' score=0.9
라이선스

Complete original license and any source copyright retained. Source-authored examples are separate from site-reproduced results; no original scripts, installations, model/API requests, account creation, memory writes, graph queries or tests were executed.

The MIT License (MIT)

Copyright (c) Pydantic Services Inc. 2024 to present

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

제품 소개

Type-safe Python framework for building agents and LLM applications. Model-agnostic with built-in validation, structured outputs, and seamless observability.

출처 원문 · EN
출처에 기재된 기능

Pydantic AI의 주요 기능

  1. 01Validate structured model outputs
  2. 02Connect agent functions and MCP tools
  3. 03Trace runs and evaluate agent behavior
출처 원문 · EN
차별점

차별점

Python type definitions are used to describe outputs and callable tools. Provider costs and observability services are separate from the open-source framework.

출처 원문 · EN
추천 대상

추천 대상

  • Python application developers
  • Teams building agents with typed data
출처 원문 · EN
선택하기 전에

확인할 사항

  • 실제 작업 하나를 시험하고 결과가 요구 사항에 맞는지 비교합니다.
  • 어떤 데이터가 저장·공유되거나 학습에 사용되는지 확인합니다.
  • 공식 사이트에서 현재 가격, 사용 한도, 해지 조건을 확인합니다.
마지막 확인

공식 링크는 2026년 11월 9일에 확인했습니다. 기능 주장은 독립적으로 테스트하지 않았습니다.

관련 작업

제품가격이용 방법사용 사례
Pydantic AI미확인API작업 흐름 자동화
Haystack미확인정보 없음작업 흐름 자동화
Open Interpreter미확인Windows, macOS, Linux작업 흐름 자동화
Opik미확인정보 없음프로덕션 코드 생성 · 작업 흐름 자동화
REA미확인Web, Windows, Android작업 흐름 자동화