Socket
Book a DemoInstallSign in
Socket

metaso-sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metaso-sdk

The official Python SDK for https://metaso.cn

0.1.6
pipPyPI
Maintainers
1

metaso-sdk

ci documentation pypi version

秘塔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)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.