generated from jsynowiec/node-typescript-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FEATURE: Added PassiveSearch v1 - Added Connection to ElasticSearch - Added 2 API's - /ping and /passive - Keyword Search using /passive - Added Storing to DB capability when using /search * Fix: Added error handling -added error handling for passivesearch api endpoint * FEATURE: Added Simple Query String - Changed ElasticSearch Search type to Simple Query String * REFACTOR: Improved Active Search -Made Active Search make better use of downtimes (Rate Limits or Validation Downtime) * FIX: Issues with Active Search -Fixed errors with parrallel processing * FEATURE: Added SeedScript - Added RootQuery as an optional query param for activesearch which basically takes out the prompt builder and takes a raw query to look for in Github API. - Added Python SeedScript
- Loading branch information
Showing
4 changed files
with
51 additions
and
6 deletions.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Description: This script is used to seed the database with data from the data folder | ||
# !pip install requests | ||
# python scripts/seed_script.py to run from main folder | ||
|
||
import requests | ||
|
||
def call_local_endpoint(prompt): | ||
#TODO: Change this to the correct URL when activesearch endpoint is changed | ||
url = f'http://localhost:8080/search?rootquery="{prompt}"' | ||
|
||
try: | ||
response = requests.get(url) | ||
|
||
# Check if the response was successful (status code 200) | ||
if response.status_code == 200: | ||
print("Request to localhost:8080/search was successful!") | ||
print("Response content:") | ||
print(response.text) | ||
else: | ||
print(f"Request to localhost:8080/active failed with status code: {response.status_code}") | ||
|
||
except requests.exceptions.RequestException as e: | ||
print(f"An error occurred: {e}") | ||
|
||
if __name__ == "__main__": | ||
#Get Open API files | ||
call_local_endpoint("openapi: 3") | ||
#Get Swagger files | ||
call_local_endpoint("swagger: 2") | ||
|
||
#PS: Takes a long time to run |
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
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
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