-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,10 @@ | |
|
||
__author__ = """Mike Gee""" | ||
__email__ = "[email protected]" | ||
__version__ = "0.1.0" | ||
__version__ = "0.3.0" | ||
|
||
from .chat import * | ||
from .crawl import * | ||
from .openai import * | ||
from .scrape import * | ||
from .search import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
import requests | ||
|
||
from .webt_api import run_webt_api | ||
|
||
|
||
def search(query): | ||
if api_key is None: | ||
api_key = os.environ.get("WEBTRANSPOSE_API_KEY") | ||
|
||
if api_key is not None: | ||
out_json = run_webt_api( | ||
{ | ||
"query": query, | ||
}, | ||
"/v1/search", | ||
api_key, | ||
) | ||
return out_json | ||
|
||
raise ValueError("Must provide api_key or set WEBTRANSPOSE_API_KEY in environment variables.") | ||
|
||
|
||
def search_filter(query): | ||
if api_key is None: | ||
api_key = os.environ.get("WEBTRANSPOSE_API_KEY") | ||
|
||
if api_key is not None: | ||
out_json = run_webt_api( | ||
{ | ||
"query": query, | ||
}, | ||
"/v1/search/filter", | ||
api_key, | ||
) | ||
return out_json | ||
|
||
raise ValueError("Must provide api_key or set WEBTRANSPOSE_API_KEY in environment variables.") |