joaomorossini commited on
Commit
642b69c
·
1 Parent(s): 80ffcb0

Rename NotionAgency to ProjectManagementAgency and update demo method to custom_demo; adjust references accordingly

Browse files
Files changed (1) hide show
  1. app/demo.py +8 -8
app/demo.py CHANGED
@@ -80,15 +80,15 @@ def get_tools(file_name):
80
  load_dotenv()
81
 
82
 
83
- class NotionAgency(Agency):
84
  """
85
  Extension of the Agency class that includes a Notion database iframe
86
  in the Gradio interface.
87
  """
88
 
89
- def demo_gradio(self, height=450, dark_mode=True, **kwargs):
90
  """
91
- Custom implementation of demo_gradio that includes a Notion iframe.
92
  Inherits most functionality from the parent class but adds an iframe
93
  at the top of the interface.
94
  """
@@ -159,7 +159,7 @@ class NotionAgency(Agency):
159
  with gr.Row() as iframe_row:
160
  iframe = gr.HTML(value=generate_iframe_html())
161
 
162
- # Original components from Agency.demo_gradio
163
  chatbot = gr.Chatbot(height=height)
164
  with gr.Row():
165
  with gr.Column(scale=9):
@@ -599,7 +599,7 @@ class NotionAgency(Agency):
599
  demo.queue(default_concurrency_limit=10)
600
 
601
  # Launch the demo
602
- demo.launch(**kwargs)
603
  return demo
604
 
605
 
@@ -617,13 +617,13 @@ def main():
617
 
618
  set_openai_client(client)
619
 
620
- # Create our agents
621
  technical_project_manager = TechnicalProjectManager()
622
  research_and_report_agent = ResearchAndReportAgent()
623
  notion_project_agent = NotionProjectAgent()
624
 
625
  # Create the agency with our agents - using NotionAgency instead of Agency
626
- agency = NotionAgency(
627
  agency_chart=[
628
  technical_project_manager,
629
  [technical_project_manager, notion_project_agent],
@@ -633,7 +633,7 @@ def main():
633
  )
634
 
635
  # Launch the demo with Gradio's built-in deployment
636
- return agency.demo_gradio(height=450)
637
 
638
 
639
  if __name__ == "__main__":
 
80
  load_dotenv()
81
 
82
 
83
+ class ProjectManagementAgency(Agency):
84
  """
85
  Extension of the Agency class that includes a Notion database iframe
86
  in the Gradio interface.
87
  """
88
 
89
+ def custom_demo(self, height=450, dark_mode=True, **kwargs):
90
  """
91
+ Custom implementation of custom_demo that includes a Notion iframe.
92
  Inherits most functionality from the parent class but adds an iframe
93
  at the top of the interface.
94
  """
 
159
  with gr.Row() as iframe_row:
160
  iframe = gr.HTML(value=generate_iframe_html())
161
 
162
+ # Original components from Agency.custom_demo
163
  chatbot = gr.Chatbot(height=height)
164
  with gr.Row():
165
  with gr.Column(scale=9):
 
599
  demo.queue(default_concurrency_limit=10)
600
 
601
  # Launch the demo
602
+ demo.launch(**kwargs) # TODO add share=True
603
  return demo
604
 
605
 
 
617
 
618
  set_openai_client(client)
619
 
620
+ # Instantiate agents
621
  technical_project_manager = TechnicalProjectManager()
622
  research_and_report_agent = ResearchAndReportAgent()
623
  notion_project_agent = NotionProjectAgent()
624
 
625
  # Create the agency with our agents - using NotionAgency instead of Agency
626
+ agency = ProjectManagementAgency(
627
  agency_chart=[
628
  technical_project_manager,
629
  [technical_project_manager, notion_project_agent],
 
633
  )
634
 
635
  # Launch the demo with Gradio's built-in deployment
636
+ return agency.custom_demo(height=250)
637
 
638
 
639
  if __name__ == "__main__":