> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# embed • AI Agent SDK

> embed: Generate embedding for a single text.

# embed

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**EmbeddingAgent**](../classes/EmbeddingAgent) class in the [**embedding\_agent**](../modules/embedding_agent) module.

Generate embedding for a single text.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def embed(text: str, model: Optional[str]) -> List[float]
```

## Parameters

<ParamField query="text" type="str" required={true}>
  Text to embed
</ParamField>

<ParamField query="model" type="Optional" required={false}>
  Override model for this call \*\*kwargs: Additional provider-specific parameters
</ParamField>

### Returns

<ResponseField name="Returns" type="List[float]">
  List of floats representing the embedding vector
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
agent = EmbeddingAgent()
    embedding = agent.embed("Hello world")
    print(f"Dimension: {len(embedding)}")
```

## Uses

* `embedding`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/embedding_agent.py#L185">
  `praisonaiagents/agent/embedding_agent.py` at line 185
</Card>
