Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

refactor: rename Embedder to Indexer and open input to iterable #336

Merged
merged 1 commit into from
Jun 22, 2025

Conversation

chr-hertel
Copy link
Member

No description provided.

@chr-hertel chr-hertel requested a review from Copilot June 22, 2025 10:24
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 refactors the embedding service by renaming Embedder to Indexer, updates its API to accept any iterable of documents, and propagates those changes through tests, examples, and documentation.

  • Renamed class and methods: Embedder::embed()Indexer::index()
  • Expanded input type from array to iterable<TextDocument> in constructor and docblocks
  • Updated all tests, example scripts, and the README to use the new class and method names

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Store/IndexerTest.php Renamed test class, attributes, and calls from Embedder → Indexer
tests/Platform/Vector/VectorTest.php Corrected namespace to match directory Platform\Vector
tests/Platform/Vector/NullVectorTest.php Corrected namespace to match directory Platform\Vector
src/Store/Indexer.php Renamed class, method signatures, and docblocks for iterable
examples/store/pinecone-similarity-search.php Updated example script to use Indexer::index()
examples/store/mongodb-similarity-search.php Updated example script to use Indexer::index()
README.md Updated README references and code snippet for Indexer
Comments suppressed due to low confidence (1)

tests/Store/IndexerTest.php:67

  • The debug message still refers to 'embed', but the class and method have been renamed to 'Indexer'. Update this to 'No documents to index' for consistency.
        $logger->expects(self::once())->method('debug')->with('No documents to embed');

@chr-hertel chr-hertel force-pushed the refactor-embedder-indexer branch from b8f84dc to 2d2dbd6 Compare June 22, 2025 10:26
@chr-hertel chr-hertel force-pushed the refactor-embedder-indexer branch from 2d2dbd6 to 56e2a9b Compare June 22, 2025 10:28
@chr-hertel chr-hertel merged commit 488d762 into main Jun 22, 2025
7 checks passed
@chr-hertel chr-hertel deleted the refactor-embedder-indexer branch June 22, 2025 11:30
chr-hertel added a commit to symfony/ai that referenced this pull request Jun 22, 2025
…iterable (chr-hertel)

This PR was merged into the main branch.

Discussion
----------

refactor: rename `Embedder` to `Indexer` and open input to iterable

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

Cherry picking php-llm/llm-chain#336

Commits
-------

957151a refactor: rename `Embedder` to `Indexer` and open input to iterable (#336)
@chr-hertel chr-hertel added the BC BREAK Backwards compatibility break label Jul 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
BC BREAK Backwards compatibility break refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant