This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from article_common_strict import SAMPLE_HTML | |
| from dataclasses import dataclass | |
| from datetime import date | |
| from typing import Literal | |
| from pydantic import BaseModel, Field | |
| from pydantic_ai import Agent, RunContext | |
| class ArticleInfo(BaseModel): | |
| """記事のメタデータ(カテゴリ・タグ付き)""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import date | |
| from pathlib import Path | |
| from typing import Literal | |
| from pydantic import BaseModel, Field | |
| from pydantic_ai import Agent | |
| # 解析対象のHTMLをファイルから読み込む | |
| html_path = Path(__file__).with_name("pytopics.html") | |
| with open(html_path, encoding="utf-8") as f: | |
| SAMPLE_HTML = f.read() |