Yaroslav95 commited on
Commit
0fc96a0
·
1 Parent(s): 8853f8e

update prompt

Browse files
Files changed (1) hide show
  1. app.py +60 -90
app.py CHANGED
@@ -12,115 +12,85 @@ client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
12
  script_dir = os.path.dirname(os.path.abspath(__file__))
13
 
14
  printer_1 = """
15
- # PrinterOne
16
- Product: Business Cards
17
- Surface Options:
18
- plastic:
19
- multiplier: 1.0
20
- cardboard:
21
- multiplier: 0.9
22
- wood:
23
- multiplier: 1.3
24
 
25
- Sizes:
26
- 3x3 cm: multiplier 1.0
27
- 6x6 cm: multiplier 1.8
 
 
 
28
 
29
- Finishing:
30
- gloss: multiplier 1.1
31
- matt: multiplier 1.0
 
 
32
 
33
- Label Types:
34
- permanent: multiplier 1.0
35
- repositionable: multiplier 1.15
36
- removable: multiplier 1.2
37
 
38
  Base Prices (Quantity,Price per Unit $):
39
- 25,2.0
40
- 50,1.6
41
- 100,1.0
42
- 200,0.7
43
- 500,0.36
44
- 1000,0.2
45
- 2000,0.14
46
- 5000,0.12
47
- 10000,0.09
48
- 20000,0.07
49
  """
50
 
51
  printer_2 = """
52
  # BannerLord
53
- Product: Business Cards
54
- Surface Options:
55
- plastic:
56
- multiplier: 1.0
57
- cardboard:
58
- multiplier: 0.85
59
- wood:
60
- multiplier: 1.4
61
 
62
- Sizes:
63
- 3x3 cm: multiplier 1.0
64
- 6x6 cm: multiplier 1.9
65
 
66
- Finishing:
67
- gloss: multiplier 1.15
68
- matt: multiplier 1.0
 
 
 
 
69
 
70
- Label Types:
71
- permanent: multiplier 1.0
72
- repositionable: multiplier 1.2
73
- removable: multiplier 1.25
74
 
75
  Base Prices (Quantity,Price per Unit $):
76
- 25,2.4
77
- 50,1.8
78
- 100,1.2
79
- 200,0.75
80
- 500,0.4
81
- 1000,0.22
82
- 2000,0.15
83
- 5000,0.14
84
- 10000,0.1
85
- 20000,0.075
86
  """
87
 
88
  printer_3 = """
89
  # PrintMaster
90
- Product: Business Cards
91
- Surface Options:
92
- plastic:
93
- multiplier: 1.0
94
- cardboard:
95
- multiplier: 1.1
96
- wood:
97
- multiplier: 1.25
98
 
99
  Sizes:
100
- 3x3 cm: multiplier 1.0
101
- 6x6 cm: multiplier 1.85
102
-
103
- Finishing:
104
- gloss: multiplier 1.12
105
- matt: multiplier 1.0
106
 
107
- Label Types:
108
- permanent: multiplier 1.0
109
- repositionable: multiplier 1.18
110
- removable: multiplier 1.22
111
 
112
  Base Prices (Quantity,Price per Unit $):
113
- 50,1.4
114
- 75,1.2
115
- 100,1.05
116
- 150,1.0
117
- 200,0.875
118
- 250,0.72
119
- 500,0.4
120
- 750,0.4
121
- 1000,0.35
122
- 1500,0.3
123
- 2000,0.25
124
  """
125
 
126
 
@@ -141,14 +111,14 @@ def find_best_price(request):
141
  " - Multiplying by the label type multiplier\n"
142
  "3. Do not use linear interpolation for quantities - use the nearest lower quantity pricing.\n\n"
143
  "Example:\n"
144
- "User: I want to print 600 business cards, 6x6 cm size, premium white surface, gloss finish, permanent labels\n"
145
  "Answer:\n"
146
- "PrinterOne: Total for 600: $427.80\n"
147
  "###\n"
148
  "BannerLord: Total for 600: $524.40\n"
149
  "###\n"
150
  "PrintMaster: Total for 600: $497.40\n\n"
151
- "If user haven't specified one of the parameters, just find the cheapest one, do not ask user to specify them"
152
  "Your response should display ONLY final pricing for each available option, nothing more"
153
  "The '###' symbol must separate each printer's price calculation.\n"
