创建 Client

最近更新时间:2025-09-12 21:41:52

我的收藏

接口定义

DeepSearchClient() 用于通过 HTTP I/O 请求方式的请求方式创建一个 DeepSearch 的客户端对象。
class DeepSearchClient(
endpoint: str,
api_key: str,
service_id: str,
timeout: int = 60,
stub: Stub | None = None
)

使用示例

from tdaideepsearch import DeepSearchClient
EndPoint = "https://deepsearch.tdai.tencentyun.com"
ApiKey = "*************************"
ServiceId = "tdai-dps-9f3w****"

client = DeepSearchClient(endpoint=EndPoint, api_key=ApiKey, service_id=ServiceId)

参数名
参数含义
是否必须
获取方式
endpoint
客户端所需连接 DeepSearch 服务端的访问地址。
登录 DeepSearch 控制台,在详情页面的 API 接入区域,可获取 DeepSearch 的访问地址与访问密钥。
api_key
客户端访问 DeepSearch 服务端的 API 密钥,用于进行身份认证。
service_id
DeepSearch 服务端具有唯一标识的 ID。
登录 DeepSearch 控制台,在 DeepSearch 的卡片上或详情页面,可复制 ID。
timeout
请求超时时间。
单位:秒。
默认值:10。
取值范围:大于等于0。若 timeout 设置为小于0或为 null,系统会自动赋值为默认值。