Cogniswitch
Cogniswitch工具规范 #
基类:EventBaseToolSpec
Cogniswitch 工具规范。 一个工具规范,包含 store_data 和 query_knowledge 作为工具,用于存储来自文件或 URL 的数据, 并分别从存储的知识中回答问题。
workflows/handler.py 中的源代码llama_index/tools/cogniswitch/base.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
store_data #
store_data(url: Optional[str] = None, file: Optional[str] = None, document_name: Optional[str] = None, document_description: Optional[str] = None) -> dict
使用 Cogniswitch 服务存储数据。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
url
|
Optional[str]
|
URL链接。 |
None
|
file
|
Optional[str]
|
您的文件路径。 |
None
|
document_name
|
Optional[str]
|
您正在上传的文档名称。 |
None
|
document_description
|
Optional[str]
|
文档描述。 |
None
|
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
dict |
dict
|
Cogniswitch 服务返回的 JSON 响应。 |
workflows/handler.py 中的源代码llama_index/tools/cogniswitch/base.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
query_knowledge #
query_knowledge(query: str) -> dict
向 Cogniswitch 服务发送查询并获取响应。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query
|
str
|
需要回答的查询。 |
required |
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
dict |
dict
|
Cogniswitch 服务的响应 JSON。 |
workflows/handler.py 中的源代码llama_index/tools/cogniswitch/base.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
knowledge_status #
knowledge_status(document_name: str) -> dict
使用此函数了解文档或已上传URL的状态 参数: document_name (str): 已上传的文档名称或URL。
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
dict |
dict
|
Cogniswitch 服务的响应 JSON。 |
workflows/handler.py 中的源代码llama_index/tools/cogniswitch/base.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
选项: 成员:- CogniswitchToolSpec