xwk123 commited on
Commit
61a25a5
·
verified ·
1 Parent(s): 692287e

Upload 8 files

Browse files
Files changed (8) hide show
  1. all_queries.txt +183 -0
  2. data.json +38 -0
  3. data_ins.py +44 -0
  4. data_prompt.py +60 -0
  5. m_app_m_step.json +0 -0
  6. query.py +25 -0
  7. s_app_m_step.json +0 -0
  8. s_app_s_step.json +0 -0
all_queries.txt ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 我想用喜马拉雅听口语天天练
2
+ 用喜马拉雅播放历史记录
3
+ 打开便签
4
+ 我要看最近拍摄的照片
5
+ 搜索北京市的照片
6
+ 搜索昨天的照片
7
+ 打开携程旅行
8
+ 卸载高德地图
9
+ 卸载高德地图
10
+ 查看QQ好友动态
11
+ 我想发QQ信息给列表第一个人
12
+ 我想发条QQ信息给小爱
13
+ 打开大众点评
14
+ 用大众点评搜索附近美食|附近有什么好吃的
15
+ 用大众点评搜附近的火锅|我想用大众点评找一下附近的火锅店
16
+ 用大众点评查找知春路附近的美食
17
+ 打开大众点评收藏
18
+ 用大众点评搜索周边游
19
+ 用大众点评搜索酒店
20
+ 用大众点评搜索休闲娱乐
21
+ 打开大众点评亲子榜
22
+ 打开大众点评酒店榜
23
+ 打开大众点评丽人榜
24
+ 打开大众点评购物榜
25
+ 打开大众点评休娱榜
26
+ 打开大众点评景点榜
27
+ 打开大众点评美食榜
28
+ 打开大众点评网红店榜
29
+ 用大众点评搜索KTV
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
+ 打开QQ音乐
55
+ 打开QQ音乐搜索
56
+ 打开QQ音乐放一首歌
57
+ 播放QQ音乐
58
+ 用QQ音乐播放摇滚乐
59
+ 打开QQ音乐播放张碧晨和杨宗纬的歌
60
+ 打开QQ音乐流行指数榜
61
+ 播放QQ音乐我喜欢的音乐
62
+ 播放QQ音乐新歌推荐
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
+ 搜索辽宁的211大学
101
+ 清明节是几号
102
+ 今天是几号
103
+ 今天是几号|今天几号了
104
+ 今天几月几号
105
+ 中元节是农历几月几号
106
+ 7月1日是什么节日
107
+ 7月15日是什么节日
108
+ 明天早上0点叫我起床
109
+ 每周一早上八点叫我早点起床
110
+ 工作日早上八点叫我起床
111
+ 打开闹钟
112
+ 查询倒计时
113
+ 修改倒计时
114
+ 打开腾讯视频|下载腾讯视频
115
+ 打开美团
116
+ 打开QQ音乐
117
+ 打开喜马拉雅
118
+ 打开优酷视频
119
+ 打开QQ
120
+ 打开指南针
121
+ 打开抖音
122
+ 打开快手
123
+ 小米扫一扫
124
+ 打开滴滴
125
+ 打开计时器
126
+ 打开新浪网
127
+ 打开应用至尊蓝月
128
+ 打开QQ扫一扫
129
+ 打开QQ游戏
130
+ 打开QQ微视
131
+ 打开QQ坦白说
132
+ 用百度地图骑车去朝阳大悦城
133
+ 我要导航北京大学
134
+ 我的位置|我在哪里
135
+ 打开导航
136
+ 上班导航
137
+ 使用百度地图打车
138
+ 屏幕亮度增加30%
139
+ 屏幕亮度调到80
140
+ 音量调到零
141
+ 打开蓝牙|帮我打开蓝牙|开启蓝牙
142
+ 关闭蓝牙
143
+ 打开热点|打开个人热点|打开手机热点
144
+ 打开wifi设置
145
+ 关闭个人热点|关闭热点
146
+ 打开WIFI|连接网络|连接WIFI|打开无线网络|打开WIFI
147
+ 关闭飞行模式
148
+ 打开NFC|设置NFC
149
+ 勿扰模式
150
+ 关闭gps|打开定位|关闭位置服务|打开gps|打开GPS
151
+ 关闭流量|关闭数据流量|关闭数据网络|关闭移动数据|关闭数据
152
+ 打开勿扰模式|开启勿扰模式
153
+ 关闭勿扰模式
154
+ 打开静音
155
+ 关闭静音模式|取消静音|关闭静音
156
+ 方向锁定
157
+ 打开省电模式|开启省电模式
158
+ 关闭省电模式|关掉省电模式
159
+ 打开talkback|开启屏幕阅读器
160
+ 打开颜色反转|颜色反转
161
+ 关闭颜色反转
162
+ 设置音乐播放源|音乐播放源|更改音乐源
163
+ 将QQ音乐设置为音乐源
164
+ 将小米音乐设置为默认音乐播放源
165
+ 将网易云音乐设置为我的播放源|将网易云音乐设置为音乐源|设置网易云音乐为播放源|设置网易云音乐为音乐默认播放源|将网易云音乐变更为默认音乐源
166
+ 设置音乐播放源
167
+ 明天上午10点提醒我买菜
168
+ 打开振动模式
169
+ 关闭振动模式
170
+ 打开桌面设置页面
171
+ 关闭同步
172
+ 关闭语音唤醒
173
+ 打开语音唤醒
174
+ 打开地震报警
175
+ 打开5G网络
176
+ 关闭5G
177
+ 打开热点
178
+ 下周二天气怎么样
179
+ 未来一周的温度
180
+ 今天北京有雨吗?空气质量怎么样?温度怎么样?
181
+ 这周末上海的天气怎么样|周末的天气
182
+ 明天的空气质量|今天的空气质量
183
+ 北京明天下雨吗?
data.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": 888,
4
+ "case": {
5
+ "app": "计算器",
6
+ "query":
7
+ "Calculate 7*22-3"
8
+ },
9
+ "check_point": {
10
+ "package": "com.miui.calculator",
11
+ "activity": "com.miui.calculator",
12
+ "resource-id": "",
13
+ "text": ["&", "7", "乘", "2", "3"]
14
+ },
15
+ "skip_condition": {}
16
+ },
17
+ {
18
+ "id": 277,
19
+ "case": {
20
+ "package": "com.miui.calculator",
21
+ "app": "计算器",
22
+ "action": "",
23
+ "case_tag": "p5|intent",
24
+ "cid": "C248530013",
25
+ "feature": "",
26
+ "owner": " ",
27
+ "query":
28
+ "Calculate 7*2.2-4+1"
29
+ },
30
+ "check_point": {
31
+ "activity": "com.miui.calculator",
32
+ "resource-id": "",
33
+ "text": ["&", "7", "2", "加"]
34
+ },
35
+ "domain": "smartApp/other",
36
+ "skip_condition": {}
37
+ }
38
+ ]
data_ins.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ import sys
3
+ import time
4
+ import json
5
+ from appium.webdriver.common.touch_action import TouchAction
6
+ # from appium.webdriver.common.mobileby import MobileBy
7
+ from selenium.webdriver.common.by import By
8
+ from appium.webdriver.common.mobileby import MobileBy
9
+ from appium import webdriver
10
+
11
+ from agent_for_api.API_list import usr_api_list
12
+ from agent_for_api.agent_api_prompt import select_api_prompt, select_api_example
13
+ from agent_for_api.main_for_api import get_api_list
14
+ from data_prompt import *
15
+ from app_list import *
16
+ from agent_for_api.API_list import *
17
+ from selenium.common.exceptions import WebDriverException, InvalidElementStateException, NoSuchElementException
18
+
19
+ from app_list import app_list
20
+ from chatgpt import chatgpt
21
+ import re
22
+
23
+ if __name__ == '__main__':
24
+ # prompt = data_prompt.format(task_description=multiapp_description,
25
+ # examples=multiapp_examples, app_list=app_list, api_list=usr_api_list, requirement=multiapp_requirement)
26
+ # # print(prompt)
27
+ # res = chatgpt(prompt)[0]
28
+ # # print(res)
29
+ # with open("data_instruction.txt", "a") as outfile:
30
+ # outfile.write(res)
31
+ with open('s_app_s_step.json', 'r', encoding='UTF-8') as file:
32
+ data = json.load(file)
33
+ # 使用字典统计每个domain的数量
34
+ domain_count = {}
35
+ for item in data:
36
+ domain = item['domain']
37
+ if domain in domain_count:
38
+ domain_count[domain] += 1
39
+ else:
40
+ domain_count[domain] = 1
41
+ # 输出结果
42
+ print(len(domain_count))
43
+ for domain, count in domain_count.items():
44
+ print(f"{domain}: {count}")
data_prompt.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ data_prompt = '''
2
+ [Task description]:{task_description}
3
+ [Examples]:{examples}
4
+ [Sampled APP list]:{app_list}
5
+ [Sampled API list]:{api_list}
6
+ [Other requirements]:{requirement}'''
7
+
8
+ multiapp_requirement = '''
9
+ Please produce ten queries in line with the given requirements and inputs. These ten queries should display a diverse range of sentence structures:
10
+ some queries should be in the form of imperative sentences, others declarative, and yet others interrogative.
11
+ Equally, they should encompass a variety of tones, with some being polite, others straightforward. Ensure they vary in length and contain a wide range of subjects:
12
+ myself, my friends, family, and company.
13
+ Keep in mind that for each query, invoking just one APP won’t suffice; each query should call upon two to five APPs.
14
+ Aim to include a number of engaging queries as long as they relate to APP calls.
15
+ However, try to avoid explicitly specifying which APP to employ in the query. Each query should consist of a minimum of twenty words.
16
+ '''
17
+
18
+ '''For instance, if the APP ‘Traveloka’ has function description:
19
+ 'Get exclusive travel deals and enjoy the award-winning customer service! Traveloka app is your one-stop travel platform! Book with us for great deals on:
20
+ Flights: International and domestic flights at great rates
21
+ Hotels: Choose from over 1.2million hotels, resorts, and apartments around the world
22
+ Trains: Book tickets for United Kingdom, Germany, Italy, Spain, France, Switzerland, South Korea, and more.'
23
+ Your query should articulate something akin to: 'I am going on a business trip to Xiaomi Technology Park in Beijing this Friday.
24
+ Please help me check the suitable air tickets and train tickets, and then help me check the following hotels closest to there.'
25
+ This query exemplifies how to take advantage of all of the ‘Traveloka’ app features. '''
26
+
27
+ multiapp_description = '''
28
+ You will be provided with an available APP list with descriptions, an available API list including ADB Command, Function Description and Parameter Information.
29
+ Your task involves creating 10 varied, innovative, and detailed user queries that employ multiple APPs of a tool, API can be used as an auxiliary to provide basic functions.
30
+
31
+ Additionally, you must incorporate the input parameters required for each call.
32
+ Generate random information for required parameters such as IP address, location, coordinates, etc.
33
+ For instance, don’t merely say ‘an address’, provide the exact road and district names.
34
+ Don’t just mention ‘a product’, specify wearables, milk, a blue blanket, a pan, etc.
35
+ Don’t refer to ‘my home’, use a name of a real place.
36
+
37
+ The first seven of the ten queries should be very specific.
38
+ Each single query should combine at least two APPs in different ways and include the necessary parameters.
39
+ Note that you shouldn’t ask ‘which APP to use’, rather, simply state your needs that can be addressed by these APPs.
40
+ You should also avoid asking for the input parameters required by the APP call, but instead directly provide the parameter in your query.
41
+ The final three queries should be complex and lengthy, describing a complicated scenario where all the APPs can be utilized to provide assistance within a single query.
42
+
43
+ You should first think about possible related APP combinations, then give your query.
44
+ The final queries should be complex and lengthy, describing a complicated scenario where all the APP calls can be utilized to provide assistance within these queries.
45
+ You should first think about possible related APP and API combinations, then give your query. Related APP and apis can be used for a give query;
46
+ those Related APP and apis have to strictly come from the provided lists. For different queries, overlap of related APPs should be as little as possible.
47
+ Deliver your response in this format:
48
+ [Query1: ......, ‘related APPs’:[api1, api2, api3...],Query2: ......, ‘related APPs’:[api4, api5, api6...],Query3: ......, ‘related APPs’:[api1, api7, api9...], ...]
49
+ '''
50
+
51
+ multiapp_examples = '''
52
+ “Query”: “My fiancée and I are about to go to California for our honeymoon. The travel time is not important, but you need to recommend a suitable hotel to me. At least you need to tell me about the swimming pool, restaurant, Wifi, and elevators. As far as I know, there are many suitable hotels in California. For travel activities, please make a simple arrangement for us, including where you need to go every day, how much it costs, and how long you can travel for.”,
53
+ “related APPs”: [’Traveloka’, ‘Google Search’, ‘Maps’, ‘Weather’]
54
+ “Query”: “Who is Trump? Can you tell me about his life? As far as I know, he likes to participate in public welfare undertakings. Are there any recent news reports about his participation in public welfare activities? tell me the details.”,
55
+ “related APPs”: [’BBC News’, ‘Wikipedia’]
56
+ '''
57
+
58
+ sample_apiapp = '''
59
+
60
+ '''
m_app_m_step.json ADDED
The diff for this file is too large to render. See raw diff
 
query.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ # Load JSON file
4
+ with open('s_app_s_step.json', 'r', encoding='utf-8') as file:
5
+ data = json.load(file)
6
+
7
+ # Extract all query values and join them with newlines
8
+ query_list = []
9
+ for entry in data:
10
+ queries = entry.get('query', [])
11
+ for query in queries:
12
+ # Ensure each query is a string
13
+ if isinstance(query, dict):
14
+ query_list.append(json.dumps(query, ensure_ascii=False)) # Convert dict to JSON string if needed
15
+ else:
16
+ query_list.append(query)
17
+
18
+ # Join queries with newline separator
19
+ all_queries = '\n'.join(query_list)
20
+
21
+ # Write to a new file
22
+ with open('all_queries.txt', 'w', encoding='utf-8') as output_file:
23
+ output_file.write(all_queries)
24
+
25
+ print("All queries have been saved to all_queries.txt")
s_app_m_step.json ADDED
The diff for this file is too large to render. See raw diff
 
s_app_s_step.json ADDED
The diff for this file is too large to render. See raw diff