Skip to content
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

feat(embeddings)!: generate multiple embeddings #220

Merged
merged 3 commits into from
Mar 2, 2025

Conversation

ChrisB-TL
Copy link
Contributor

@ChrisB-TL ChrisB-TL commented Mar 2, 2025

Description

This PR adds support for generating multiple embeddings in one request.

I've implemented support for all current providers other than Gemini, as that requires a separate endpoint.

For now, Gemini throws an exception if multiple inputs are provided.

There is one breaking change, though I think worth it to support multiple embeddings going forward given the speed increase (and issues with provider request rate limits when sending many requests).

NOTE: I have created the Ollama sequence manually, as I don't have it setup on my machine. It should work but if someone could try this with a real request and record a new response, that would be great! I have tested OpenAI and Mistral with real requests.

Breaking Changes

  • EmbeddingResponse->embeddings now return an array of Embedding value objects

BREAKING CHANGE: EmbeddingResponse->embeddings now return an array of Embedding value objects
@sixlive sixlive merged commit 2f33b33 into prism-php:main Mar 2, 2025
6 checks passed
@ChrisB-TL ChrisB-TL deleted the feat/multiple-embeddings branch March 3, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants