Repository navigation
ci: index the docs on Context7 and refresh on push #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Context7 refresh | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - "README.md" | ||
| - "context7.json" | ||
| - "docs/**" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| refresh: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Trigger a Context7 refresh | ||
| env: | ||
| CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }} | ||
| LIBRARY_NAME: /${{ github.repository }} | ||
| run: | | ||
| status=$(curl --silent --show-error --max-time 180 --output response.json --write-out '%{http_code}' \ | ||
| -X POST https://context7.com/api/v1/refresh \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer $CONTEXT7_API_KEY" \ | ||
| -d "{\"libraryName\": \"$LIBRARY_NAME\"}") | ||
| cat response.json | ||
| echo | ||
| if [ "$status" = "200" ]; then | ||
| exit 0 | ||
| fi | ||
| if [ "$status" = "400" ] && jq -e '.error == "too-early"' response.json > /dev/null; then | ||
| echo "::notice::Context7 refreshed $LIBRARY_NAME recently, so it skipped this refresh." | ||
| exit 0 | ||
| fi | ||
| echo "::error::Context7 refresh failed with HTTP $status." | ||
| exit 1 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "$schema": "https://context7.com/schema/context7.json", | ||
| "url": "https://context7.com/cardmagic/classifier", | ||
| "public_key": "pk_veEo2smPvGYMwP1MncN1A", | ||
| "projectTitle": "Classifier (Ruby gem)", | ||
| "description": "Text classification in Ruby: Naive Bayes, Logistic Regression, LSI (Latent Semantic Indexing), k-Nearest Neighbors, and TF-IDF vectorization, with a native C extension, streaming training, pluggable persistence, and the classifier and keywords command-line tools. Requires Ruby 3.1+.", | ||
| "folders": [ | ||
| "docs" | ||
| ], | ||
| "excludeFiles": [ | ||
| "AGENTS.md", | ||
| "CLAUDE.md", | ||
| "CONTRIBUTING.md" | ||
| ], | ||
| "rules": [ | ||
| "Install with gem 'classifier' in the Gemfile, or brew install classifier for the command-line tools only. The gem requires Ruby 3.1 or newer.", | ||
| "Start with Classifier::Bayes for text classification. Use Classifier::LogisticRegression for calibrated probabilities, Classifier::LSI for semantic search and related documents, and Classifier::KNN for nearest-example votes.", | ||
| "Classifier::TFIDF must be fitted on a corpus before it transforms text; transform raises Classifier::NotFittedError before a fit. The keywords command fits a vocabulary first and reads that model in later commands.", | ||
| "Save and load trained models with the JSON persistence API. Prefer it to Marshal, and load a marshalled model only from a source you trust.", | ||
| "For data larger than memory, use train_from_stream, which reads one document per line from an IO stream. Classifier::TFIDF uses fit_from_stream. Use train_batch only for documents already in memory; Classifier::LSI and Classifier::KNN name it add_batch." | ||
| ] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule now presents
fit_from_streamas theClassifier::TFIDFoption for data larger than memory. However, it collects every document in an array before callingfit. Agents following this advice can generate code that runs out of memory on large corpora. State thatfit_from_streamstill requires the full corpus to fit in memory.Knowledge Base Used: Streaming processing
Prompt To Fix With AI