Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/web_search_gpt_oss_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import re
from dataclasses import dataclass, field
from datetime import datetime
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, Protocol, Tuple
from urllib.parse import urlparse

Expand Down Expand Up @@ -212,7 +212,7 @@ def _build_search_results_page_collection(self, query: str, results: Dict[str, A
text='',
lines=[],
links={},
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
)

tb = []
Expand Down Expand Up @@ -246,7 +246,7 @@ def _build_search_result_page(self, result: WebSearchResult, link_idx: int) -> P
text='',
lines=[],
links={},
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
)

link_fmt = f'【{link_idx}†{result.title}】\n'
Expand Down Expand Up @@ -275,7 +275,7 @@ def _build_page_from_fetch(self, requested_url: str, fetch_response: Dict[str, A
text='',
lines=[],
links={},
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
)

for url, url_results in fetch_response.get('results', {}).items():
Expand Down Expand Up @@ -306,7 +306,7 @@ def _build_find_results_page(self, pattern: str, page: Page) -> Page:
text='',
lines=[],
links={},
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
)

max_results = 50
Expand Down Expand Up @@ -442,7 +442,7 @@ def open(
text='',
lines=[],
links={},
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
)
available = sorted(page.links.keys())
available_list = ', '.join(map(str, available)) if available else '(none)'
Expand Down