> For the complete documentation index, see [llms.txt](https://testindata.gitbook.io/dataset/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://testindata.gitbook.io/dataset/python-sdk/shang-chuan-wen-jian.md).

# 初始化SDK

### 构造函数

```
tda = TDA(accessKey, host="", debug=True)
```

初始化TDA对象

| 参数        | 类型     | 必填 | 说明                                                                                                                 |
| --------- | ------ | -- | ------------------------------------------------------------------------------------------------------------------ |
| accessKey | string | 是  | 从开发者账户获取的AccessKey                                                                                                 |
| host      | string | 否  | 默认为<https://dataset.testin.cn/>，当您使用的是私有化部署产品时，需要填入您自己部署访问的host，<http://协议头可不填，无协议头时默认使用http方式进行连接，带有协议头时按指定方式连接。> |
| debug     | bool   | 否  | 是否启用debug模式，默认为False                                                                                               |

返回全局的tda操作对象

###

### 设置TDA需要操作的数据集

```bash
tda.SetDataset(datasetId)
```

| 参数        | 类型     | 必填 | 说明                         |
| --------- | ------ | -- | -------------------------- |
| datasetId | string | 是  | 本次需要操作的数据集ID，可以从管理系统获得     |
| host      | string | 否  | 需要联通的数据集管理服务HOST，默认为saas服务 |

该函数无返回值。

###

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://testindata.gitbook.io/dataset/python-sdk/shang-chuan-wen-jian.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
