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

扣子罗盘 SDK 支持通过版本标识拉取指定 Prompt 版本。
## 使用方式 {#395817b7}
在扣子罗盘中提交 Prompt 版本时，如果设置了版本标识，即可在 SDK 中通过 `get_prompt` 方法指定 `prompt_key` 和 `label` 来获取该版本的 Prompt 详细信息。
:::tip 说明
* `get_prompt` 方法中 `version` 参数优先级高于 `label`。 例如 Prompt 提交了两个版本（0.0.1 和 0.0.2），其中 0.0.2 版本添加了`production`标识，以下代码最终会获取 0.0.1 版本 prompt，而不是`production`标识对应的 0.0.2 版本。
   ```Go
   prompt = client.get_prompt(prompt_key="prompt_hub_test", version="0.0.1", label="production")
   ```

* `version`和`label`参数均为空时，会获取最新提交版本的 prompt。
:::
通过版本标识获取指定 Prompt 的示例代码如下：
```Python
import cozeloop

client = cozeloop.new_client(prompt_trace=True)

prompt = client.get_prompt(prompt_key={prompt_key}, label={label})

formatted_messages = client.prompt_format(prompt, {
    "var1": "artificial intelligence",
    "var2": "What is the weather like?",
})

print(formatted_messages)
```

