tomemojo/service_v2
0
1import openai2import os3import streamlit as st4 5 6API_TOKEN = os.environ["API_TOKEN"]7def chatbot(input,systemInstructions):8 9 openai.api_key = API_TOKEN10 11 if input:12 messages = [13 {"role": "system", "content": systemInstructions},14 ]15 16 messages.append({"role": "user", "content": input})17 18 chat = openai.ChatCompletion.create(19 model="gpt-3.5-turbo", 20 messages=messages,21 temperature=0.2,22 top_p=0.3,23 n=1,24 max_tokens = 1024,25 presence_penalty = 0.5,26 frequency_penalty = 0.5,27 #logit_bias28 )29 reply = chat.choices[0].message.content30 messages.append({"role": "assistant", "content": reply})31 return reply32 33 34def emojobot(input):35 36 #PHNknowledge = pd.read_csv('Layer1structureKnowledge.csv')37 #generatedKnowledge = PHNknowledge['Knowledge'].values.tolist()38 #random.shuffle(generatedKnowledge)39 #generatedKnowledgeCorpus = ' '.join(generatedKnowledge[:75])40 41 generatedKnowledgeCorpus = """42 How far can I go on a single charge? The range depends on each bike model and several other factors such as the weight of the rider, the type grade of he terrain, wind speed and direction, tire pressure, temperature, cargo, etc. The average range on a fully charged battery is between 30 and 65 Miles. To get the best possible range the rider must pedal along with the P.A.S. Riding on throttle alone will considerably reduce the milage.43What's maximum speed? All models have a limited speed of 20 MPH on pedal assist to comply with Class 2 classification, meaning they can be ridden on most public roads and the rider does not require any special license.44How long does it take to fully charge a depleted battery? Typical battery full charging time is 5 hrs.45Do I need a special license or register my vehicle with the DMV? License is not required at this time by law, as long as the ebike is Class1 or Class 2. Insurance is optional but not required by law.46What's the maximum weight capacity? Payload varies depending on the model. Typical maximum payload range on trikes goes from 250 to 330 Lbs, this includes any additional cargo.47What kind of warranty do your trikes have? Each vehicle has a limited warranty for 1 year from the time of the purchase. Consult your warranty terms in your user manual for more details.48What happens if my vehicle requires service or a repair while it is under the warranty? Trikes require similar maintenance than regular bicycles such as chain tension adjustment, lubrication, screws and nuts re-torque etc. However there are certain components that given the case may require directly to the repair shop.49I ordered a completed trike. how is it packed? In most cases, the bike comes with one large box already preassembled, however you would need to install some components such as front wheel, fenders, handlebar and lights. Trikes are usually shipped in 3 boxes and require full assembly.50How long will the order be shipped out? It usually takes from 3-5 days after placing your order.51Where do you ship? We ship inside the continental USA. Shipping to Canada and Mexico would be possible but extra shipping and customs fees would be involved and need to be covered by the purchaser.52Can I stop by your warehouse and pick up my order? Yes. Let us know 48 hrs prior to your planned visit and we will make sure to have your order ready. We also provide fully assembly service with additional cost.53Do you offer any financial help for someone with poor credit? We do not offer any financial help or financing options for customers with poor credit. However, we give extra discount on our demo trikes.54 55The information of CADDY PRO:56MODEL CADDY PRO57Motor type DC Brushless58Motor power 500W59Rated Voltage 48V60Maximum speed 20MPH61Battery range 35Miles62Battery charging time 4 - 6hours63Battery type Lithium-Ion64Battery capacity 48V/15.6Ah65Dimensions (inch) 74 L X 31 W X 46 H66Frame Aluminum 606167Maximum user weight 330lbs68Vehicle weight 90 lbs(with battery)69Transmission type 7-Speed70Front brake type Hydraulic Disc71Rear brake type Hydraulic Disc72Tire size 20 x 4.0" rear / 24 x 4.0" front73Stand over height 18in74Seat to ground height minimum 29in and maximum 37in75Front basket size 14.5 x 10.5 x 5.0 in 76Rear basket size 21 x 17.5 x 10 in77Handlebar height Min: 41in / Max: 47in 78Motor brand: Bafang 79Battery Brand: XNW ( Brand with quality assurance )80 81Information of CADDY 82Motor type DC Brushless83Motor power 500W84Rated Voltage 48 V85Maximum speed 20 MPH86Battery range 35 Miles87Battery charging time 4 - 6hours88Battery type Lithium-Ion89Battery capacity 48V/15.6Ah90Dimensions (inch) 74 L X 31 W X 46 H91Frame Aluminum 606192Max. user weight 330 lbs93Vehicle weight 90 lbs (with battery)94Transmission type 7-Speed95Front brake type Mechanical Disc96Rear brake type Mechanical Disc97Tire size 20 x 4.0" rear / 24 x 4.0" front98Stand over height 18in99Seat to ground Min: 29in / Max: 37in100Front basket 14.5 x 10.5 x 5.0 in 101Rear basket 21 x 17.5 x 10 in102Handlebar height Min: 41in / Max: 47in 103Motor brand: Bafang 104Battery Brand: XNW ( Brand with quality assurance )105Seat to ground Min: 29in / Max: 37in106Front basket 14.5 x 10.5 x 5.0 in 107Rear basket 21 x 17.5 x 10 in108 109Information of BISON PRO110Motor type DC Brushless111Motor power 750W112Rated Voltage 48 V113Maximum speed on PAS 20 MPH114Battery range 45 Miles115Battery charging time 4 - 6hours116Battery type Lithium-Ion117Battery capacity 48V/23.2Ah118Dimensions (inch) 74 L X 31 W X 46 H119Frame Aluminum alloy120Max. user weight 330 lbs121Vehicle weight 123 lbs (with battery)122Transmission type 7-Speed123Front brake type Hydraulic Disc124Rear brake type Hydraulic Disc125Tire size 20 x 4.0" rear / 24 x 4.0" front126Stand over height 15in127Seat to ground Min: 27in/Max: 36in128Front basket 14.5 x 10.5 x 4.5 in 129Rear basket 21 x 17.5 x 7.5 in130Handlebar height Min: 41in / Max: 46in 131Motor brand: Bafang 132Battery Brand: XNW ( Brand with quality assurance )133 134Information of BISON S135Motor type DC Brushless136Motor power 500W137Rated Voltage 48 V138Maximum speed on PAS 20 MPH139Battery range 30 Miles140Battery charging time 4 - 6hours141Battery type Lithium-Ion142Battery capacity 48V/11.6Ah143Dimensions (inch) 70L X 28W X 40H144Frame Aluminum 6061145Max. user weight 250 lbs146Vehicle weight 86 lbs (with battery)147Transmission type 7-Speed148Front brake type Mechanical Disc149Rear brake type Mechanical Disc150Tire size 20 x 2.5"151Stand over height 14.5in152Seat to ground Min: 27in / Max: 36in153Front basket 14.5 x 10.5 x 4.5 in 154Rear basket 21 x 17.5 x 7.5 in155Handlebar height Min: 36in / Max: 42in 156Motor brand: Bafang 157Battery Brand: XNW ( Brand with quality assurance )158 159Assembly Service:160When you purchase an electric trike from our company, we provide a convenient and hassle-free expert full assembly service, available for customers across all States. Our experienced technicians will professionally assemble your electric trike, ensuring that all components are properly installed, adjusted, and tested before it is shipped to you.161We take care of the shipping as well by sending your fully assembled electric trike on a pallet. This method of shipping ensures that your trike arrives safely and securely at your doorstep, without any damage or need for further assembly. The shipping is absolutely free of charge.162Once you receive your electric trike, you can immediately start enjoying your ride, knowing that it has been expertly assembled and tested by our team. This service saves you time and effort, allowing you to focus on getting the most out of your new electric trike.163Please let me know if you have any other questions or concerns about our expert full assembly service, and I'd be more than happy to assist you.164 165Warranty166To make a warranty claim, always keep the vehicle model, date of purchase, vehicle serial number, and information from the retailer where you purchased the vehicle handy.167 168The warranty is limited to the terms listed below:169 170Frame, Suspension, Motor: 1 year for parts. 171Controller, Charger: 1 year for parts.172Battery: Warranty on the battery starts the date of purchase of the vehicle as new. The battery is sealed and cannot be opened or fixed. The battery should not have a percentage of nominal charge retention of 60% or less. Misuse of the battery, negligence or attempt to open or repair it will void the warranty.173General: The bicycle is backed up by a 1-year main warranty, certain components listed on this chart or consumables may be subject to a different period of coverage or not included in this warranty.174Consumables: Components subject to wear are not covered by the warranty: Tires, inner tubes, brake lines, brake pads, basket, wheel lining tape, light bulbs, LEDS, fuses, etc.175If the warranty is void for any reason the customer shall bear any repair or replacement costs resulting from vehicle misuse, negligence or abuse.176Always follow care and preventive maintenance procedures.177Always keep receipts from any services performed to the vehicle by an authorized distributor or service center.178 179The warranty will be voided by any of the following circumstances:180Failure to follow all directions or recommendations listed in the user manual.181Cycling collision, accidents or vehicle damage caused by careless parking 182Acts in violation of laws 183Failure to register your ebike184DIY repairs on electronics185Abusive use of the bicycle in off-road terrain, mud, snow, water, sand, gravel and water186If the bicycle is used as rental unit 187Damages caused by natural disasters, such as earthquakes, lightning, fire, flooding and other hazards.188Rust and/or paint fading caused by heavy exposure to rain, hail, snow or direct sunlight for prolonged periods of time.189Overloading beyond the recommended capacity .190Damages caused by nails, needles, broken glass , debris, sharp rocks or other foreign objects.191Use of the vehicle for stunts, jumping from ramps, stairs, or elevated ramps.192If vehicle is used in competitions or racing.193Modifications made to the motor, electrical system, suspension frame, and battery.194Use of components not approved by the manufacturer.195Damages resulted from improper care and handling.196Due to the nature of the product some components must be exclusive from the manufacturer such as but not limited to the battery, motor, main gauge cluster, controllers, Led headlights, brake drums or disc rotors and pads etc. Other components such as tires, tubes, saddle, racks, baskets may be used from market-ready or compatible products previous approval from the retailer or manufacturer.197 198For any questions about your warranty or to make any claims please contact EMOJO bikes at:199 200Phone: 949.878.1518201Email: info@emojobike.com or support@emojobike.com202Address: 13845 Alton Parkway, B, Irvine, CA92618 USA203 204Return205We have a 30-day return policy, which means you have 30 days after receiving your EMOJO BIKE to request a return.206 207Returns are not allowed after 30 days of the delivery date.208 209To be eligible for a return, your item must be in the same condition that you received it, unworn, unused or the ebike must have less than ten (10) miles on the odometer, and must include all items that were inside the box (charger, keys, hardware, etc.), and in its original packaging. You will also need the receipt or proof of purchase.210 211 212Damages and issues213Please inspect your order upon reception and contact us immediately if the item is defective, damaged, or if you receive the wrong item, so that we can evaluate the issue and make it right for you.214To start a return, you can contact us at support@emojobike.com. If your return is accepted, we will send you a return shipping label, as well as instructions on how and where to send your package. Items sent back to us without first requesting a return will not be accepted. EMOJO bike is not responsible for the shipping cost of the packages returned by the customers themselves.215You can always contact us for any return question at support@emojobike.com216 217NON-RETURNABLE ITEMS INCLUDE, BUT ARE NOT LIMITED TO:218Product from Unauthorized Resellers219Items damaged by human error220Special or custom orders221Sale items or gift cards222Giveaways or free items 223 224Shipping and Handling fee for non-quality issue return:225E-Bikes $150/pc for a return226E-Trikes $250/pc for a return227Phone Holder, charger $15/pc for a return228Front and Rear Basket $20/pc for a return229E-bike Batteries $30/pc for a return230 231Exchange for new model (Only for Non-quality related products)232This term is only for the unworn, unused, unopened package, the ebike/etrike233must have less than 10 miles on the odometer.234Within 30 days-Same model but different color $200/pc for the return235Within 30 days-Different model $200/pc for the return plus the price difference236Over 30 days Exchange is no longer possible237 238For returned items or items for exchange, we will need 3-6 business days upon receiving your item(s) to process the solution.239After this period, we will refund within 3 business days.240We will notify you once we’ve received and inspected your return, and let you know if the refund has been approved or not. If approved, the refund will be automatically processed on your original payment method. Please note that it may take some time for your bank or credit card company to process and post the refund.241"""242 243 generatedKnowledgeCorpus = generatedKnowledgeCorpus.replace("\n","")244 systemInstructions = "You are a customer service representative. Strictly use the following text and respond to user. '\245 If no answer is found in the following text start with 'ANSWER BASED ON EXTERNAL SEARCH'"246 systemInstructions = systemInstructions + '\n\n' + generatedKnowledgeCorpus247 248 response = chatbot(input, systemInstructions)249 250 return response251 252 253st.title('Demo')254 255t.subheader("Enter the text you'd like to analyze.")256text = st.text_input('Enter text') #text is stored in this variable257st.write("Sentiment of Text: ")258st.write(emojobot(text))259 