Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from simpleaichat import AIChat
- import os
- #api_key = os.getenv("OPENAI_API_KEY") lub:
- api_key="sk-..."
- MODEL = "gpt-3.5-turbo"
- params = {"temperature": 0.0, "max_tokens": 300}
- system_prompt = '''
- You are helpul copywriter who helps to write product name from given imput.
- You have to extract data from input. Do not change any names.
- Write new product name starting with word "BATERIA" and use the following example:
- "input: CoreParts Battery for Samsung Mobile 7.22Wh Li-ion 3.8V 1900mAh fit for Samsung Galaxy S5 Mini SM- without Logo
- output: BATERIA SAMSUNG 7.22wH Li-Ion 3.8v 1900mAh"
- input: CoreParts Battery for Motorola Mobile 3.52Wh Li-ion 3.8V 4900mAh fit for Motorola MotoMoto G50 Maxi SM- without Logo
- output:
- '''
- ai = AIChat(
- system=system_prompt,
- model=MODEL,
- params=params,
- console=False,
- api_key=api_key)
- lista_prod = [" CoreParts Battery for Motorola Mobile 3.52Wh Li-ion 3.8V 4900mAh fit for Motorola MotoMoto G50 Maxi SM- without Logo",
- "CoreParts Battery for Xiaomi 1.52Wh Li-Li 1.33V 8301mAh fit for Xiaomi Sports X0123 SUper- without Logo" ]
- for items in lista_prod:
- response = ai(items)
- print('\n\n', response, '\n\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement