-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathactions.json
More file actions
217 lines (217 loc) · 11.2 KB
/
Copy pathactions.json
File metadata and controls
217 lines (217 loc) · 11.2 KB
1
2
3
4
5
6
7
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
{
"RetrieveFromDatabase": {
"action_type": "RetrieveFromDatabase",
"description": "Generate an SQL query to retrieve the desired information from the DuckDB database. Please refer to the concrete database schema to produce a valid and executable SQL.",
"observation": "The observation space is the execution result of the SQL query. You do not need to worry about the actual execution, we will perform it for you. If the SQL failed to execute, we will return the error message. Extremely long SQL output will be truncated.",
"parameters": {
"sql": {
"type": "str",
"required": true,
"description": "The concrete DuckDB SQL query to execute and retrieve results."
}
},
"use_cases": [
{
"example": {
"sql": "SELECT abstract FROM metadata WHERE paper_id = '12345678';"
},
"explanation": "Get the abstract of the paper with paper_id '12345678' from the metadata table in the DuckDB database."
},
{
"example": {
"sql": "SELECT pages.page_number FROM images JOIN pages JOIN metadata ON images.ref_page_id = pages.page_id AND pages.ref_paper_id = metadata.paper_id WHERE metadata.paper_id = '12345678' AND images.image_caption LIKE '%Figure 3%';"
},
"explanation": "Find which page in the paper with paper_id '12345678' contains Figure 3."
}
]
},
"RetrieveFromVectorstore": {
"action_type": "RetrieveFromVectorstore",
"description": "Given a query text, retrieve relevant context from the Milvus vectorstore. Please refer to the schema of different collections and fields for each stored data entry.",
"observation": "The observation space is the retrieved top-ranked entries from the Milvus vectorstore based on input parameters.",
"parameters": {
"query": {
"type": "str",
"required": true,
"description": "The query text will be encoded and used to search for relevant context. You can rephrase the original user question to obtain a more clear and structured query requirement."
},
"collection_name": {
"type": "str",
"required": true,
"description": "The name of the collection in the Milvus vectorstore to search for relevant context. Please ensure the name comes from existing collection names."
},
"table_name": {
"type": "str",
"required": true,
"description": "The table name is used to narrow down the search space. It will be added to the filter condition. Please ensure it comes from existing table names which have encodable columns."
},
"column_name": {
"type": "str",
"required": true,
"description": "The column name is used to narrow down the search space. It will be added to the filter condition. Please ensure it comes from existing encodable columns in the specified `table_name`."
},
"filter": {
"type": "str",
"required": false,
"default": "",
"description": "The filter condition to narrow down the search space. Please refer to the syntax of filter conditions. By default, no filter condition. It is suggested to restrict `primary_key`, `pdf_id`, or `page_number` to refine search results. Note that you do not need to restrict `table_name` and `column_name` since they are already specified in the `table_name` and `column_name` parameters. Thus, if the `filter` parameter is empty, the actual filter condition will be `table_name == '{table_name}' and column_name == '{column_name}'`."
},
"limit": {
"type": "int",
"required": false,
"default": 5,
"description": "The number of top-ranked context to retrieve. Please set it to a positive integer to limit the number of returned results. Extremely large limit values may be truncated."
}
},
"use_cases": [
{
"example": {
"query": "Does this paper discuss LLM-based agent on its first page? (paper id is '12345678')",
"collection_name": "text_bm25_en",
"table_name": "chunks",
"column_name": "text_content",
"filter": "pdf_id == '12345678' and page_number == 1",
"limit": 10
},
"explanation": "Search the entire collection `text_bm25_en`, which use BM25 sparse embeddings, with the filter condition `table_name == 'chunks' and column_name == 'text_content' and pdf_id == '12345678' and page_number == 1` to restrict the content source and return the top 10 relevant entries."
},
{
"example": {
"query": "Is there any work about the topic structured RAG?",
"collection_name": "text_sentence_transformers_all_minilm_l6_v2",
"table_name": "metadata",
"column_name": "abstract"
},
"explanation": "Perform a similarity search on all cell values from the `abstract` column of the `metadata` table in the database, using the MiniLM-L6-v2 setence transformer embeddings. By default, the top 5 most relevant entries will be returned based on vector similarity."
}
]
},
"ClassicRetrieve": {
"action_type": "ClassicRetrieve",
"description": "Given a query text, retrieve relevant context from the Milvus vectorstore.",
"observation": "The observation space is the retrieved top-ranked entries from the Milvus vectorstore based on queries.",
"parameters": {
"query": {
"type": "str",
"required": true,
"description": "The query text will be encoded and used to search for relevant context. You can rephrase the original user question to obtain a more clear and structured query requirement."
},
"limit": {
"type": "int",
"required": false,
"default": 5,
"description": "The number of top-ranked context to retrieve. Please set it to a positive integer to limit the number of returned results. Extremely large limit values may be truncated."
}
},
"use_cases": [
{
"example": {
"query": "Is there any work about the topic structured RAG?"
},
"explanation": "Retrieve top 5 pieces about a certain topic."
},
{
"example": {
"query": "What's the learning rate for training the ResNet model?",
"limit": 4
},
"explanation": "Retrieve detailed information about the learning rate for training the ResNet model. The top 4 most relevant entries will be returned based on the query."
}
]
},
"CalculateExpr": {
"action_type": "CalculateExpr",
"description": "Calculate the expression and return the result. The expression should be a Python-style arithmetic expression that can be correctly processed by `eval()`.",
"observation": "The observation space is the result of the expression calculation. You do not need to worry about the actual calculation, we will perform it for you. If the calculation failed, we will return the error message.",
"parameters": {
"expr": {
"type": "str",
"required": true,
"description": "The expression to calculate."
}
},
"use_cases": [
{
"example": {
"expr": "2 + 3 * 4"
},
"explanation": "Calculate the expression 2 + 3 * 4."
}
]
},
"ViewImage": {
"action_type": "ViewImage",
"description": "You can retrieve the visual information of the paper by taking this action. Please provide the paper id, the page number, and the optional bounding box.",
"observation": "The observation space is the image that you want to view. We will show you the image according to your parameters. The error message will be shown if there is any problem with the image retrieval.",
"parameters": {
"paper_id": {
"type": "str",
"required": true,
"description": "The paper id to retrieve the image."
},
"page_number": {
"type": "int",
"required": true,
"description": "The page number (starting from 1) of the paper to retrieve the image."
},
"bounding_box": {
"type": "List[float]",
"required": false,
"default": [],
"description": "The bounding box of the image to retrieve. The format is [x_min, y_min, delta_x, delta_y]. The complete page will be retrieved if not provided."
}
},
"use_cases": [
{
"example": {
"paper_id": "12345678",
"page_number": 3,
"bounding_box": []
},
"explanation": "Retrieve the image of the third page of the paper with id 12345678."
},
{
"example": {
"paper_id": "12345678",
"page_number": 5,
"bounding_box": [
51.1,
204.3,
333.0,
13.8
]
},
"explanation": "Retrieve the image of the fifth page of the paper with id 12345678, with a bounding box of [51.1, 204.3, 333.0, 13.8]."
}
]
},
"GenerateAnswer": {
"action_type": "GenerateAnswer",
"description": "When you take this action, the retrieved results suffice to answer the user question. PLEASE STRICTLY ADHERE TO THE ANSWER FORMAT FOR THE CURRENT QUESTION.",
"observation": "There is no observation for this terminal action, since it indicates the completion of the task and end of the interaction.",
"parameters": {
"answer": {
"type": "Any",
"required": true,
"description": "The final answer to the user question. Please adhere to the answer format for the current question."
}
},
"use_cases": [
{
"example": {
"answer": 42
},
"explanation": "The answer to the user question is 42."
},
{
"example": {
"answer": [
"Results",
"Discussion"
]
},
"explanation": "The answer to the user question is a list of strings: ['Results', 'Discussion']."
}
]
}
}