This skill provides access to Gangtise's knowledge base API for querying financial and market information.
Before using this skill, you need to configure your API credentials:
bash
python3 scripts/configure.py
You will be prompted to enter your Access Key and Secret Key, which can be obtained from: https://open.gangtise.com
The API uses OAuth2-style authentication:
loginV2json
{
"accessKey": "your-access-key",
"secretAccessKey": "your-secret-key"
}
json
{
"code": "000000",
"data": {
"accessToken": "Bearer xxxx-xxxx-xxxx-xxxx",
"expiresIn": 3600,
"uid": 123,
"userName": "your-name",
"tenantId": 1,
"time": 1704067200
}
}
https://open.gangtise.combash
python3 scripts/configure.py
Interactive setup for API credentials. Run this first before using any other scripts.
bash
python3 scripts/get_token.py
Returns a valid access token for API calls.
bash
# Basic query
python3 scripts/query_kb.py "比亚迪最新消息"
# With options
python3 scripts/query_kb.py "特斯拉" --type 10,40 --top 5 --days 180
# With explicit token
python3 scripts/query_kb.py "宁德时代" --token YOUR_TOKEN
/application/auth/oauth/open/loginV2
{ "accessKey": "...", "secretAccessKey": "..." }{ "code": "000000", "data": { "accessToken": "..." } }/application/open-data/ai/search/knowledge/batch
Authorization: Bearer {token}application/json参数名必选类型说明queries是List查询条件列表,最大支持5个查询条件top否Integer返回文档数量,默认10,最大支持20resourceTypes否List知识库资源类型列表knowledgeNames否List知识库类型(默认只使用系统库)startTime否Long数据查询开始时间(13位时间戳)endTime否Long数据查询结束时间(13位时间戳)
代码类型说明10券商研究报告证券公司发布的研究报告20内部研究报告机构内部研究报告40首席分析师观点分析师观点文章50公司公告上市公司公告60会议平台纪要会议纪要70调研纪要公告调研纪要80网络资源纪要网络资源90产业公众号产业相关公众号文章
system_knowledge_doc - 系统库(默认)tenant_knowledge_doc - 租户库json
{
"code": "000000",
"msg": "操作成功",
"status": true,
"data": [
{
"query": "查询问题",
"data": [
{
"content": "文本切片内容",
"resourceType": 10,
"title": "文件标题",
"company": "公司",
"industry": "行业",
"time": 1746506803000,
"sourceId": "溯源id",
"knowledgeName": "知识库名称",
"extraInfo": {
"position": {
"page": [1],
"totalPages": 14,
"polygon": []
}
}
}
]
}
]
}
状态码说明200操作成功429接口繁忙,请稍后再试
bash
python3 scripts/query_kb.py "比亚迪" --top 3
bash
python3 scripts/query_kb.py "新能源" --type 10,50 --top 5
bash
python3 scripts/query_kb.py "AI芯片" --days 30 --top 10
bash
python3 scripts/query_kb.py "宁德时代" --json
Credentials are stored in config.json (created automatically by configure.py):
json
{
"ACCESS_KEY": "your-access-key",
"SECRET_KEY": "your-secret-key",
"BASE_URL": "https://open.gangtise.com"
}
Note: The configuration file has restricted permissions (600) to protect your credentials.