metaso-sdk
秘塔AI搜索 Python SDK。在使用这个 SDK 之前,请先通过API文档专题了解 HTTP 接口的更多细节。
安装
pip install metaso-sdk
配置 METASO_API_KEY
metaso-sdk 从环境变量 METASO_API_KEY 读取用于认证的 API 密钥,可以在 shell 里进行设置:
export METASO_API_KEY="mk-EE2..."
或者在 Python 代码里进行设置:
import os
os.environ["METASO_API_KEY"] = "mk-EE2..."
搜索
搜索问题
from metaso_sdk import search, Query
search(Query(question="abc"))
追问
search(Query(question="广播公司", sessionId="8550018047390023680"))
流式返回
for chunk in search(Query(question="abc"), stream=True):
print(chunk)
...
{'type': 'heartbeat'}
{'text': '因此,“abc”可以指代字母表的前三个字母、美籍华裔、美国广播公司、一种音乐记谱法以及一种编程语言。具体含义需要根据上下文来确定。', 'type': 'append-text'}
专题
递归上传文件夹
from metaso_sdk import create_topic, upload_directory, Topic
topic = create_topic(Topic(name="functional programing"))
files = upload_directory(topic, "dir")
搜索特定专题
from metaso_sdk import search, Query
query = Query(question="functional")
search(query, topic=topic)
Metadata
Release files for metaso-sdk 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| metaso_sdk-0.1.6.tar.gz | 2.6 MB | Without provenance | Details for metaso_sdk-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| metaso_sdk-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for metaso_sdk-0.1.6-py3-none-any.whl |
Total release size: 2.6 MB
Release files / metaso_sdk-0.1.6.tar.gz
| Download URL | metaso_sdk-0.1.6.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e2af938935eecfa6ec14ab6f9f0791b1a20f57d395685243e8960bc03db757e
|
|
BLAKE2b-256 checksum How to use checksums |
6cf66563dc6a3fcb117199d0cba23d8904c85dc22bd85be35aac15b5c48be070
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / metaso_sdk-0.1.6-py3-none-any.whl
| Download URL | metaso_sdk-0.1.6-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44bd4811b67c8d89ec04ffb457cdb4ecdd66ce79dbb05314512a5374f2c59f1e
|
|
BLAKE2b-256 checksum How to use checksums |
9f7fd07a4c611fcb02825200178ec6cb6cbe4cfae6c92708045a7b6c2f26adb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for metaso-sdk 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.