Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -469,11 +469,11 @@ def process_tool_request(tool_request_data):
|
|
469 |
search_results = nih_ref_snp_tool.actual_function(snp=snp)
|
470 |
tool_return = {"name": nih_ref_snp_tool.json_name, "return": search_results}
|
471 |
|
472 |
-
elif tool_name == perplexity_tool.
|
473 |
query = tool_parameters["query"]
|
474 |
-
|
475 |
-
search_results = perplexity_tool.actual_function(query=query, api_key=
|
476 |
-
tool_return = {"name": perplexity_tool.
|
477 |
|
478 |
else:
|
479 |
raise ValueError(f"Unknown tool name: {tool_name}")
|
|
|
469 |
search_results = nih_ref_snp_tool.actual_function(snp=snp)
|
470 |
tool_return = {"name": nih_ref_snp_tool.json_name, "return": search_results}
|
471 |
|
472 |
+
elif tool_name == perplexity_tool.json_name:
|
473 |
query = tool_parameters["query"]
|
474 |
+
# Using the environment variable instead of requiring it as a parameter
|
475 |
+
search_results = perplexity_tool.actual_function(query=query, api_key=PERPLEXITY_API_KEY)
|
476 |
+
tool_return = {"name": perplexity_tool.json_name, "return": search_results}
|
477 |
|
478 |
else:
|
479 |
raise ValueError(f"Unknown tool name: {tool_name}")
|