# GoogleGenerativeAIEmbeddings

> **Class** in `@langchain/google-genai`

📖 [View in docs](https://reference.langchain.com/javascript/langchain-google-genai/GoogleGenerativeAIEmbeddings)

Class that extends the Embeddings class and provides methods for
generating embeddings using the Google Palm API.

## Signature

```javascript
class GoogleGenerativeAIEmbeddings
```

## Extends

- `Embeddings`

## Implements

- `GoogleGenerativeAIEmbeddingsParams`

## Constructors

- [`constructor()`](https://reference.langchain.com/javascript/langchain-google-genai/GoogleGenerativeAIEmbeddings/constructor)

## Properties

- `apiKey`
- `caller`
- `maxBatchSize`
- `model`
- `modelName`
- `stripNewLines`
- `taskType`
- `title`

## Methods

- [`_embedDocumentsContent()`](https://reference.langchain.com/javascript/langchain-google-genai/GoogleGenerativeAIEmbeddings/_embedDocumentsContent)
- [`_embedQueryContent()`](https://reference.langchain.com/javascript/langchain-google-genai/GoogleGenerativeAIEmbeddings/_embedQueryContent)
- [`embedDocuments()`](https://reference.langchain.com/javascript/langchain-google-genai/GoogleGenerativeAIEmbeddings/embedDocuments)
- [`embedQuery()`](https://reference.langchain.com/javascript/langchain-google-genai/GoogleGenerativeAIEmbeddings/embedQuery)

## Examples

```typescript
const model = new GoogleGenerativeAIEmbeddings({
  apiKey: "<YOUR API KEY>",
  modelName: "embedding-001",
});

// Embed a single query
const res = await model.embedQuery(
  "What would be a good company name for a company that makes colorful socks?"
);
console.log({ res });

// Embed multiple documents
const documentRes = await model.embedDocuments(["Hello world", "Bye bye"]);
console.log({ documentRes });
```

---

[View source on GitHub](https://github.com/langchain-ai/langchainjs/blob/c5e896270207fcd3bdf1d1877e80b94c72d35f1e/libs/providers/langchain-google-genai/src/embeddings.ts#L79)