mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
rm unfinished fin
This commit is contained in:
parent
2328f94b5e
commit
4fb7b91904
2 changed files with 0 additions and 33 deletions
|
|
@ -1,33 +0,0 @@
|
|||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from tavily import TavilyClient
|
||||
|
||||
cache_path: Path = Path("./web_search_cache")
|
||||
cache_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def web_search(query: str, enable_print: bool = True, enable_cache: bool = True):
|
||||
if enable_cache:
|
||||
...
|
||||
|
||||
client = TavilyClient(api_key=os.environ["TVLY_API_KEY"])
|
||||
response = client.search(
|
||||
include_answer=True,
|
||||
include_raw_content=True,
|
||||
query=query)
|
||||
|
||||
# response = client.get_search_context(query=query)
|
||||
# response = json.loads(response)
|
||||
if enable_print:
|
||||
print(json.dumps(response, indent=2, ensure_ascii=False))
|
||||
|
||||
return response
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv("../../.env")
|
||||
web_search("恒生医药为什么一直涨")
|
||||
Loading…
Add table
Reference in a new issue