isayahc commited on
Commit
c8fe20b
1 Parent(s): c6cb298

parsing the data generated by the tools

Browse files
Files changed (1) hide show
  1. mixtral_agent.py +21 -15
mixtral_agent.py CHANGED
@@ -90,7 +90,13 @@ def google_search(query: str) -> str:
90
 
91
 
92
  organic_source = search_results['organic_results']
93
- return organic_source
 
 
 
 
 
 
94
 
95
 
96
 
@@ -138,7 +144,7 @@ agent_executor = AgentExecutor(
138
  agent=agent,
139
  tools=tools,
140
  verbose=True,
141
- handle_parsing_errors=True #prevents error
142
  )
143
 
144
 
@@ -148,29 +154,29 @@ if __name__ == "__main__":
148
  # global variable for collecting sources
149
  all_sources = []
150
 
151
- # input = agent_executor.invoke(
 
 
 
 
 
 
 
 
152
  # {
153
- # "input": "How to generate videos from images using state of the art macchine learning models; Using the axriv retriever " +
154
  # "add the urls of the papers used in the final answer using the metadata from the retriever"
155
  # # f"Please prioritize the newest papers this is the current data {get_current_date()}"
156
  # }
157
  # )
158
-
159
  # input_1 = agent_executor.invoke(
160
  # {
161
- # "input": "I am looking for a text to 3d model; Using the axriv retriever " +
162
- # "add the urls of the papers used in the final answer using the metadata from the retriever"
163
  # # f"Please prioritize the newest papers this is the current data {get_current_date()}"
164
  # }
165
  # )
166
-
167
- input_1 = agent_executor.invoke(
168
- {
169
- "input": "I am looking for a text to 3d model; Using the google retriever " +
170
- "add the urls of the papers used in the final answer using the metadata from the retriever"
171
- # f"Please prioritize the newest papers this is the current data {get_current_date()}"
172
- }
173
- )
174
 
175
  x = 0
176
 
 
90
 
91
 
92
  organic_source = search_results['organic_results']
93
+ # formatted_string = "Title: {title}, link: {link}, snippet: {snippet}".format(**organic_source)
94
+ cleaner_sources = ["Title: {title}, link: {link}, snippet: {snippet}".format(**i) for i in organic_source]
95
+
96
+ all_sources += cleaner_sources
97
+
98
+ return cleaner_sources.__str__()
99
+ # return organic_source
100
 
101
 
102
 
 
144
  agent=agent,
145
  tools=tools,
146
  verbose=True,
147
+ # handle_parsing_errors=True #prevents error
148
  )
149
 
150
 
 
154
  # global variable for collecting sources
155
  all_sources = []
156
 
157
+ input = agent_executor.invoke(
158
+ {
159
+ "input": "How to generate videos from images using state of the art macchine learning models; Using the axriv retriever " +
160
+ "add the urls of the papers used in the final answer using the metadata from the retriever please do not use '`' "
161
+ # f"Please prioritize the newest papers this is the current data {get_current_date()}"
162
+ }
163
+ )
164
+
165
+ # input_1 = agent_executor.invoke(
166
  # {
167
+ # "input": "I am looking for a text to 3d model; Using the axriv retriever " +
168
  # "add the urls of the papers used in the final answer using the metadata from the retriever"
169
  # # f"Please prioritize the newest papers this is the current data {get_current_date()}"
170
  # }
171
  # )
172
+
173
  # input_1 = agent_executor.invoke(
174
  # {
175
+ # "input": "I am looking for a text to 3d model; Using the google search tool " +
176
+ # "add the urls in the final answer using the metadata from the retriever, also provid a summary of the searches"
177
  # # f"Please prioritize the newest papers this is the current data {get_current_date()}"
178
  # }
179
  # )
 
 
 
 
 
 
 
 
180
 
181
  x = 0
182