subashpoudel commited on
Commit
508df21
·
1 Parent(s): f9a9c2a

Updated the router to business interaction

Browse files
Files changed (1) hide show
  1. main.py +9 -7
main.py CHANGED
@@ -5,7 +5,9 @@ from my_agent.agent import build_graph
5
  import pandas as pd
6
  from typing import Optional , List
7
  from my_agent.utils.initial_interaction import IntroductionChatbot
8
- from my_agent.utils.business_interaction import BusinessInteractionChatbot2
 
 
9
 
10
  from my_agent.utils.utils import encode_image_to_base64 , generate_final_story, generate_image
11
 
@@ -16,10 +18,9 @@ import json
16
 
17
  app = FastAPI()
18
  introduction_chatbot = IntroductionChatbot()
19
- interaction_chatbot = BusinessInteractionChatbot2()
20
  graph = build_graph()
21
 
22
-
23
  stored_data={}
24
 
25
  class UserMessage(BaseModel):
@@ -33,15 +34,16 @@ def business_introduction_chat(msg: UserMessage):
33
  return {"response": response, "business_details": details, "complete": True}
34
  return {"response": response, "complete": False}
35
 
 
 
36
  @app.post("/business-interaction2")
37
- def business_interaction_chat(message: str):
38
- stored_data ={}
39
- stored_data['business_details']={}
40
- response = interaction_chatbot.chat(message , stored_data["business_details"])
41
  return {'response': response}
42
 
43
 
44
 
 
45
  @app.post("/brainstrom")
46
  def brainstroming_endpoint(
47
  query: List[str], # sent as JSON body
 
5
  import pandas as pd
6
  from typing import Optional , List
7
  from my_agent.utils.initial_interaction import IntroductionChatbot
8
+ from my_agent.utils.business_interaction import BusinessInteractionChatbot
9
+ # from my_agent.utils.check import BusinessInteractionChatbot
10
+
11
 
12
  from my_agent.utils.utils import encode_image_to_base64 , generate_final_story, generate_image
13
 
 
18
 
19
  app = FastAPI()
20
  introduction_chatbot = IntroductionChatbot()
21
+ interaction_chatbot2 = BusinessInteractionChatbot()
22
  graph = build_graph()
23
 
 
24
  stored_data={}
25
 
26
  class UserMessage(BaseModel):
 
34
  return {"response": response, "business_details": details, "complete": True}
35
  return {"response": response, "complete": False}
36
 
37
+
38
+
39
  @app.post("/business-interaction2")
40
+ def business_interaction_chat(interaction: str):
41
+ response = interaction_chatbot2.chat(interaction)
 
 
42
  return {'response': response}
43
 
44
 
45
 
46
+
47
  @app.post("/brainstrom")
48
  def brainstroming_endpoint(
49
  query: List[str], # sent as JSON body