SimpleSam commited on
Commit
049e0f5
·
verified ·
1 Parent(s): 036cb0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -5,6 +5,7 @@ import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
  #from tools.manyata_search import ManyataSearchTool
 
8
  from manyata_tools.manyata_search import ManyataSearchTool
9
  from Manyata_UI import GradioUI #Gradio_UI import GradioUI
10
 
@@ -35,24 +36,21 @@ def get_current_time_in_timezone(timezone: str) -> str:
35
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
36
 
37
  @tool
38
- def get_property(location: str, title: str, count: int) -> str:
39
  """
40
- A tool to that shows property.
41
  Args:
42
- location: The location where property is supposed to be searched
43
- title: a word within the title of the property
44
- count: the number of results expected
45
  """
46
  try:
47
  #
48
- manyata_search = ManyataSearchTool.searchDb("property", title + location, count) #TODO: create the ManyataSearchTool under tools
49
- search = DuckDuckGoSearchTool.forward(location)
50
- return f"property at {location} is: {manyata_search} and on the web includes {search}"
51
  except Exception as e:
52
- return f"error fetching results for location '{location}': {str(e)}"
53
 
54
  final_answer = FinalAnswerTool()
55
- manyata_search = ManyataSearchTool()
56
 
57
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
58
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
@@ -73,7 +71,7 @@ with open("prompts.yaml", 'r') as stream:
73
 
74
  agent = CodeAgent(
75
  model=model,
76
- tools=[final_answer, manyata_search], ## add your tools here (don't remove final answer)
77
  max_steps=6,
78
  verbosity_level=1,
79
  grammar=None,
 
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
  #from tools.manyata_search import ManyataSearchTool
8
+ from irmek_tools.irmek_search import IrmekSearchTool
9
  from manyata_tools.manyata_search import ManyataSearchTool
10
  from Manyata_UI import GradioUI #Gradio_UI import GradioUI
11
 
 
36
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
37
 
38
  @tool
39
+ def get_custom_app(custom_app: str) -> str:
40
  """
41
+ A tool that opens and app.
42
  Args:
43
+ custom_app: name of the app expected
 
 
44
  """
45
  try:
46
  #
47
+ manyata_search = ResearchAppTool.open_custom_app(custom_app) #TODO: create the ManyataSearchTool under tools
48
+ return f"opening {custom_app} please wait"
 
49
  except Exception as e:
50
+ return f"error opening app '{custom_app}': {str(e)}"
51
 
52
  final_answer = FinalAnswerTool()
53
+ irmek_search = IrmekSearchTool()
54
 
55
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
56
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
 
71
 
72
  agent = CodeAgent(
73
  model=model,
74
+ tools=[final_answer, get_custom_app], ## add your tools here (don't remove final answer)
75
  max_steps=6,
76
  verbosity_level=1,
77
  grammar=None,