Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions search_with_lepton.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import re
import uuid
import threading
import requests
import traceback
Expand Down Expand Up @@ -136,6 +137,10 @@ def search_with_google(query: str, subscription_key: str, cx: str):
json_content = response.json()
try:
contexts = json_content["items"][:REFERENCE_COUNT]
for item in contexts:
item['url']=item['link']
item['name']=item['title']
item['id']=str(uuid.uuid4())
except KeyError:
logger.error(f"Error encountered: {json_content}")
return []
Expand Down