154
  )
@@ -250,8 +220,8 @@ iface = gr.Interface(
250
  fn=find_best_price,
251
  inputs=gr.Textbox(lines=3, placeholder="Enter what are you looking for"),
252
  outputs=[
253
- gr.Textbox(label="Result"),
254
  gr.HTML(label="Product Image"),
 
255
  ],
256
  title="Get Instant Quote",
257
  description=f"""
 
12
  script_dir = os.path.dirname(os.path.abspath(__file__))
13
 
14
  printer_1 = """
15
+ # PrintPronto
16
+ Product: Business card
 
 
 
 
 
 
 
17
 
18
+ Color:
19
+ - Black (default)
20
+ - Blue
21
+ - Brown
22
+ - Orange
23
+ - Pink
24
 
25
+ Sizes:
26
+ 3.5x2: multiplier 1.0
27
+ 2.5x2.5: multiplier 0.95
28
+ 2.125x3.375: multiplier 0.9
29
+ Custom size: This vendor doesn't support custom sizes
30
 
31
+ Material:
32
+ Standard (default): multiplier 1.0
33
+ Uncoated: multiplier 0.9
 
34
 
35
  Base Prices (Quantity,Price per Unit $):
36
+ 100, 0.23
37
+ 250, 0.2
38
+ 500, 1.9
39
+ 1000, 1.75
 
 
 
 
 
 
40
  """
41
 
42
  printer_2 = """
43
  # BannerLord
44
+ Product: Business card
 
 
 
 
 
 
 
45
 
46
+ Color:
47
+ - Black (default)
48
+ - Blue
49
 
50
+ Sizes:
51
+ 3.5x2: multiplier 1.0
52
+ 2.5x2.5: multiplier 0.95
53
+ 2.125x3.375: multiplier 0.9
54
+ 3x2: multiplier 1.5
55
+ 4x3: multiplier 1.5
56
+ Custom size: multiplier 2.0
57
 
58
+ Material:
59
+ Standard (default): multiplier 1.0
60
+ Uncoated: multiplier 0.95
 
61
 
62
  Base Prices (Quantity,Price per Unit $):
63
+ 100, 0.25
64
+ 250, 0.22
65
+ 500, 0.2
66
+ 1000, 1.85
 
 
 
 
 
 
67
  """
68
 
69
  printer_3 = """
70
  # PrintMaster
71
+ Product: Business card
72
+ Color:
73
+ - Black (default)
74
+ - Blue
75
+ - Brown
 
 
 
76
 
77
  Sizes:
78
+ 3.5x2: multiplier 1.0
79
+ 2.5x2.5: multiplier 0.95
80
+ 2.125x3.375: multiplier 0.9
81
+ 3x2: multiplier 1.5
82
+ 4x3: multiplier 1.5
83
+ Custom size: multiplier 2.0
84
 
85
+ Material:
86
+ Standard (default): multiplier 1.0
87
+ Uncoated: multiplier 0.85
 
88
 
89
  Base Prices (Quantity,Price per Unit $):
90
+ 100, 0.21
91
+ 250, 0.2
92
+ 500, 0.18
93
+ 1000, 0.17
 
 
 
 
 
 
 
94
  """
95
 
96
 
 
111
  " - Multiplying by the label type multiplier\n"
112
  "3. Do not use linear interpolation for quantities - use the nearest lower quantity pricing.\n\n"
113
  "Example:\n"
114
+ "User: I want to print 600 business cards, 6x6 cm size, \n"
115
  "Answer:\n"
116
+ "PrinterPronto: Doesn't support custom size\n"
117
  "###\n"
118
  "BannerLord: Total for 600: $524.40\n"
119
  "###\n"
120
  "PrintMaster: Total for 600: $497.40\n\n"
121
+ "If user haven't specified one of the parameters, use the default one"
122
  "Your response should display ONLY final pricing for each available option, nothing more"
123
  "The '###' symbol must separate each printer's price calculation.\n"
124
  )
 
220
  fn=find_best_price,
221
  inputs=gr.Textbox(lines=3, placeholder="Enter what are you looking for"),
222
  outputs=[
 
223
  gr.HTML(label="Product Image"),
224
+ gr.Textbox(label="AI response: text mode"),
225
  ],
226
  title="Get Instant Quote",
227
  description=f"""