Cogniswitch
CogniswitchToolSpec #
Bases: BaseToolSpec
Cogniswitch 工具规范。一个 toolspec,将 store_data 和 query_knowledge 作为工具,分别用于从文件或 URL 存储数据以及从已存储的知识中回答问题。
Source code in llama-index-integrations/tools/llama-index-tools-cogniswitch/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链接。 |
无
|
file
|
Optional[str]
|
你的文件的文件路径。 |
无
|
document_name
|
Optional[str]
|
你正在上传的文档名称。 |
无
|
document_description
|
Optional[str]
|
文档描述。 |
无
|
返回值
名称 | 类型 | 描述 |
---|---|---|
dict |
dict
|
来自 Cogniswitch 服务的 JSON 响应。 |
Source code in llama-index-integrations/tools/llama-index-tools-cogniswitch/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
|
要回答的查询。 |
必需的 |
返回值
名称 | 类型 | 描述 |
---|---|---|
dict |
dict
|
来自 Cogniswitch 服务的 JSON 响应。 |
Source code in llama-index-integrations/tools/llama-index-tools-cogniswitch/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 响应。 |
Source code in llama-index-integrations/tools/llama-index-tools-cogniswitch/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 |
|