kenken999 commited on
Commit
b5ce3be
·
1 Parent(s): 808cb8c
babyagi/prompt.txt CHANGED
@@ -1 +1,7 @@
1
- ウィーン金貨1オンスはいくらで買い取ってもらえますか?の質問 についてチャットボットでよりよく対応するプランを日本語で作成して
 
 
 
 
 
 
 
1
+ お世話になっております。
2
+
3
+ 本日商品送らせていただきます。
4
+
5
+ また、地金とジュエリーは分けてますがリスト等はないのでリファスタ様が査定しやすいようにやって頂ければと思います。
6
+
7
+ よろしくお願いいたします🙇‍♂️の質問 についてチャットボットでよりよく対応するプランを日本語で作成して
controllers/gpt_enginner20240702032404 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 356f467035b018b6a29ba5067aaeaf7c829f8097
controllers/gpt_enginner20240702033021 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit a6eff01d2fb149334cdffe94670dc89ca010f14e
controllers/gpt_enginner20240702033408 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 532d92002c740b2b01e70c456198419ed5a88611
controllers/gpt_enginner20240702033745 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 061de5449cab68a5dac4a8058a52581184abcc50
mysite/interpreter/google_chat.py CHANGED
@@ -28,20 +28,6 @@ def send_google_chat_card(webhook_url, title, subtitle, link_text, link_url,imag
28
  "text": subtitle
29
  }
30
  },
31
- {
32
- "buttons": [
33
- {
34
- "textButton": {
35
- "text": "チャットボット設定シートを開く ",
36
- "onClick": {
37
- "openLink": {
38
- "url": link_url
39
- }
40
- }
41
- }
42
- }
43
- ]
44
- },
45
  {
46
  "buttons": [
47
  {
@@ -55,91 +41,7 @@ def send_google_chat_card(webhook_url, title, subtitle, link_text, link_url,imag
55
  }
56
  }
57
  ]
58
- },
59
- {
60
- "buttons": [
61
- {
62
- "textButton": {
63
- "text": "Q&A検証正しい物だけにチェック",
64
- "onClick": {
65
- "openLink": {
66
- "url": "https://kenken999-php.hf.space/zendesk__dataszz_list.php?qs=500%E5%86%86"
67
- }
68
- }
69
- }
70
- }
71
- ]
72
- },
73
- {
74
- "buttons": [
75
- {
76
- "textButton": {
77
- "text": "データ確認チャット 反映されているか確認",
78
- "onClick": {
79
- "openLink": {
80
- "url": "https://kenken999-nodex-n8n-domain.hf.space/webhook/6264497c-6231-4023-abef-82b86f8e298b/chat"
81
- }
82
- }
83
- }
84
- }
85
- ]
86
  },
87
- {
88
- "buttons": [
89
- {
90
- "textButton": {
91
- "text": "WEBボットカスタマーサポートテスト",
92
- "onClick": {
93
- "openLink": {
94
- "url": "https://kenken999-php.hf.space/main_list.php?page=mainpage"
95
- }
96
- }
97
- }
98
- }
99
- ]
100
- },
101
- {
102
- "buttons": [
103
- {
104
- "textButton": {
105
- "text": "HUBスポットチャットテスト",
106
- "onClick": {
107
- "openLink": {
108
- "url": "https://kenken999-gradio-fastapi-statichfspace-46277896.hubspotpagebuilder.com/workflow"
109
- }
110
- }
111
- }
112
- }
113
- ]
114
- },
115
- {
116
- "buttons": [
117
- {
118
- "textButton": {
119
- "text": "ダイヤモンドデータ確認 EVAのデータも登録し予測検索用にベクトル化する",
120
- "onClick": {
121
- "openLink": {
122
- "url": "https://kenken999-php.hf.space/diamondprice_list.php"
123
- }
124
- }
125
- }
126
- }
127
- ]
128
- },
129
- {
130
- "buttons": [
131
- {
132
- "textButton": {
133
- "text": "ワークフロー修正",
134
- "onClick": {
135
- "openLink": {
136
- "url": "https://kenken999-nodex-n8n-domain.hf.space/workflow/hArXsWSx9ZrvUnvT"
137
- }
138
- }
139
- }
140
- }
141
- ]
142
- },
143
  {
144
  "buttons": [
145
  {
 
28
  "text": subtitle
29
  }
30
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  {
32
  "buttons": [
33
  {
 
41
  }
42
  }
43
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  {
46
  "buttons": [
47
  {
mysite/interpreter/google_chat_bk.py ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import json
3
+
4
+ def convert_newlines_to_google_chat_format(text):
5
+ # 改行文字を <br> タグに置き換える
6
+ return text.replace('\\n', '\\\n')
7
+ #
8
+ def send_google_chat_card(webhook_url, title, subtitle, link_text, link_url,image_url=None):
9
+ headers = {
10
+ 'Content-Type': 'application/json; charset=UTF-8'
11
+ }
12
+
13
+ subtitle = convert_newlines_to_google_chat_format(subtitle)
14
+
15
+ card_message = {
16
+ "cards": [
17
+ {
18
+ "header": {
19
+ "title": title,
20
+ "imageUrl": image_url,
21
+ "imageStyle": "IMAGE"
22
+ },
23
+ "sections": [
24
+ {
25
+ "widgets": [
26
+ {
27
+ "textParagraph": {
28
+ "text": subtitle
29
+ }
30
+ },
31
+ {
32
+ "buttons": [
33
+ {
34
+ "textButton": {
35
+ "text": "チャットボット設定シートを開く ",
36
+ "onClick": {
37
+ "openLink": {
38
+ "url": link_url
39
+ }
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "buttons": [
47
+ {
48
+ "textButton": {
49
+ "text": "ラインチャットを開く",
50
+ "onClick": {
51
+ "openLink": {
52
+ "url": "https://chat.line.biz/U2df77fd63804c72346b4e50c0096572e/chat/Ua13ef47afc077917275658a44019e072"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "buttons": [
61
+ {
62
+ "textButton": {
63
+ "text": "プロンプト修正",
64
+ "onClick": {
65
+ "openLink": {
66
+ "url": "https://kenken999-php.hf.space/prompts_list.php"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "buttons": [
75
+ {
76
+ "textButton": {
77
+ "text": "Q&A検証正しい物だけにチェック",
78
+ "onClick": {
79
+ "openLink": {
80
+ "url": "https://kenken999-php.hf.space/zendesk__dataszz_list.php?qs=500%E5%86%86"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "buttons": [
89
+ {
90
+ "textButton": {
91
+ "text": "データ確認チャット 反映されているか確認",
92
+ "onClick": {
93
+ "openLink": {
94
+ "url": "https://kenken999-nodex-n8n-domain.hf.space/webhook/6264497c-6231-4023-abef-82b86f8e298b/chat"
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "buttons": [
103
+ {
104
+ "textButton": {
105
+ "text": "WEBボットカスタマーサポートテスト",
106
+ "onClick": {
107
+ "openLink": {
108
+ "url": "https://kenken999-php.hf.space/main_list.php?page=mainpage"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ ]
114
+ },
115
+ {
116
+ "buttons": [
117
+ {
118
+ "textButton": {
119
+ "text": "HUBスポットチャットテスト",
120
+ "onClick": {
121
+ "openLink": {
122
+ "url": "https://kenken999-gradio-fastapi-statichfspace-46277896.hubspotpagebuilder.com/workflow"
123
+ }
124
+ }
125
+ }
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "buttons": [
131
+ {
132
+ "textButton": {
133
+ "text": "ダイヤモンドデータ確認 EVAのデータも登録し予測検索用にベクトル化する",
134
+ "onClick": {
135
+ "openLink": {
136
+ "url": "https://kenken999-php.hf.space/diamondprice_list.php"
137
+ }
138
+ }
139
+ }
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "buttons": [
145
+ {
146
+ "textButton": {
147
+ "text": "ワークフロー修正",
148
+ "onClick": {
149
+ "openLink": {
150
+ "url": "https://kenken999-nodex-n8n-domain.hf.space/workflow/hArXsWSx9ZrvUnvT"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ "buttons": [
159
+ {
160
+ "textButton": {
161
+ "text": "全体行程マインドマップ",
162
+ "onClick": {
163
+ "openLink": {
164
+ "url": "https://www.mindmeister.com/3342966040?e=turtle&new=1#"
165
+ }
166
+ }
167
+ }
168
+ }
169
+ ]
170
+ },
171
+
172
+ ]
173
+ }
174
+ ]
175
+ }
176
+ ]
177
+ }
178
+
179
+
180
+ response = requests.post(webhook_url, headers=headers, data=json.dumps(card_message))
181
+
182
+ if response.status_code == 200:
183
+ print("Message posted successfully.")
184
+ else:
185
+ print(f"Failed to post message: {response.status_code}, {response.text}")
186
+ #
187
+ response_data = response.json()
188
+ thread_name = response_data['thread']['name']
189
+ return thread_name
190
+
191
+ def send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name):
192
+ headers = {
193
+ 'Content-Type': 'application/json; charset=UTF-8'
194
+ }
195
+
196
+ subtitle = convert_newlines_to_google_chat_format(subtitle)
197
+
198
+ card_message = {
199
+ "cards": [
200
+ {
201
+ "header": {
202
+ "title": title,
203
+ },
204
+ "sections": [
205
+ {
206
+ "widgets": [
207
+ {
208
+ "textParagraph": {
209
+ "text": subtitle
210
+ }
211
+ },
212
+ {
213
+ "textParagraph": {
214
+ "text": "<b>{}</b>".format(link_text)
215
+ }
216
+ },
217
+ {
218
+ "buttons": [
219
+ {
220
+ "textButton": {
221
+ "text": "Open Link",
222
+ "onClick": {
223
+ "openLink": {
224
+ "url": link_url
225
+ }
226
+ }
227
+ }
228
+ }
229
+ ]
230
+ },
231
+ ]
232
+ }
233
+ ]
234
+ }
235
+ ],
236
+ "thread": {
237
+ "name":thread_name
238
+ }
239
+ }
240
+
241
+ #https://chat.googleapis.com/v1/spaces/AAAAv_S3Bco/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=D635e0eoj7MdO8HV6Ufs1HUZdNiDdz-Eo3Td3OqAFKI&messageReplyOption=REPLY_MESSAGE_OR_FAIL
242
+ response = requests.post(webhook_url+"&messageReplyOption=REPLY_MESSAGE_OR_FAIL", headers=headers, data=json.dumps(card_message))
243
+
244
+ if response.status_code == 200:
245
+ print("Message posted successfully.")
246
+ else:
247
+ print(f"Failed to post message: {response.status_code}, {response.text}")
248
+
249
+ response_data = response.json()
250
+ thread_name = response_data['thread']['name']
251
+ return thread_name