mrmamon commited on
Commit
d3183e4
·
verified ·
1 Parent(s): 7efae22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -101,7 +101,7 @@ class AnswerValidator:
101
  class FirestoreLogger:
102
  outgoing_edges = 1 # Number of output edges
103
 
104
- def __init__(self, collection_name='interaction_logs', bucket_name='chatwithme-35c9d'):
105
  # Load service account credentials
106
  service_account_info = json.loads(os.environ['chatwithme_services'])
107
  credentials = service_account.Credentials.from_service_account_info(service_account_info)
@@ -163,7 +163,7 @@ retriever = InMemoryEmbeddingRetriever(document_store=document_store)
163
  prompt_builder = PromptBuilder(template=prompt)
164
  generator = OpenAIGenerator(model="gpt-4o")
165
  answers_validator = AnswerValidator()
166
- logger_node = FirestoreLogger(collection_name='interaction_logs',bucket_name='chatwithme-35c9d')
167
 
168
  rag = Pipeline()
169
  rag.add_component("query_embedder", query_embedder)
@@ -233,13 +233,7 @@ def vote(data: gr.LikeData):
233
  with gr.Blocks() as demo:
234
  # Create the ChatInterface without a separate chatbot
235
  interface = gr.ChatInterface(
236
- fn=respond,
237
- examples=[
238
- "ขอข้อมูลประกันรถ",
239
- "เงื่อนไขของประกันสำหรับรถไฟฟ้า",
240
- "ประกันเดินทางต่างประเทศมีแบบไหนบ้าง",
241
- "ประกันบ้านมีแผนไหนบ้าง"
242
- ]
243
  )
244
  # Modify the chatbot within the interface
245
  interface.chatbot.placeholder = "<strong>ถามเรื่องประกัน AZ มาเลย!</strong>"
 
101
  class FirestoreLogger:
102
  outgoing_edges = 1 # Number of output edges
103
 
104
+ def __init__(self, collection_name='interaction_logs', bucket_name='chatwithme-35c9d.appspot.com'):
105
  # Load service account credentials
106
  service_account_info = json.loads(os.environ['chatwithme_services'])
107
  credentials = service_account.Credentials.from_service_account_info(service_account_info)
 
163
  prompt_builder = PromptBuilder(template=prompt)
164
  generator = OpenAIGenerator(model="gpt-4o")
165
  answers_validator = AnswerValidator()
166
+ logger_node = FirestoreLogger(collection_name='interaction_logs',bucket_name='chatwithme-35c9d.appspot.com')
167
 
168
  rag = Pipeline()
169
  rag.add_component("query_embedder", query_embedder)
 
233
  with gr.Blocks() as demo:
234
  # Create the ChatInterface without a separate chatbot
235
  interface = gr.ChatInterface(
236
+ fn=respond
 
 
 
 
 
 
237
  )
238
  # Modify the chatbot within the interface
239
  interface.chatbot.placeholder = "<strong>ถามเรื่องประกัน AZ มาเลย!</strong>"