# resolve_destination

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/address/resolve_destination)

Settle where a run is traced, as `(project_name, address)`.

Exactly one of the two is set. A destination passed here beats the env vars; with
neither, `LANGSMITH_AGENT_ID` and `LANGSMITH_AGENT_ENVIRONMENT` decide, else the
project from `LANGSMITH_PROJECT` (or `default`). This is the rule the SDK applies to
a root run, for servers and apps that need to know a run's destination themselves.

## Signature

```python
resolve_destination(
    project_name: Optional[str] = None,
    address: Optional[Any] = None,
) -> tuple[Optional[str], Optional[AgentAddress]]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_name` | `Optional[str]` | No | A project named by the caller. (default: `None`) |
| `address` | `Optional[Any]` | No | An `AgentAddress` named by the caller, as returned by `agent_address`. (default: `None`) |

## Returns

`tuple[Optional[str], Optional[AgentAddress]]`

`(project_name, None)` or `(None, address)`, with the address validated.

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-python/blob/15dd2a789f976bbbafd803b26d0f25c08b5ed527/src/langsmith/address.py#L202)