Spaces:
Runtime error
Runtime error
Karthikeyan
commited on
Commit
•
76918d0
1
Parent(s):
905c612
Update app.py
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ history_state = gr.State()
|
|
85 |
summarizer = Summarizer()
|
86 |
sentiment = SentimentAnalyzer()
|
87 |
|
88 |
-
class
|
89 |
|
90 |
def __init__(self):
|
91 |
pass
|
@@ -148,7 +148,7 @@ class LangChain_Document_QA:
|
|
148 |
file_path = "vodafone_customer_details.json"
|
149 |
with open(file_path) as file:
|
150 |
customer_details = json.load(file)
|
151 |
-
prompt
|
152 |
response = openai.Completion.create(
|
153 |
model="text-davinci-003",
|
154 |
prompt=prompt,
|
@@ -285,5 +285,5 @@ class LangChain_Document_QA:
|
|
285 |
|
286 |
demo.title = "Vodafone Generative AI CRM ChatBot"
|
287 |
demo.launch()
|
288 |
-
|
289 |
-
|
|
|
85 |
summarizer = Summarizer()
|
86 |
sentiment = SentimentAnalyzer()
|
87 |
|
88 |
+
class Chat_Bot:
|
89 |
|
90 |
def __init__(self):
|
91 |
pass
|
|
|
148 |
file_path = "vodafone_customer_details.json"
|
149 |
with open(file_path) as file:
|
150 |
customer_details = json.load(file)
|
151 |
+
prompt += f"{history}{start_sequence}{text}{restart_sequence} if customer ask any information take it from {customer_details} and if customer say thankyou You should end the conversation with greetings."
|
152 |
response = openai.Completion.create(
|
153 |
model="text-davinci-003",
|
154 |
prompt=prompt,
|
|
|
285 |
|
286 |
demo.title = "Vodafone Generative AI CRM ChatBot"
|
287 |
demo.launch()
|
288 |
+
bot = Chat_Bot()
|
289 |
+
bot.gradio_interface()
|