-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add refactoring for pylint standards
- Loading branch information
1 parent
a2dd566
commit 8e5201e
Showing
16 changed files
with
157 additions
and
103 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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
""" | ||
Basic example for creating the node | ||
""" | ||
import os | ||
from dotenv import load_dotenv | ||
from yosoai.graphs import SmartScraper | ||
|
||
OPENAI_API_KEY = '' | ||
load_dotenv() | ||
|
||
openai_key = os.getenv("API_KEY") | ||
if not openai_key: | ||
print("Error: OpenAI API key not found in environment variables.") | ||
llm_config = { | ||
"api_key": OPENAI_API_KEY, | ||
"api_key": openai_key, | ||
"model_name": "gpt-3.5-turbo", | ||
} | ||
|
||
url = "https://perinim.github.io/projects/" | ||
prompt = "List me all the titles and project descriptions" | ||
|
||
smart_scraper = SmartScraper(prompt, url, llm_config) | ||
smart_scraper = SmartScraper("List me all the titles and project descriptions", | ||
"https://perinim.github.io/projects/", llm_config) | ||
|
||
answer = smart_scraper.run() | ||
print(answer) | ||
|
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
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 |
---|---|---|
|
@@ -58,3 +58,4 @@ def invocation(self, query_info): | |
return result_dict | ||
except Exception as e: | ||
print(f"Error: {e}") | ||
return None |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
""" | ||
__init__.py file for graphs folder | ||
""" | ||
from .base_graph import BaseGraph | ||
from .smart_scraper_graph import SmartScraper | ||
from .smart_scraper_graph import SmartScraper |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
""" | ||
__init__.py file for node folder | ||
""" | ||
from .fetch_html_node import FetchHTMLNode | ||
from .conditional_node import ConditionalNode | ||
from .get_probable_tags_node import GetProbableTagsNode | ||
from .generate_answer_node import GenerateAnswerNode | ||
from .parse_html_node import ParseHTMLNode | ||
from .parse_html_node import ParseHTMLNode |
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
Oops, something went wrong.