# AI

Canonical page: https://docs.ovok.com/python-sdk/namespaces/ai

`ovok.ai` gives access to Ovok's AI features: text translation, natural-language FHIR search and
chat sessions.

## Translate text [#translate-text]

```python
from ovok_sdk import Ovok

ovok = Ovok("https://api.sandbox.ovok.com", "your-tenant")
translation = ovok.ai.translate(
    {"sourceLanguage": "en", "targetLanguage": "de", "text": ["Take one tablet daily."]}
)
```

## Search FHIR data in plain language [#search-fhir-data-in-plain-language]

```python
result = ovok.ai.fhir_search({"text": "patients with a blood pressure above 140 this week"})
```

## Chat [#chat]

Start a session with `chat.sessions`, then send and list its messages with `chat.messages`.

```python
session = ovok.ai.chat.sessions.create({"title": "Care plan questions"})
reply = ovok.ai.chat.messages.send(session["id"], {"content": "Summarize today's vitals."})
history = ovok.ai.chat.messages.list(session["id"])
```

Request and response bodies are passed through as the API defines them.

## API reference [#api-reference]

See [`ovok_sdk.resources.ai`](/python-sdk/reference/resources/ai) for every method, parameter and error.
