Skip to content

Conversation

Borewit
Copy link
Owner

@Borewit Borewit commented Jul 15, 2025

This PR introduces and documents the new fromBlob() method and refines the README’s method listings, parameter tables, and code samples for the various tokenizer factories.

  • Add a new fromBlob() section with signature, parameters, and example
  • Update method list order and remove outdated lines
  • Align parameter tables and fix signatures/examples for fromBuffer, fromFile, and fromWebStream

@Borewit Borewit requested a review from Copilot July 15, 2025 12:50
@Borewit Borewit self-assigned this Jul 15, 2025
Copilot

This comment was marked as outdated.

@Borewit Borewit force-pushed the improve-api-docs branch from 918b751 to 58c81ea Compare July 15, 2025 12:52
@coveralls
Copy link

coveralls commented Jul 15, 2025

Coverage Status

coverage: 93.859%. remained the same
when pulling 4aca79d on improve-api-docs
into 2d0295f on master.

@Borewit Borewit force-pushed the improve-api-docs branch from 58c81ea to b38f02c Compare July 15, 2025 12:54
@Borewit Borewit requested a review from Copilot July 15, 2025 12:55
Copilot

This comment was marked as outdated.

@Borewit Borewit force-pushed the improve-api-docs branch from b38f02c to 58724aa Compare July 15, 2025 13:00
Document `fromBlob()`
@Borewit Borewit force-pushed the improve-api-docs branch from 58724aa to 4aca79d Compare July 15, 2025 13:01
@Borewit Borewit requested a review from Copilot July 15, 2025 13:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces and documents the new fromBlob() method and refines the README’s method listings, parameter tables, and code samples for the various tokenizer factories.

  • Add a new fromBlob() section with signature, parameters, and example
  • Update method list order and remove outdated lines
  • Align parameter tables and fix signatures/examples for fromBuffer, fromFile, and fromWebStream
Comments suppressed due to low confidence (4)

README.md:61

  • This line duplicates the fromBuffer entry in the method list and should be removed to avoid confusion.
- [fromBuffer](#frombuffer-function)

README.md:114

  • The Type column only references Uint8Array but the description says it also accepts Buffer. Consider updating it to Buffer | Uint8Array for accuracy.
| uint8Array | no       | [Uint8Array](https://nodejs.org/api/buffer.html) | Buffer or Uint8Array to read from |

README.md:180

  • The code signature uses AnyWebByteStream but the table lists ReadableStream. Align these types so readers know exactly what type to pass.
| webStream      | no       | [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) | WHATWG ReadableStream to read from |

README.md:88

  • Node's core fs module does not provide an openAsBlob export. Update the snippet to use a valid API (e.g., fs.promises.open() or fs.readFile + new Blob(...)).
import { openAsBlob } from 'node:fs';

@Borewit Borewit merged commit 9193bfd into master Jul 15, 2025
25 checks passed
@Borewit Borewit deleted the improve-api-docs branch July 15, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants