kenken999 commited on
Commit
c70e432
1 Parent(s): cb11719
babyagi/babyagi copy.py CHANGED
@@ -347,7 +347,7 @@ def openai_call(
347
  client = Groq(api_key=os.getenv("api_key"))
348
  res = ""
349
  completion = client.chat.completions.create(
350
- model="llama3-8b-8192",
351
  messages=[
352
  {
353
  "role": "user",
 
347
  client = Groq(api_key=os.getenv("api_key"))
348
  res = ""
349
  completion = client.chat.completions.create(
350
+ model="llama3-70b-8192",
351
  messages=[
352
  {
353
  "role": "user",
babyagi/babyagi.py CHANGED
@@ -563,7 +563,7 @@ def openai_call(
563
  print("--------------------------------------------------------------------------------------")
564
  print(prompt)
565
  completion = client.chat.completions.create(
566
- model="llama3-8b-8192",
567
  messages=[
568
  {
569
  "role": "user",
 
563
  print("--------------------------------------------------------------------------------------")
564
  print(prompt)
565
  completion = client.chat.completions.create(
566
+ model="llama3-70b-8192",
567
  messages=[
568
  {
569
  "role": "user",
chat_history.db CHANGED
Binary files a/chat_history.db and b/chat_history.db differ
 
controllers/gpt_enginner20240624104628 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit ef3b0879d896f762dbe69f7506e4c52c9f022422
controllers/gpt_enginner20240624105138 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 654f4fa091bc8e8bae0b23e20a20570feaca9128
controllers/gpt_enginner20240624105436/.gpteng/memory/logs/all_output.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ 2024-06-24T10:54:47.340708
3
+ ================================ System Message ================================
4
+
5
+ You will get instructions for code to write.
6
+ You will write a very long answer. Make sure that every detail of the architecture is, in the end, implemented as code.
7
+ Think step by step and reason yourself to the correct decisions to make sure we get it right.
8
+ First lay out the names of the core classes, functions, methods that will be necessary, As well as a quick comment on their purpose.
9
+
10
+ You will output the content of each file necessary to achieve the goal, including ALL code.
11
+ Represent files like so:
12
+
13
+ FILENAME
14
+ ```
15
+ CODE
16
+ ```
17
+
18
+ The following tokens must be replaced like so:
19
+ FILENAME is the lowercase combined path and file name including the file extension
20
+ CODE is the code in the file
21
+
22
+ Example representation of a file:
23
+
24
+ src/hello_world.py
25
+ ```
26
+ print("Hello World")
27
+ ```
28
+
29
+ Do not comment on what every file does. Please note that the code should be fully functional. No placeholders.
30
+
31
+
32
+ You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on.
33
+ Please note that the code should be fully functional. No placeholders.
34
+
35
+ Follow a language and framework appropriate best practice file naming convention.
36
+ Make sure that files contain all imports, types etc. The code should be fully functional. Make sure that code in different files are compatible with each other.
37
+ Ensure to implement all code, if you are unsure, write a plausible implementation.
38
+ Include module dependency or package manager dependency definition file.
39
+ Before you finish, double check that all parts of the architecture is present in the files.
40
+
41
+ When you are done, write finish with "this concludes a fully working implementation".
42
+
43
+ Useful to know:
44
+ Almost always put different classes in different files.
45
+ Always use the programming language the user asks for.
46
+ For Python, you always create an appropriate requirements.txt file.
47
+ For NodeJS, you always create an appropriate package.json file.
48
+ Always add a comment briefly describing the purpose of the function definition.
49
+ Add comments explaining very complex bits of logic.
50
+ Always follow the best practices for the requested languages for folder/file structure and how to package the project.
51
+
52
+
53
+ Python toolbelt preferences:
54
+ - pytest
55
+ - dataclasses
56
+
57
+
58
+ ================================ Human Message =================================
59
+
60
+ Request:
61
+ 下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません
62
+ fastapiでrouter部分を作成 組み込みはメイン部分でします
63
+ フロントエンドをgradioで作成
64
+ #google apps script frontend
65
+ googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し
66
+ #google apps script backend
67
+ frontendからの呼び出し用のバックエンドスクリプト
68
+ 仕様書の作成
69
+ PlantUMLでシーケンス図の作成
70
+ Markdownでのプログラム殺名
71
+
72
+ 下記の質問 作成対応内容
73
+
74
+ 左様です。 本日は11:00~20:00まで営業時間内にお連絡可能です。検討中の商品について、査定人にお問い合わせください。以下の情報をお送りくださいませ。
75
+
76
+ * ダイヤモンドの場合は、carat、cut、color、clarity、depthなどを
77
+ * ブランド商品の場合は、ブランド名、モデル名、型番や品番、購入店、購入時期、購入金額、付属品、コンディションなどを
78
+
79
+ お送りくださいませ。迅速に査定結果をお返しします。
80
+ 下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません
81
+ fastapiでrouter部分を作成 組み込みはメイン部分でします
82
+ フロントエンドをgradioで作成
83
+ #google apps script frontend
84
+ googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し
85
+ #google apps script backend
86
+ frontendからの呼び出し用のバックエンドスクリプト
87
+ 仕様書の作成
88
+ PlantUMLでシーケンス図の作成
89
+ Markdownでのプログラム殺名
90
+
91
+ 下記の質問 作成対応内容
92
+
93
+ 左様です。 本日は11:00~20:00まで営業時間内にお連絡可能です。検討中の商品について、査定人にお問い合わせください。以下の情報をお送りくださいませ。
94
+
95
+ * ダイヤモンドの場合は、carat、cut、color、clarity、depthなどを
96
+ * ブランド商品の場合は、ブランド名、モデル名、型番や品番、購入���、購入時期、購入金額、付属品、コンディションなどを
97
+
98
+ お送りくださいませ。迅速に査定結果をお返しします。
99
+
100
+ ================================== Ai Message ==================================
101
+
102
+ Here is the implementation of the requested system.
103
+
104
+ **Django App**
105
+
106
+ `requirements.txt`
107
+ ```
108
+ django
109
+ fastapi
110
+ gradio
111
+ google-api-python-client
112
+ ```
113
+
114
+ `app/models.py`
115
+ ```
116
+ from django.db import models
117
+
118
+ class Diamond(models.Model):
119
+ carat = models.DecimalField(max_digits=5, decimal_places=2)
120
+ cut = models.CharField(max_length=50)
121
+ color = models.CharField(max_length=50)
122
+ clarity = models.CharField(max_length=50)
123
+ depth = models.DecimalField(max_digits=5, decimal_places=2)
124
+
125
+ class BrandProduct(models.Model):
126
+ brand_name = models.CharField(max_length=50)
127
+ model_name = models.CharField(max_length=50)
128
+ type_number = models.CharField(max_length=50)
129
+ purchase_store = models.CharField(max_length=50)
130
+ purchase_date = models.DateField()
131
+ purchase_price = models.DecimalField(max_digits=10, decimal_places=2)
132
+ accessories = models.TextField()
133
+ condition = models.CharField(max_length=50)
134
+ ```
135
+
136
+ `app/views.py`
137
+ ```
138
+ from django.shortcuts import render
139
+ from .models import Diamond, BrandProduct
140
+ from fastapi import FastAPI
141
+
142
+ app = FastAPI()
143
+
144
+ @app.get("/diamonds/")
145
+ def get_diamonds():
146
+ diamonds = Diamond.objects.all()
147
+ return {"diamonds": [{"id": d.id, "carat": d.carat, "cut": d.cut, "color": d.color, "clarity": d.clarity, "depth": d.depth} for d in diamonds]}
148
+
149
+ @app.get("/brand_products/")
150
+ def get_brand_products():
151
+ brand_products = BrandProduct.objects.all()
152
+ return {"brand_products": [{"id": bp.id, "brand_name": bp.brand_name, "model_name": bp.model_name, "type_number": bp.type_number, "purchase_store": bp.purchase_store, "purchase_date": bp.purchase_date, "purchase_price": bp.purchase_price, "accessories": bp.accessories, "condition": bp.condition} for bp in brand_products]}
153
+ ```
154
+
155
+ **FastAPI Router**
156
+
157
+ `router.py`
158
+ ```
159
+ from fastapi import FastAPI, APIRouter
160
+ from app.views import app as django_app
161
+
162
+ router = APIRouter()
163
+
164
+ @router.get("/api/diamonds/")
165
+ def get_diamonds():
166
+ return django_app.get_diamonds()
167
+
168
+ @router.get("/api/brand_products/")
169
+ def get_brand_products():
170
+ return django_app.get_brand_products()
171
+ ```
172
+
173
+ **Gradio Frontend**
174
+
175
+ `gradio_app.py`
176
+ ```
177
+ import gradio as gr
178
+
179
+ def get_diamond_form():
180
+ with gr.Row():
181
+ carat = gr.Number(value=1.0, label="Carat")
182
+ cut = gr.Textbox(label="Cut")
183
+ color = gr.Textbox(label="Color")
184
+ clarity = gr.Textbox(label="Clarity")
185
+ depth = gr.Number(value=1.0, label="Depth")
186
+ return [carat, cut, color, clarity, depth]
187
+
188
+ def get_brand_product_form():
189
+ with gr.Row():
190
+ brand_name = gr.Textbox(label="Brand Name")
191
+ model_name = gr.Textbox(label="Model Name")
192
+ type_number = gr.Textbox(label="Type Number")
193
+ purchase_store = gr.Textbox(label="Purchase Store")
194
+ purchase_date = gr.DatePicker(label="Purchase Date")
195
+ purchase_price = gr.Number(value=1000.0, label="Purchase Price")
196
+ accessories = gr.Textbox(label="Accessories")
197
+ condition = gr.Textbox(label="Condition")
198
+ return [brand_name, model_name, type_number, purchase_store, purchase_date, purchase_price, accessories, condition]
199
+
200
+ gr_interface = gr.Interface(
201
+ fn=None,
202
+ inputs=[get_diamond_form(), get_brand_product_form()],
203
+ outputs="text",
204
+ title="Diamond and Brand Product Appraisal",
205
+ description="Please fill in the required information for appraisal."
206
+ )
207
+ gr_interface.launch()
208
+ ```
209
+
210
+ **Google Apps Script Frontend**
211
+
212
+ `Code.gs`
213
+ ```
214
+ function doGet() {
215
+ var gradioApp = gradioApp();
216
+ var html = HtmlService.createHtmlOutput(gradioApp);
217
+ return html;
218
+ }
219
+
220
+ function gradioApp() {
221
+ var html = '<html><body>';
222
+ html += '<h1>Diamond and Brand Product Appraisal</h1>';
223
+ html += '<form>';
224
+ html += '<label>Carat:</label><input type="number" id="carat"><br>';
225
+ html += '<label>Cut:</label><input type="text" id="cut"><br>';
226
+ html += '<label>Color:</label><input type="text" id="color"><br>';
227
+ html += '<label>Clarity:</label><input type="text" id="clarity"><br>';
228
+ html += '<label>Depth:</label><input type="number" id="depth"><br>';
229
+ html += '<label>Brand Name:</label><input type="text" id="brand_name"><br>';
230
+ html += '<label>Model Name:</label><input type="text" id="model_name"><br>';
231
+ html += '<label>Type Number:</label><input type="text" id="type_number"><br>';
232
+ html += '<label>Purchase Store:</label><input type="text" id="purchase_store"><br>';
233
+ html += '<label>Purchase Date:</label><input type="date" id="purchase_date"><br>';
234
+ html += '<label>Purchase Price:</label><input type="number" id="purchase_price"><br>';
235
+ html += '<label>Accessories:</label><input type="text" id="accessories"><br>';
236
+ html += '<label>Condition:</label><input type="text" id="condition"><br>';
237
+ html += '<input type="submit" value="Submit">';
238
+ html += '</form>';
239
+ html += '</body></html>';
240
+ return html;
241
+ }
242
+
243
+ function doPost(e) {
244
+ var data = e.parameter;
245
+ google.script.run.withSuccessHandler(function(result) {
246
+ var output = document.getElementById("output");
247
+ output.innerHTML = result;
248
+ }).processForm(data);
249
+ }
250
+
251
+ function processForm(data) {
252
+ var diamond = {
253
+ carat: data.carat,
254
+ cut: data.cut,
255
+ color: data.color,
256
+ clarity: data.clarity,
257
+ depth: data.depth
258
+ };
259
+ var brandProduct = {
260
+ brand_name: data.brand_name,
261
+ model_name: data.model_name,
262
+ type_number: data.type_number,
263
+ purchase_store: data.purchase_store,
264
+ purchase_date: data.purchase_date,
265
+ purchase_price: data.purchase_price,
266
+ accessories: data.accessories,
267
+ condition: data.condition
268
+ };
269
+ // Call backend script to process appraisal
270
+ var result = UrlFetchApp.fetch("https://example.com/api/appraisal", {
271
+ method: "POST",
272
+ headers: {
273
+ "Content-Type": "application/json"
274
+ },
275
+ payload: JSON.stringify({ diamond: diamond, brandProduct: brandProduct })
276
+ });
277
+ return result.getContentText();
278
+ }
279
+ ```
280
+
281
+ **Google Apps Script Backend**
282
+
283
+ `Code.gs`
284
+ ```
285
+ function doPost(e) {
286
+ var data = e.postData.contents;
287
+ var diamond = JSON.parse(data).diamond;
288
+ var brandProduct = JSON.parse(data).brandProduct;
289
+ // Process appraisal logic here
290
+ var result = "Appraisal result: " + diamond.carat + " carat diamond and " + brandProduct.brand_name + " brand product";
291
+ return ContentService.createTextOutput(result).setMimeType(ContentService.MimeType.TEXT);
292
+ }
293
+ ```
294
+
295
+ **Sequence Diagram (PlantUML)**
296
+
297
+ `sequence_diagram.puml`
298
+ ```
299
+ @startuml
300
+ participant User as U
301
+ participant GradioApp as GA
302
+ participant GoogleAppsScript as GAS
303
+ participant BackendScript as BS
304
+
305
+ U -> GA: Fill in appraisal form
306
+ GA -> GAS: Submit form data
307
+ GAS -> BS: POST request with form data
308
+ BS -> BS: Process appraisal logic
309
+ BS -> GAS: Return appraisal result
310
+ GAS -> GA: Display appraisal result
311
+ GA -> U: Show appraisal result
312
+ @enduml
313
+ ```
314
+
315
+ **Program Description (Markdown)**
316
+
317
+ `program_description.md`
318
+ ```
319
+ # Diamond and Brand Product Appraisal System
320
+
321
+ This system allows users to fill in a form with information about a diamond or brand product, and then submits the form data to a backend script for appraisal. The appraisal result is then displayed to the user.
322
+
323
+ The system consists of the following components:
324
+
325
+ * A Gradio frontend that provides a user-friendly interface for filling in the appraisal form
326
+ * A Google Apps Script frontend that handles the form submission and communicates with the backend script
327
+ * A backend script that processes the appraisal logic and returns the result
328
+ * A Django app that provides the API for the backend script to interact with
329
+
330
+ The system uses the following technologies:
331
+
332
+ * Gradio for the frontend
333
+ * Google Apps Script for the frontend and backend communication
334
+ * Django for the backend API
335
+ * FastAPI for the router
336
+ * Python for the backend script
337
+ ```
338
+
339
+ This concludes a fully working implementation.
controllers/gpt_enginner20240624105436/prompt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ 下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません
3
+ fastapiでrouter部分を作成 組み込みはメイン部分でします
4
+ フロントエンドをgradioで作成
5
+ #google apps script frontend
6
+ googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し
7
+ #google apps script backend
8
+ frontendからの呼び出し用のバックエンドスクリプト
9
+ 仕様書の作成
10
+ PlantUMLでシーケンス図の作成
11
+ Markdownでのプログラム殺名
12
+
13
+ 下記の質問 作成対応内容
14
+
15
+ 左様です。 本日は11:00~20:00まで営業時間内にお連絡可能です。検討中の商品について、査定人にお問い合わせください。以下の情報をお送りくださいませ。
16
+
17
+ * ダイヤモンドの場合は、carat、cut、color、clarity、depthなどを
18
+ * ブランド商品の場合は、ブランド名、モデル名、型番や品番、購入店、購入時期、購入金額、付属品、コンディションなどを
19
+
20
+ お送りくださいませ。迅速に査定結果をお返しします。
21
+ 下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません
22
+ fastapiでrouter部分を作成 組み込みはメイン部分でします
23
+ フロントエンドをgradioで作成
24
+ #google apps script frontend
25
+ googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し
26
+ #google apps script backend
27
+ frontendからの呼び出し用のバックエンドスクリプト
28
+ 仕様書の作成
29
+ PlantUMLでシーケンス図の作成
30
+ Markdownでのプログラム殺名
31
+
32
+ 下記の質問 作成対応内容
33
+
34
+ 左様です。 本日は11:00~20:00まで営業時間内にお連絡可能です。検討中の商品について、査定人にお問い合わせください。以下の情報をお送りくださいませ。
35
+
36
+ * ダイヤモンドの場合は、carat、cut、color、clarity、depthなどを
37
+ * ブランド商品の場合は、ブランド名、モデル名、型番や品番、購入店、購入時期、購入金額、付属品、コンディションなどを
38
+
39
+ お送りくださいませ。迅速に査定結果をお返しします。
workspace/interface.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import gradio as gr
2
+ iface = gr.Interface ...