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

# Deployment

# Deployment

Types related to prompt deployments in the Python SDK.

## Deployment

A specific instance of a prompt that has been deployed to an environment. Returned by [`get_deployment()`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/adaline#get_deployment) and [`get_latest_deployment()`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/adaline#get_latest_deployment).

```python theme={null}
from adaline_api.models.deployment import Deployment
```

### Fields

**id** `str` *required*

The unique deployment identifier.

**created\_at** `int` *required*

Unix timestamp of when the deployment was created.

**updated\_at** `int` *required*

Unix timestamp of when the deployment was last updated.

**created\_by\_user\_id** `str` *required*

The ID of the user who created the deployment.

**updated\_by\_user\_id** `str` *required*

The ID of the user who last updated the deployment.

**project\_id** `str` *required*

The associated project ID.

**prompt\_id** `str` *required*

The associated prompt ID.

**deployment\_environment\_id** `str` *required*

The target deployment environment ID.

**prompt** `PromptSnapshot` *required*

The complete deployed prompt snapshot. See [PromptSnapshot](#promptsnapshot) below.

### Example

```python theme={null}
from adaline.main import Adaline

adaline = Adaline()

deployment = await adaline.get_latest_deployment(
    prompt_id="prompt_abc123",
    deployment_environment_id="environment_abc123"
)

print(f"ID: {deployment.id}")
print(f"Project: {deployment.project_id}")
print(f"Prompt: {deployment.prompt_id}")
print(f"Environment: {deployment.deployment_environment_id}")
print(f"Model: {deployment.prompt.config.model}")
print(f"Provider: {deployment.prompt.config.provider_name}")
print(f"Messages: {len(deployment.prompt.messages)}")
print(f"Tools: {len(deployment.prompt.tools)}")
print(f"Created at: {deployment.created_at}")
```

***

## PromptSnapshot

See the dedicated [PromptSnapshot](https://www.adaline.ai/docs/reference/sdk/v2/python/types/PromptSnapshot.md) page for full documentation.

The complete prompt configuration captured at deployment time, including model config, messages, tools, and variables.

```python theme={null}
from adaline_api.models.prompt_snapshot import PromptSnapshot
```

### Fields

**config** `PromptSnapshotConfig` *required*

Model provider and settings. See [Config Types](https://www.adaline.ai/docs/reference/sdk/v2/python/types/PromptSnapshotConfig.md).

**messages** `list[PromptMessage]` *required*

The prompt messages. Each message contains role and content fields.

**tools** `list[ToolFunction]` *required*

Tool/function definitions available to the model.

**variables** `list[PromptVariable]` *required*

Variable definitions used in the prompt template. See [PromptVariable](#promptvariable) below.

***

## PromptVariable

See the dedicated [PromptVariable](https://www.adaline.ai/docs/reference/sdk/v2/python/types/PromptVariable.md) page for full documentation.

A variable definition used in prompt templates.

```python theme={null}
from adaline_api.models.prompt_variable import PromptVariable
```

### Fields

**name** `str` *required*

The variable name (used as `{{variable_name}}` in prompt templates).

**modality** `str` *required*

The variable type. One of: `"text"`, `"image"`, `"pdf"`, `"api"`, `"prompt"`.

### Example

```python theme={null}
deployment = await adaline.get_latest_deployment(
    prompt_id="prompt_abc123",
    deployment_environment_id="environment_abc123"
)

for variable in deployment.prompt.variables:
    print(f"{variable.name} ({variable.modality})")
    # e.g. "user_name (text)", "document (pdf)"
```

***

## Complete Example

```python theme={null}
from adaline.main import Adaline
from openai import OpenAI

adaline = Adaline()
openai_client = OpenAI()

async def use_deployment():
    deployment = await adaline.get_latest_deployment(
        prompt_id="prompt_abc123",
        deployment_environment_id="environment_abc123"
    )

    prompt = deployment.prompt
    config = prompt.config

    print(f"Provider: {config.provider_name}")
    print(f"Model: {config.model}")
    print(f"Settings: {config.settings}")
    print(f"Messages: {len(prompt.messages)}")
    print(f"Tools: {len(prompt.tools)}")
    print(f"Variables: {[v.name for v in prompt.variables]}")

    # Build provider-specific messages from the deployment's prompt messages
    messages = [...]

    response = openai_client.chat.completions.create(
        model=config.model,
        messages=messages,
        temperature=config.settings.get("temperature"),
        max_tokens=config.settings.get("maxTokens"),
    )

    return response.choices[0].message.content
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.