mathysgrapotte commited on
Commit
538e5b1
·
1 Parent(s): aac98d4

slightly change prompts to return lists of formats instead of single formats and added output support

Browse files
Files changed (1) hide show
  1. main.py +16 -9
main.py CHANGED
@@ -56,16 +56,23 @@ def run_multi_agent(module_name):
56
 
57
  ### FETCH ONTOLOGY TERMS FROM EDAM DATABASE ###
58
 
 
 
59
  for input_channel in meta_info["inputs"]:
60
  for ch_element in input_channel:
61
  for key, value in ch_element.items():
62
- if key == "file":
63
- result = agent.run(f"""
64
- You are presentend with a file format for the type {key}, which is a {value['type']} and is described by the following description: '{value['description']}',
65
- search for the single best match out of possible matches in the edam ontology (formated as format_XXXX),
66
- and return the answer (a single ontology class) in a final_answer call such as final_answer(f'format_XXXX')
67
- """)
68
- print(result)
 
 
 
 
 
69
 
70
  ### FINAL AGENT TO BENCHMARK AND FIND THE COMMONALITIES BETWEEN BIO.TOOLS AND EDAM ###
71
 
@@ -108,7 +115,7 @@ def run_interface():
108
  outputs=[meta_output, download_button]
109
  )
110
 
111
- demo.launch(share=True)
112
 
113
  if __name__ == "__main__":
114
- run_interface()
 
56
 
57
  ### FETCH ONTOLOGY TERMS FROM EDAM DATABASE ###
58
 
59
+ results = {"inputs": {}, "outputs": {}}
60
+
61
  for input_channel in meta_info["inputs"]:
62
  for ch_element in input_channel:
63
  for key, value in ch_element.items():
64
+ if value["type"] == "file":
65
+ result = agent.run(f"You are presentend with a file format for the input {key}, which is a file and is described by the following description: '{value['description']}', search for the best matches out of possible matches in the edam ontology (formated as format_XXXX), and return the answer (a list of ontology classes) in a final_answer call such as final_answer([format_XXXX, format_XXXX, ...])")
66
+ results["inputs"][key] = result
67
+
68
+ for output_channel in meta_info["outputs"]:
69
+ for ch_element in output_channel:
70
+ for key, value in ch_element.items():
71
+ if value["type"] == "file":
72
+ result = agent.run(f"You are presentend with a file format for the output {key}, which is a file and is described by the following description: '{value['description']}', search for the best matches out of possible matches in the edam ontology (formated as format_XXXX), and return the answer (a list of ontology classes) in a final_answer call such as final_answer([format_XXXX, format_XXXX, ...])")
73
+ results["outputs"][key] = result
74
+
75
+ print(results)
76
 
77
  ### FINAL AGENT TO BENCHMARK AND FIND THE COMMONALITIES BETWEEN BIO.TOOLS AND EDAM ###
78
 
 
115
  outputs=[meta_output, download_button]
116
  )
117
 
118
+ demo.launch()
119
 
120
  if __name__ == "__main__":
121
+ run_multi_agent("fastqc")