Skip to content

[Store] Add $options parameter to Vectorizer methods for Platform invoke configuration #495

@chr-hertel

Description

@chr-hertel

Summary

The Vectorizer and VectorizerInterface should be extended to support passing options to the underlying Platform->invoke() calls. This will allow users to configure platform-specific options like temperature, top_k, etc. when vectorizing text documents.

Required Changes

1. Interface Updates

Add an optional $options = [] parameter to both methods in VectorizerInterface:

  • vectorizeTextDocuments(array $documents, array $options = []): array
  • vectorize(string $string, array $options = []): Vector

2. Implementation Updates

Update the Vectorizer class to:

  • Accept the $options parameter in both methods
  • Pass these options as the third parameter to $this->platform->invoke() calls (lines 38, 47, 74)

3. Bundle Configuration

Make vectorizer options configurable through the AI bundle configuration, similar to how the model is currently configured. This should allow users to set default options that will be used for all vectorization operations.

Use Cases

This enhancement enables:

  • Setting platform-specific embedding parameters (temperature, dimensions, etc.)
  • Configuring retry strategies or timeouts for vectorization

Files to Modify

  • src/store/src/Document/VectorizerInterface.php - Add $options parameter to method signatures
  • src/store/src/Document/Vectorizer.php - Implement $options parameter and pass to platform invoke calls
  • Bundle configuration files - Add vectorizer options configuration support

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueIdeal for your first contribution! (some Symfony experience may be required)Hackathon 2025This issue or pull request was part of the Symfony AI Hackathon 2025StoreIssues & PRs about the AI Store component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions