gemini-api-php / client

Google Gemini API PHP Client allows you to use the Gemini AI model
MIT License
97 stars 16 forks source link

Embedding support #18

Closed erdemkose closed 6 months ago

erdemkose commented 6 months ago

Embedding is a technique used to represent information as a list of floating point numbers in an array. With Gemini, you can represent text (words, sentences, and blocks of text) in a vectorized form, making it easier to compare and contrast embeddings. For example, two texts that share a similar subject matter or sentiment should have similar embeddings, which can be identified through mathematical comparison techniques such as cosine similarity.

Use the embedding-001 model with either embedContents or batchEmbedContents

Gemini REST API Documentation