-
Notifications
You must be signed in to change notification settings - Fork 111
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
Develop #624
Merged
Merged
Develop #624
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5451301
refactoring builtin to use simple fetch instead of firecrawl class
NaderRNA a95374c
removing prints
NaderRNA e1681de
Merge branch 'master' into firecrawl-use-fetch
ragyabraham 14d0a1a
Modifying the docker compose to add the new hosts for 'host.docker.lo…
NaderRNA 6e6c448
Merge pull request #622 from rnadigital/installsh-dockercompose-changes
ragyabraham 4796a37
Add check on airbyte availability and run airbyte setup init when needed
iandjx 518eb6a
modifying implementation of statuscheck to also include workspaces ge…
NaderRNA 5bea5f5
adding variable to docker compose.yml
NaderRNA bd8d089
Merge branch 'develop' into firecrawl-use-fetch
NaderRNA eb58049
Merge pull request #615 from rnadigital/firecrawl-use-fetch
NaderRNA 49983f6
Merge branch 'handle-airbyte-availability' into develop
NaderRNA 6728867
Merge branch 'develop' into handle-airbyte-availability
NaderRNA c0a5823
Merge branch 'handle-airbyte-availability' into develop
NaderRNA 64d54c0
Merge branch 'master' into develop
ragyabraham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,22 +1,32 @@ | ||
from langchain_community.document_loaders import AsyncChromiumLoader | ||
from langchain_community.document_loaders import FireCrawlLoader | ||
from pydantic import PrivateAttr | ||
from tools.builtins.base import BaseBuiltinTool | ||
import requests | ||
|
||
class FireCrawlLoader(BaseBuiltinTool): | ||
loader = FireCrawlLoader | ||
|
||
def __init__(self, *args, **kwargs): | ||
print(f"KWARGS: {kwargs}") | ||
super().__init__(**kwargs) | ||
parameters: dict = kwargs.get("parameters") | ||
if parameters is not None: | ||
print(f"PARAMETERS: {parameters}") | ||
api_key:str = parameters.get("firecrawl_api_key") | ||
print(f"API KEY: {api_key}") | ||
kwargs["loader"] = FireCrawlLoader(api_key) | ||
super().__init__(**kwargs) | ||
self.__dict__['_api_key'] = parameters.get("api_key", "") | ||
else: | ||
print("Parameters was None!") | ||
|
||
def run_tool(self, query: str) -> str: | ||
data = FireCrawlLoader(url = query, mode = "scrape") | ||
return data | ||
if not getattr(self, '_api_key', None): | ||
raise ValueError("API key is not set!") #type saftey | ||
|
||
# Use the API key for running the tool logic | ||
url = "https://api.firecrawl.dev/v1/scrape" | ||
payload = { | ||
"url": query | ||
} | ||
headers = { | ||
"Authorization": f"Bearer {self._api_key}", | ||
"Content-Type": "application/json" | ||
} | ||
response = requests.request('POST', url, json=payload, headers=headers) | ||
responseJson = response.json() | ||
return responseJson |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Client-side URL redirect Medium
Copilot Autofix AI 3 days ago
To fix the problem, we should avoid using user input directly in constructing the redirect URL. Instead, we can maintain a list of authorized redirects and choose from that list based on the user input. This ensures that only valid and safe URLs are used for redirection.
resourceSlug
values.resourceSlug
fromrouter.query
is in the list of authorized values.resourceSlug
is authorized.