Skip to content

fix(example): use aware web search timestamps#694

Open
Ghraven wants to merge 1 commit into
ollama:mainfrom
Ghraven:fix/web-search-aware-timestamps
Open

fix(example): use aware web search timestamps#694
Ghraven wants to merge 1 commit into
ollama:mainfrom
Ghraven:fix/web-search-aware-timestamps

Conversation

@Ghraven

@Ghraven Ghraven commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • replace datetime.utcnow() in the GPT-OSS web search helper example with datetime.now(timezone.utc)
  • keep the existing Page.fetched_at type and behavior while making timestamps timezone-aware

Problem

The example currently creates fetched-at timestamps with naive UTC datetimes. datetime.utcnow() is deprecated in modern Python, and the resulting values do not carry explicit timezone information.

Before / After

Before, fetched pages stored naive UTC timestamps.

After, fetched pages store UTC-aware timestamps with timezone.utc.

Verification

  • python -m py_compile examples/web_search_gpt_oss_helper.py
  • git diff --check

@vaderollama vaderollama left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — replaces deprecated datetime.utcnow() with datetime.now(timezone.utc) in the web search example. Pure quality fix, no behavior change for users. Low risk.

@ParthSareen — ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants