Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] fix issue#47 #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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