1
0
forked from github/onyx

Compare commits

...

1 Commits

Author SHA1 Message Date
pablodanswer
c9d7e298fa add fix 2025-01-26 17:02:51 -08:00
2 changed files with 13 additions and 23 deletions

View File

@@ -220,6 +220,13 @@ class InternetSearchTool(Tool):
)
results = response.json()
# If no hits, Bing does not include the webPages key
search_results = (
results["webPages"]["value"][: self.num_results]
if "webPages" in results
else []
)
return InternetSearchResponse(
revised_query=query,
internet_results=[
@@ -228,7 +235,7 @@ class InternetSearchTool(Tool):
link=result["url"],
snippet=result["snippet"],
)
for result in results["webPages"]["value"][: self.num_results]
for result in search_results
],
)

View File

@@ -910,28 +910,11 @@ export function AssistantEditor({
{internetSearchTool && (
<>
<div className="flex items-center content-start mb-2">
<Checkbox
size="sm"
id={`enabled_tools_map.${internetSearchTool.id}`}
checked={
values.enabled_tools_map[internetSearchTool.id]
}
onCheckedChange={() => {
toggleToolInValues(internetSearchTool.id);
}}
name={`enabled_tools_map.${internetSearchTool.id}`}
/>
<div className="flex flex-col ml-2">
<span className="text-sm">
{internetSearchTool.display_name}
</span>
<span className="text-xs text-subtle">
Access real-time information and search the web
for up-to-date results
</span>
</div>
</div>
<BooleanFormField
name={`enabled_tools_map.${internetSearchTool.id}`}
label={internetSearchTool.display_name}
subtext="Access real-time information and search the web for up-to-date results"
/>
</>
)}