-
Notifications
You must be signed in to change notification settings - Fork 37
Labels
[Feature]New feature to highlight in changelogs.New feature to highlight in changelogs.
Milestone
Description
Summary
Implement embedding generation capabilities as outlined in docs/ARCHITECTURE.md and the development roadmap (#8, milestone 0.4.0).
Embeddings enable vector representations of text/content for use with vector databases, semantic search, and similarity comparisons.
Scope
Domain Layer
-
EmbeddingDTO (src/Embeddings/DTO/Embedding.php) — vector validation, dimension helpers -
EmbeddingResultimplementingResultInterface— carries embeddings, token usage, provider metadata -
EmbeddingOperationfor async/long-running embedding jobs
Builder & Client APIs
-
PromptBuilder::withEmbeddingInput(string|Message $input)— collect inputs for embedding -
PromptBuilder::generateEmbeddingsResult()/generateEmbeddingsOperation()/generateEmbeddings() - Matching methods on
AiClientfor traditional API surface - Capability inference routes through
CapabilityEnum::embeddingGeneration
Provider Contracts & Registry
-
EmbeddingGenerationModelInterface -
EmbeddingGenerationOperationModelInterface -
WithEmbeddingOperationsInterface -
ProviderRegistrydiscovery for embedding-capable models
Provider Implementations
- OpenAI embedding model metadata & adapter
- Google / Anthropic stubs or implementations as available
Testing & CLI
- Unit tests for DTOs, builder flows, client methods, provider adapters
- Mock embedding model in test fixtures
- CLI support (
--capability=embeddings, output formats)
Documentation
- README quick-start examples (fluent + traditional)
- Architecture/requirements doc updates
Related
- Roadmap: Development roadmap #8 (0.4.0 milestone)
- Architecture spec:
docs/ARCHITECTURE.md
Open Questions
- Input shape for multiple documents — new
withEmbeddingInputs()vs. reusing message stack? - Helper transformers on
EmbeddingResult(e.g.,toVectors(),toAssociativeArray())? - Provider-specific options (dimensions) — surface through
ModelConfig/SupportedOption?
Metadata
Metadata
Assignees
Labels
[Feature]New feature to highlight in changelogs.New feature to highlight in changelogs.