Skip to content

Add source-linked briefing example#6

Merged
Autumn-Atlas merged 3 commits into
masterfrom
agent/source-linked-briefing-example
Jul 26, 2026
Merged

Add source-linked briefing example#6
Autumn-Atlas merged 3 commits into
masterfrom
agent/source-linked-briefing-example

Conversation

@Autumn-Atlas

@Autumn-Atlas Autumn-Atlas commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What changed

  • add a standalone source-linked briefing CLI under examples/source_linked_briefing/
  • support live Currents Search API queries and deterministic offline fixture execution
  • write normalized Markdown and JSON while preserving source URLs and publication times
  • validate malformed response and article field shapes before writing output
  • document setup, output, agent ownership boundaries, rights, freshness, and production limitations
  • link the example from the SDK README

Why

The live source-linked briefing article contains inline Python but did not provide a cloneable, testable GitHub example. This change gives readers an example they can run without credentials before trying a live search.

Developer impact

Developers can run the checked-in fictional fixture without network access or an API key. Live mode uses the existing CurrentsAPI.search() interface and keeps model processing outside the SDK example.

Validation

  • python3 -m pytest tests/test_source_linked_briefing_example.py -q — 8 passed
  • python3 -m pytest tests/ -q — 22 passed
  • python3 -m compileall -q currentsapi examples/source_linked_briefing tests
  • git diff --check
  • independent standards review: passed
  • independent specification review: passed

@Autumn-Atlas
Autumn-Atlas marked this pull request as ready for review July 26, 2026 04:52
@Autumn-Atlas
Autumn-Atlas merged commit b31b09d into master Jul 26, 2026
5 checks passed
@Autumn-Atlas
Autumn-Atlas deleted the agent/source-linked-briefing-example branch July 26, 2026 04:52

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf8afa16b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

validate_response(response)
articles = [normalize_article(article) for article in response["news"]]
articles.sort(key=lambda article: article["title"].casefold())
articles.sort(key=lambda article: article["published"], reverse=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse publication timestamps before sorting

When responses contain valid timestamps with different UTC offsets, lexicographic ordering is not chronological; for example, 2026-01-01T00:30:00+01:00 sorts ahead of the newer 2025-12-31T23:45:00Z. Parse and normalize nonempty timestamps before sorting so the documented newest-first order remains correct.

Useful? React with 👍 / 👎.

if article["published"]:
lines.append(" - Published: {}".format(article["published"]))
if article["description"]:
lines.append(" - {}".format(article["description"]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escape article text before rendering Markdown

When a live article description contains Markdown or a newline such as summary\n- Fabricated headline - <https://example.invalid>, this interpolation creates an additional rendered briefing item that appears independently source-linked. Because descriptions originate outside the application, escape Markdown control characters and indent or replace embedded line breaks before writing the human-readable briefing.

Useful? React with 👍 / 👎.

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.

1 participant