Skip to content

Docs: drop hard-coded current_year=2024 from FreshnessScorer examples - #2431

Open
SohamKukreti wants to merge 1 commit into
developfrom
docs-freshness-scorer-current-year
Open

SohamKukreti wants to merge 1 commit into
developfrom
docs-freshness-scorer-current-year

Conversation

@SohamKukreti

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #2427 (addresses #2426). FreshnessScorer now defaults current_year to the current year, but the LLM context docs still passed current_year=2024 in their examples. Readers who copy them get the old ranking: 2024 pages score highest, and newer pages score like undated ones.

This PR removes the hard-coded year from the examples, so they use the default. A short comment on the standalone example says that current_year defaults to this year and can be passed to score against another year.

Merge after #2427.

List of files changed and why

  • docs/md_v2/assets/llm.txt/txt/deep_crawl_advanced_filters_scorers.txt - remove current_year=2024 from both FreshnessScorer examples and add a comment on the default.
  • docs/md_v2/assets/llm.txt/txt/llms-full.txt - the same change in the same examples.

llms-full-v0.1.1.txt is the v0.1.1 snapshot, so it is not changed.

How Has This Been Tested?

Docs only. The examples use only weight, which is a valid argument before and after #2427. With #2427, FreshnessScorer(weight=...) scores against the current year (tested in that PR).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

FreshnessScorer now defaults to the current year, so the examples use the default and note how to override it.
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