Dataset Viewer
file_path
stringclasses 8
values | file_content
stringclasses 8
values |
---|---|
data/toolenv/tools/Customized/cve_cpe/api.py | def searchxxxcxxxvxxxe(cpexxxname = None, cvexxxid = None, cvssxxxv2xxxmetrics = None, cvssxxxv2xxxseverity = None, cvssxxxv3xxxmetrics = None, cvssxxxv3xxxseverity = None, cwexxxid = None, hasxxxcertxxxalerts = None, hasxxxcertxxxnotes = None, hasxxxoval = None, isxxxvulnerable = None, keywordxxxexactxxxmatch = None, keywordxxxsearch = None, lastxxxmodxxxstartxxxdate = None, lastxxxmodxxxendxxxdate = None, noxxxrejected = None, pubxxxstartxxxdate = None, pubxxxendxxxdate = None, sourcexxxidentifier = None, versionxxxend = None, versionxxxendxxxtype = None, versionxxxstart = None, versionxxxstartxxxtype = None, virtualxxxmatchxxxstring = None, limit = None, delay = None, key = None, verbose = None):
"""
Build and send GET request then return list of objects containing a collection of CVEs. For more information on the parameters available, please visit https://nvd.nist.gov/developers/vulnerabilities
Args:
cpexxxname (str): Please do not confuse this with keywordxxxsearch; this requires the argument to start with "cpe", whereas the keywordxxxsearch argument allows for arbitrary keywords. This value will be compared agains the CPE Match Criteria within a CVE applicability statement. (i.e. find the vulnerabilities attached to that CPE). Partial match strings are allowed.
cvexxxid (str): Please pass in a string integer, like "1" or "30". Returns a single CVE that already exists in the NVD.
cvssxxxv2xxxmetrics (str): This parameter returns only the CVEs that match the provided CVSSv2 vector string. Either full or partial vector strings may be used. This parameter cannot be used in requests that include cvssxxxv3xxxmetrics.
cvssxxxv2xxxseverity (str): Find vulnerabilities having a LOW, MEDIUM, or HIGH version 2 severity.
cvssxxxv3xxxmetrics (str): This parameter returns only the CVEs that match the provided CVSSv3 vector string. Either full or partial vector strings may be used. This parameter cannot be used in requests that include cvssxxxv2xxxmetrics.
cvssxxxv3xxxseverity (str): Find vulnerabilities having a LOW, MEDIUM, HIGH, or CRITICAL version 3 severity.
cwexxxid (str): Please pass in a string integer, like "1" or "30". Filter collection by CWE (Common Weakness Enumeration) ID. You can find a list at https://cwe.mitre.org/. A CVE can have multiple CWE IDs assigned to it.
hasxxxcertxxxalerts (bool): Returns CVE that contain a Technical Alert from US-CERT.
hasxxxcertxxxnotes (bool): Returns CVE that contain a Vulnerability Note from CERT/CC.
hasxxxoval (bool): Returns CVE that contain information from MITRE's Open Vulnerability and Assessment Language (OVAL) before this transitioned to the Center for Internet Security (CIS).
isxxxvulnerable (bool): Returns CVE associated with a specific CPE, where the CPE is also considered vulnerable. REQUIRES cpexxxname parameter. isxxxvulnerable is not compatible with virtualxxxmatchxxxstring parameter.
keywordxxxexactxxxmatch (bool): When keywordxxxsearch is used along with keywordExactmatch, it will search the NVD for CVEs containing exactly what was passed to keywordxxxsearch. REQUIRES keywordxxxsearch.
keywordxxxsearch (str): Searches CVEs where a word or phrase is found in the current description. If passing multiple keywords with a space character in between then each word must exist somewhere in the description, not necessarily together unless keywordxxxexactxxxmatch=True is passed to searchxxxcxxxvxxxe.
lastxxxmodxxxstartxxxdate (str, datetime obj): These parameters return only the CVEs that were last modified during the specified period. If a CVE has been modified more recently than the specified period, it will not be included in the response. If filtering by the last modified date, both lastxxxmodxxxstartxxxdate and lastxxxmodxxxendxxxdate are REQUIRED. The maximum allowable range when using any date range parameters is 120 consecutive days.
lastxxxmodxxxendxxxdate (str, datetime obj): Required if using lastxxxmodxxxstartxxxdate.
noxxxrejected (bool): Filters out all CVEs that are in a reject or rejected status. Searches without this parameter include rejected CVEs.
pubxxxstartxxxdate (str, datetime obj): These parameters return only the CVEs that were added to the NVD (i.e., published) during the specified period. If filtering by the published date, both pubxxxstartxxxdate and pubxxxendxxxdate are REQUIRED. The maximum allowable range when using any date range parameters is 120 consecutive days.
pubxxxendxxxdate (str, datetime obj): Required if using pubxxxstartxxxdate.
sourcexxxidentifier (str): Returns CVE where the data source of the CVE is the value that is passed to sourcexxxidentifier.
versionxxxend (str): Must be combined with versionxxxendType and virtualxxxmatchxxxstring. Returns only the CVEs associated with CPEs in specific version ranges.
versionxxxendType (str): Must be combined with versionxxxend and virtualxxxmatchxxxstring. Valid values are including or excluding. Denotes to include the specified version in versionxxxend, or exclude it.
versionxxxstart (str): Must be combined with versionxxxstartType and virtualxxxmatchxxxstring. Returns only CVEs with specific versions. Requests that include versionxxxstart cannot include a version component in the virtualxxxmatchxxxstring.
versionxxxstartType (str): Must be combined with versionxxxstart and virtualxxxmatchxxxstring. Valid values are including or excluding. Denotes to include the specified version in versionxxxstart, or exclude it.
virtualxxxmatchxxxstring (str): A more broad filter compared to cpexxxname. The cpe match string that is passed to virtualxxxmatchxxxstring is compared against the CPE Match Criteria present on CVE applicability statements.
limit (int): Custom argument to limit the number of results of the search. Allowed any number between 1 and 2000.
delay (int): Can only be used if an API key is provided. This allows the user to define a delay. The delay must be greater than 0.6 seconds. The NVD API recommends scripts sleep for atleast 6 seconds in between requests.
key (str): NVD API Key. Allows for the user to define a delay. NVD recommends scripts sleep 6 seconds in between requests. If no valid API key is provided, requests are sent with a 6 second delay.
verbose (bool): Prints the URL request for debugging purposes.
"""
return "Is successful."
def searchxxxcxxxpxxxe(cpexxxnamexxxid = None, cpexxxmatchxxxstring = None, keywordxxxexactxxxmatch = None, keywordxxxsearch = None, lastxxxmodxxxstartxxxdate = None, lastxxxmodxxxendxxxdate = None, limit = None, key = None, delay = None, verbose = None):
"""
Build and send GET request then return list of objects containing a collection of CPEs.
Args:
cpexxxnamexxxid (str): Returns a specific CPE record using its UUID. If a correctly formatted UUID is passed but it does not exist, it will return empty results. The UUID is the cpexxxnamexxxid value when searching CPE.
cpexxxmatchxxxstring (str): Use a partial CPE name to search for other CPE names.
keywordxxxexactxxxmatch (bool): Searches metadata within CPE title and reference links for an exact match of the phrase or word passed to it. Must be included with keywordxxxsearch.
keywordxxxsearch (str): Returns CPE records where a word or phrase is found in the metadata title or reference links. Space characters act as an AND statement.
lastxxxmodxxxstartxxxdate (str/datetime obj): CPE last modification start date. Maximum 120 day range. A start and end date is required. All times are in UTC 00:00. A datetime object or string can be passed as a date. NVDLib will automatically parse the datetime object into the correct format. String Example: ‘2020-06-28 00:00’
lastxxxmodxxxendxxxdate (str/datetime obj): CPE last modification end date. Maximum 120 day range. Must be included with lastxxxmodxxxstartxxxdate. Example: ‘2020-06-28 00:00’
limit (int): Limits the number of results of the search.
key (str): NVD API Key. Allows for a request every 0.6 seconds instead of 6 seconds.
delay (int): Can only be used if an API key is provided. The amount of time to sleep in between requests. Must be a value above 0.6 seconds if an API key is present. delay is set to 6 seconds if no API key is passed.
verbose (bool): Prints the URL request for debugging purposes.
"""
return "Is successful." |
data/toolenv/tools/Customized/emailrep/api.py | def emailrep_post(email: str):
"""
Query an email address
Parameters
email (string, required): Email address being queried
"""
return "Is successful."
def emailrep_report(email: str, key: str):
"""
Reports an email address. Date of malicious activity defaults to the current time unless otherwise specified.
Parameters:
email (string, required): Email address being reported.
key (string, required): The API key of the user.
"""
return "Is successful." |
data/toolenv/tools/Customized/virustotal/api.py | def vt_get_dns_resolution_object(id: str, x_apikey: str):
"""
This endpoint retrieves a Resolution object by its ID. A resolution object ID is made by appending the IP and the domain it resolves to together.
Domain-IP resolutions. Resolution objects include the following attributes:
date: <integer> date when the resolution was made (UTC timestamp).
host_name: <string> domain or subdomain requested to the resolver.
host_name_last_analysis_stats: <dictionary> last detection stats from the resolution's domain. Similar to the domains's last_analysis_stats attribute.
ip_address: <string> IP address the domain was resolved to.
ip_address_last_analysis_stats: <dictionary> last detection stats from the resolution's IP address. Similar to the IP address' last_analysis_stats attribute.
resolver: <string> source of the resolution.
Args:
- id: string, required, Resolution object ID
- x-apikey: string, required, Your API key
"""
return "Is successful."
def vt_get_objects_related_to_ip_address(ip: str, relationship: str, x_apikey: str, limit: int = None, cursor: str = None):
"""
IP addresses have number of relationships to other objects. This returns ALL objects that fit the relationship.
The relationships are documented here:
- comments: The comments for the IP address. Returns a list of comments.
- communicating_files: Files that communicate with the IP address. Returns a list of files.
- downloaded_files: Files downloaded from the IP address. VT Enterprise users only. Returns a list of files.
- graphs: Graphs including the IP address. Returns a list of graphs.
- historical_ssl_certificates: SSL certificates associated with the IP. Returns a list of SSL certificates.
- historical_whois: WHOIS information for the IP address. Retrurns a list of Whois attributes.
- related_comments: Community posted comments in the IP's related objects. Returns a list of comments.
- related_references: Returns the references related to the IP address. Returns a list of References.
- related_threat_actors: Threat actors related to the IP address. Returns a list of threat actors.
- referrer_files: Files containing the IP address. Returns a list of Files.
- resolutions: Resolves the IP addresses. Returns a list of resolutions.
- urls: Returns a list of URLs related to the IP address. Returns a list of URLs.
Args:
- ip, string, required, IP address
- relationship, string, required, Relationship name (see the list of items from above)
- x-apikey, string, required, Your API key
- limit, int32, optional, Maximum number of comments to retrieve
- cursor, string, optional, Continuation cursor
"""
return "Is successful."
def vt_get_ip_address_report(ip: str, x_apikey: str):
"""
Retrieve an IP address report. These reports condense all of the recent activity that VirusTotal has seen for the resource under consideration, as well as contextual information about it.
This function specifically generates these reports using the IP address parameter.
Args:
- ip: string, required, IP address
- x-apikey: string, required, Your API key
"""
return "Is successful."
def vt_add_votes_to_ip_address(ip: str, data: dict, x_apikey: str):
"""
With this function you can post a vote for a given file. The body for the POST request must be the JSON representation of a vote object. Note however that you don't need to provide an ID for the object, as they are automatically generated for new votes. The verdict attribute must have be either harmless or malicious.
Please ensure that the JSON object you provide conforms accurately to valid JSON standards.
Args:
- ip, string, required, IP address
- data, json, Vote object
- x-apikey, string, required, Your API key
"""
return "Is successful."
def vt_get_domain_report(domain: str, x_apikey: str):
"""
Retrieves a domain report. These reports contain information regarding the domain itself that VirusTotal has collected.
Args:
- domain: string, required, Domain name
- x-apikey: string, required, Your API key
"""
return "Is successful."
def vt_get_comments_on_ip_address(ip: str, x_apikey: str, limit: int = None, cursor: str = None):
"""
Retrieves the comments on a provided IP address. Returns a list of Comment objects.
Args:
- ip, string, required, IP address
- x-apikey, string, required, Your API key
- limit, int32, optional, Maximum number of comments to retrieve
- cursor, string, optional, Continuation cursor
"""
return "Is successful."
def vt_add_comment_to_ip_address(ip: str, data: dict, x_apikey: str):
"""
With this function you can post a comment for a given IP address. The body for the POST request must be the JSON representation of a comment object. Notice however that you don't need to provide an ID for the object, as they are automatically generated for new comments.
However, please note that you will need to provide a valid data JSON for using this function.
Any word starting with # in your comment's text will be considered a tag, and added to the comment's tag attribute.
Returns a Comment object.
Args:
- ip: string, required, IP address
- data: json, required, A comment object
- x-apikey: string, required, Your API key
"""
return "Is successful."
def vt_get_object_descriptors_related_to_ip_address(ip: str, relationship: str, x_apikey: str, limit: int = None, cursor: str = None):
"""
This specifically returns related object's IDs (and context attributes, if any). Please note that this will not return all attributes.
You are expected to provide the relationship to the object you're interested in. The valid relationships are as follows.
The relationships are documented here:
- comments: The comments for the IP address.
- communicating_files: Files that communicate with the IP address.
- downloaded_files: Files downloaded from the IP address. VT Enterprise users only.
- graphs: Graphs including the IP address.
- historical_ssl_certificates: SSL certificates associated with the IP.
- historical_whois: WHOIS information for the IP address. Retrurns a list of Whois attributes.
- related_comments: Community posted comments in the IP's related objects.
- related_references: Returns the references related to the IP address.
- related_threat_actors: Threat actors related to the IP address.
- referrer_files: Files containing the IP address.
- resolutions: Resolves the IP addresses.
- urls: Returns a list of URLs related to the IP address.
Here are some useful descriptions of the arguments in this API, with the format - name of this argument: type of the data, required or optional, description of this argument.
- ip: string, required, IP address
- relationship: string, required, Relationship name (see table)
- x-apikey: string, required, Your API key
- limit: int32, optional, Maximum number of comments to retrieve
- cursor: string, optional, Continuation cursor
"""
return "Is successful."
def vt_get_objects_related_to_domain(domain: str, relationship: str, x_apikey: str, limit: int = None, cursor: str = None):
"""
Objects are a key concept in the VirusTotal API. Each object has an identifier and a type.
Each object has an associated URL, and each domain is associated with objects.
This function returns ALL of the objects related to the domain, based on the specified relationship.
The following describe the valid relationship:
- caa_records: Records CAA for the domain.
- cname_records: Records CNAME for the domain.
- comments: Community posted comments about the domain.
- communicating_files: Files that communicate with the domain.
- downloaded_files: Files downloaded from that domain.
- graphs: All graphs that include the domain.
- historical_ssl_certificates: SSL certificates associated with the domain.
- historical_whois: WHOIS information for the domain.
- immediate_parent: Domain's immediate parent.
- mx_records: Records MX for the domain.
- ns_records: Records NS for the domain.
- parent: Domain's top parent.
- referrer_files: Refers to any and all files that contain this domain.
- related_comments: Community posted comments in the domain's related objects.
- related_references: Refers to the References related to the domain.
- related_threat_actors: Refers to the threat actors related to the domain. A list of Threat Actors.
- resolutions: DNS resolutions for the domain.
- soa_records: Records SOA for the domain.
- siblings: Refers to the Domain's sibling domains.
- subdomains: Refers to the Domain's subdomains.
- urls: Refers to the URLs that contain this domain.
- user_votes: Refers to the current user's votes.
Args:
- domain: string, required, Domain name
- relationship, string, required, Relationship name (see table)
- x-apikey, string, required, Your API key
- limit, int32, optional, Maximum number of comments to retrieve
- cursor, string, optional, Continuation cursor
"""
return "Is successful."
def vt_get_object_descriptors_related_to_domain(domain: str, relationship: str, x_apikey: str, limit: int = None, cursor: str = None):
"""
This specifically returns related object's IDs (and context attributes, if any). Please note that this will not return all attributes. This will return objects relating to a domain.
- caa_records: Records CAA for the domain.
- cname_records: Records CNAME for the domain.
- comments: Community posted comments about the domain.
- communicating_files: Files that communicate with the domain.
- downloaded_files: Files downloaded from that domain.
- graphs: All graphs that include the domain.
- historical_ssl_certificates: SSL certificates associated with the domain.
- historical_whois: WHOIS information for the domain.
- immediate_parent: Domain's immediate parent.
- mx_records: Records MX for the domain.
- ns_records: Records NS for the domain.
- parent: Domain's top parent.
- referrer_files: Refers to any and all files that contain this domain.
- related_comments: Community posted comments in the domain's related objects.
- related_references: Refers to the References related to the domain.
- related_threat_actors: Refers to the threat actors related to the domain. A list of Threat Actors.
- resolutions: DNS resolutions for the domain.
- soa_records: Records SOA for the domain.
- siblings: Refers to the Domain's sibling domains.
- subdomains: Refers to the Domain's subdomains.
- urls: Refers to the URLs that contain this domain.
- user_votes: Refers to the current user's votes.
Args:
- domain: string, required, Domain name
- relationship: string, required, Relationship name (see table)
- x-apikey: string, required, Your API key
- limit: int32, optional, Maximum number of comments to retrieve
- cursor: string, optional, Continuation cursor
"""
return "Is successful."
def vt_get_comments_on_domain(domain: str, x_apikey: str, limit: int = None, cursor: str = None):
"""
This function will retrieve comments on a specified domain.
Args:
- domain, string, required, Domain name
- x-apikey, string, required, Your API key
- limit, int32, optional, Maximum number of comments to retrieve
- cursor, string, optional, Continuation cursor
"""
return "Is successful."
def vt_get_votes_on_ip_address(ip: str):
"""
This function will retrieve votes on a provided IP address.
Args:
- ip: string, required, ip address
"""
return "Is successful." |
data/toolenv/tools/Customized/cve_cpe.json | {
"tool_description": "cve_cpe",
"tool_name": "cve_cpe",
"title": "cve_cpe",
"standardized_name": "cve_cpe",
"api_list": [
{
"name": "searchxxxcxxxvxxxe",
"url": "",
"description": "\n Build and send GET request then return list of objects containing a collection of CVEs. For more information on the parameters available, please visit https://nvd.nist.gov/developers/vulnerabilities\n\n Args:\n cpexxxname (str): Please do not confuse this with keywordxxxsearch; this requires the argument to start with \"cpe\", whereas the keywordxxxsearch argument allows for arbitrary keywords. This value will be compared agains the CPE Match Criteria within a CVE applicability statement. (i.e. find the vulnerabilities attached to that CPE). Partial match strings are allowed.\n\n cvexxxid (str): Please pass in a string integer, like \"1\" or \"30\". Returns a single CVE that already exists in the NVD.\n\n cvssxxxv2xxxmetrics (str): This parameter returns only the CVEs that match the provided CVSSv2 vector string. Either full or partial vector strings may be used. This parameter cannot be used in requests that include cvssxxxv3xxxmetrics.\n\n cvssxxxv2xxxseverity (str): Find vulnerabilities having a LOW, MEDIUM, or HIGH version 2 severity.\n\n cvssxxxv3xxxmetrics (str): This parameter returns only the CVEs that match the provided CVSSv3 vector string. Either full or partial vector strings may be used. This parameter cannot be used in requests that include cvssxxxv2xxxmetrics.\n\n cvssxxxv3xxxseverity (str): Find vulnerabilities having a LOW, MEDIUM, HIGH, or CRITICAL version 3 severity.\n\n cwexxxid (str): Please pass in a string integer, like \"1\" or \"30\". Filter collection by CWE (Common Weakness Enumeration) ID. You can find a list at https://cwe.mitre.org/. A CVE can have multiple CWE IDs assigned to it.\n\n hasxxxcertxxxalerts (bool): Returns CVE that contain a Technical Alert from US-CERT.\n\n hasxxxcertxxxnotes (bool): Returns CVE that contain a Vulnerability Note from CERT/CC.\n\n hasxxxoval (bool): Returns CVE that contain information from MITRE's Open Vulnerability and Assessment Language (OVAL) before this transitioned to the Center for Internet Security (CIS).\n\n isxxxvulnerable (bool): Returns CVE associated with a specific CPE, where the CPE is also considered vulnerable. REQUIRES cpexxxname parameter. isxxxvulnerable is not compatible with virtualxxxmatchxxxstring parameter.\n\n keywordxxxexactxxxmatch (bool): When keywordxxxsearch is used along with keywordExactmatch, it will search the NVD for CVEs containing exactly what was passed to keywordxxxsearch. REQUIRES keywordxxxsearch.\n\n keywordxxxsearch (str): Searches CVEs where a word or phrase is found in the current description. If passing multiple keywords with a space character in between then each word must exist somewhere in the description, not necessarily together unless keywordxxxexactxxxmatch=True is passed to searchxxxcxxxvxxxe.\n\n lastxxxmodxxxstartxxxdate (str, datetime obj): These parameters return only the CVEs that were last modified during the specified period. If a CVE has been modified more recently than the specified period, it will not be included in the response. If filtering by the last modified date, both lastxxxmodxxxstartxxxdate and lastxxxmodxxxendxxxdate are REQUIRED. The maximum allowable range when using any date range parameters is 120 consecutive days.\n\n lastxxxmodxxxendxxxdate (str, datetime obj): Required if using lastxxxmodxxxstartxxxdate.\n\n noxxxrejected (bool): Filters out all CVEs that are in a reject or rejected status. Searches without this parameter include rejected CVEs.\n\n pubxxxstartxxxdate (str, datetime obj): These parameters return only the CVEs that were added to the NVD (i.e., published) during the specified period. If filtering by the published date, both pubxxxstartxxxdate and pubxxxendxxxdate are REQUIRED. The maximum allowable range when using any date range parameters is 120 consecutive days.\n\n pubxxxendxxxdate (str, datetime obj): Required if using pubxxxstartxxxdate.\n\n sourcexxxidentifier (str): Returns CVE where the data source of the CVE is the value that is passed to sourcexxxidentifier.\n\n versionxxxend (str): Must be combined with versionxxxendType and virtualxxxmatchxxxstring. Returns only the CVEs associated with CPEs in specific version ranges.\n\n versionxxxendType (str): Must be combined with versionxxxend and virtualxxxmatchxxxstring. Valid values are including or excluding. Denotes to include the specified version in versionxxxend, or exclude it.\n\n versionxxxstart (str): Must be combined with versionxxxstartType and virtualxxxmatchxxxstring. Returns only CVEs with specific versions. Requests that include versionxxxstart cannot include a version component in the virtualxxxmatchxxxstring.\n\n versionxxxstartType (str): Must be combined with versionxxxstart and virtualxxxmatchxxxstring. Valid values are including or excluding. Denotes to include the specified version in versionxxxstart, or exclude it.\n\n virtualxxxmatchxxxstring (str): A more broad filter compared to cpexxxname. The cpe match string that is passed to virtualxxxmatchxxxstring is compared against the CPE Match Criteria present on CVE applicability statements.\n\n limit (int): Custom argument to limit the number of results of the search. Allowed any number between 1 and 2000.\n\n delay (int): Can only be used if an API key is provided. This allows the user to define a delay. The delay must be greater than 0.6 seconds. The NVD API recommends scripts sleep for atleast 6 seconds in between requests.\n\n key (str): NVD API Key. Allows for the user to define a delay. NVD recommends scripts sleep 6 seconds in between requests. If no valid API key is provided, requests are sent with a 6 second delay.\n\n verbose (bool): Prints the URL request for debugging purposes.\n ",
"method": "",
"required_parameters": [],
"optional_parameters": [
{
"default": "None",
"description": ": Please do not confuse this with keywordSearch; this requires the argument to start with \"cpe\", whereas the keywordSearch argument allows for arbitrary keywords. This value will be compared agains the CPE Match Criteria within a CVE applicability statement. (i.e. find the vulnerabilities attached to that CPE). Partial match strings are allowed.",
"name": "cpexxxname",
"type": "None"
},
{
"default": "None",
"description": ": Please pass in a string integer, like \"1\" or \"30\". Returns a single CVE that already exists in the NVD.",
"name": "cvexxxid",
"type": "None"
},
{
"default": "None",
"description": ": This parameter returns only the CVEs that match the provided CVSSv2 vector string. Either full or partial vector strings may be used. This parameter cannot be used in requests that include cvssV3Metrics.",
"name": "cvssxxxv2xxxmetrics",
"type": "None"
},
{
"default": "None",
"description": ": Find vulnerabilities having a LOW, MEDIUM, or HIGH version 2 severity.",
"name": "cvssxxxv2xxxseverity",
"type": "None"
},
{
"default": "None",
"description": ": This parameter returns only the CVEs that match the provided CVSSv3 vector string. Either full or partial vector strings may be used. This parameter cannot be used in requests that include cvssV2Metrics.",
"name": "cvssxxxv3xxxmetrics",
"type": "None"
},
{
"default": "None",
"description": ": Find vulnerabilities having a LOW, MEDIUM, HIGH, or CRITICAL version 3 severity.",
"name": "cvssxxxv3xxxseverity",
"type": "None"
},
{
"default": "None",
"description": ": Please pass in a string integer, like \"1\" or \"30\". Filter collection by CWE (Common Weakness Enumeration) ID. You can find a list at https://cwe.mitre.org/. A CVE can have multiple CWE IDs assigned to it.",
"name": "cwexxxid",
"type": "None"
},
{
"default": "None",
"description": ": Returns CVE that contain a Technical Alert from US-CERT.",
"name": "hasxxxcertxxxalerts",
"type": "None"
},
{
"default": "None",
"description": ": Returns CVE that contain a Vulnerability Note from CERT/CC.",
"name": "hasxxxcertxxxnotes",
"type": "None"
},
{
"default": "None",
"description": ": Returns CVE that contain information from MITRE's Open Vulnerability and Assessment Language (OVAL) before this transitioned to the Center for Internet Security (CIS).",
"name": "hasxxxoval",
"type": "None"
},
{
"default": "None",
"description": ": Returns CVE associated with a specific CPE, where the CPE is also considered vulnerable. REQUIRES cpeName parameter. isVulnerable is not compatible with virtualMatchString parameter.",
"name": "isxxxvulnerable",
"type": "None"
},
{
"default": "None",
"description": ": When keywordSearch is used along with keywordExactmatch, it will search the NVD for CVEs containing exactly what was passed to keywordSearch. REQUIRES keywordSearch.",
"name": "keywordxxxexactxxxmatch",
"type": "None"
},
{
"default": "None",
"description": ": Searches CVEs where a word or phrase is found in the current description. If passing multiple keywords with a space character in between then each word must exist somewhere in the description, not necessarily together unless keywordExactMatch=True is passed to searchCVE.",
"name": "keywordxxxsearch",
"type": "None"
},
{
"default": "None",
"description": ": These parameters return only the CVEs that were last modified during the specified period. If a CVE has been modified more recently than the specified period, it will not be included in the response. If filtering by the last modified date, both lastModStartDate and lastModEndDate are REQUIRED. The maximum allowable range when using any date range parameters is 120 consecutive days.",
"name": "lastxxxmodxxxstartxxxdate",
"type": "None"
},
{
"default": "None",
"description": ": Required if using lastModStartDate.",
"name": "lastxxxmodxxxendxxxdate",
"type": "None"
},
{
"default": "None",
"description": ": Filters out all CVEs that are in a reject or rejected status. Searches without this parameter include rejected CVEs.",
"name": "noxxxrejected",
"type": "None"
},
{
"default": "None",
"description": ": These parameters return only the CVEs that were added to the NVD (i.e., published) during the specified period. If filtering by the published date, both pubStartDate and pubEndDate are REQUIRED. The maximum allowable range when using any date range parameters is 120 consecutive days.",
"name": "pubxxxstartxxxdate",
"type": "None"
},
{
"default": "None",
"description": ": Required if using pubStartDate.",
"name": "pubxxxendxxxdate",
"type": "None"
},
{
"default": "None",
"description": ": Returns CVE where the data source of the CVE is the value that is passed to sourceIdentifier.",
"name": "sourcexxxidentifier",
"type": "None"
},
{
"default": "None",
"description": ": Must be combined with versionEndType and virtualMatchString. Returns only the CVEs associated with CPEs in specific version ranges.",
"name": "versionxxxend",
"type": "None"
},
{
"default": "None",
"description": ": Must be combined with versionEnd and virtualMatchString. Valid values are including or excluding. Denotes to include the specified version in versionEnd, or exclude it.",
"name": "versionxxxendxxxtype",
"type": "None"
},
{
"default": "None",
"description": ": Must be combined with versionStartType and virtualMatchString. Returns only CVEs with specific versions. Requests that include versionStart cannot include a version component in the virtualMatchString.",
"name": "versionxxxstart",
"type": "None"
},
{
"default": "None",
"description": ": Must be combined with versionStart and virtualMatchString. Valid values are including or excluding. Denotes to include the specified version in versionStart, or exclude it.",
"name": "versionxxxstartxxxtype",
"type": "None"
},
{
"default": "None",
"description": ": A more broad filter compared to cpeName. The cpe match string that is passed to virtualMatchString is compared against the CPE Match Criteria present on CVE applicability statements.",
"name": "virtualxxxmatchxxxstring",
"type": "None"
},
{
"default": "None",
"description": ": Custom argument to limit the number of results of the search. Allowed any number between 1 and 2000.",
"name": "limit",
"type": "None"
},
{
"default": "None",
"description": ": Can only be used if an API key is provided. This allows the user to define a delay. The delay must be greater than 0.6 seconds. The NVD API recommends scripts sleep for atleast 6 seconds in between requests.",
"name": "delay",
"type": "None"
},
{
"default": "None",
"description": ": NVD API Key. Allows for the user to define a delay. NVD recommends scripts sleep 6 seconds in between requests. If no valid API key is provided, requests are sent with a 6 second delay.",
"name": "key",
"type": "None"
},
{
"default": "None",
"description": ": Prints the URL request for debugging purposes.",
"name": "verbose",
"type": "None"
}
]
},
{
"name": "searchxxxcxxxpxxxe",
"url": "",
"description": "\n Build and send GET request then return list of objects containing a collection of CPEs.\n\n Args:\n cpexxxnamexxxid (str): Returns a specific CPE record using its UUID. If a correctly formatted UUID is passed but it does not exist, it will return empty results. The UUID is the cpexxxnamexxxid value when searching CPE.\n\n cpexxxmatchxxxstring (str): Use a partial CPE name to search for other CPE names.\n\n keywordxxxexactxxxmatch (bool): Searches metadata within CPE title and reference links for an exact match of the phrase or word passed to it. Must be included with keywordxxxsearch.\n\n keywordxxxsearch (str): Returns CPE records where a word or phrase is found in the metadata title or reference links. Space characters act as an AND statement.\n\n lastxxxmodxxxstartxxxdate (str/datetime obj): CPE last modification start date. Maximum 120 day range. A start and end date is required. All times are in UTC 00:00. A datetime object or string can be passed as a date. NVDLib will automatically parse the datetime object into the correct format. String Example: \u20182020-06-28 00:00\u2019\n\n lastxxxmodxxxendxxxdate (str/datetime obj): CPE last modification end date. Maximum 120 day range. Must be included with lastxxxmodxxxstartxxxdate. Example: \u20182020-06-28 00:00\u2019\n\n limit (int): Limits the number of results of the search.\n\n key (str): NVD API Key. Allows for a request every 0.6 seconds instead of 6 seconds.\n\n delay (int): Can only be used if an API key is provided. The amount of time to sleep in between requests. Must be a value above 0.6 seconds if an API key is present. delay is set to 6 seconds if no API key is passed.\n\n verbose (bool): Prints the URL request for debugging purposes.\n ",
"method": "",
"required_parameters": [],
"optional_parameters": [
{
"default": "None",
"description": ": Returns a specific CPE record using its UUID. If a correctly formatted UUID is passed but it does not exist, it will return empty results. The UUID is the cpeNameId value when searching CPE.",
"name": "cpexxxnamexxxid",
"type": "None"
},
{
"default": "None",
"description": ": Use a partial CPE name to search for other CPE names.",
"name": "cpexxxmatchxxxstring",
"type": "None"
},
{
"default": "None",
"description": ": Searches metadata within CPE title and reference links for an exact match of the phrase or word passed to it. Must be included with keywordSearch.",
"name": "keywordxxxexactxxxmatch",
"type": "None"
},
{
"default": "None",
"description": ": Returns CPE records where a word or phrase is found in the metadata title or reference links. Space characters act as an AND statement.",
"name": "keywordxxxsearch",
"type": "None"
},
{
"default": "None",
"description": ": CPE last modification start date. Maximum 120 day range. A start and end date is required. All times are in UTC 00:00. A datetime object or string can be passed as a date. NVDLib will automatically parse the datetime object into the correct format. String Example: \u20182020-06-28 00:00\u2019",
"name": "lastxxxmodxxxstartxxxdate",
"type": "None"
},
{
"default": "None",
"description": ": CPE last modification end date. Maximum 120 day range. Must be included with lastModStartDate. Example: \u20182020-06-28 00:00\u2019",
"name": "lastxxxmodxxxendxxxdate",
"type": "None"
},
{
"default": "None",
"description": ": Limits the number of results of the search.",
"name": "limit",
"type": "None"
},
{
"default": "None",
"description": ": NVD API Key. Allows for a request every 0.6 seconds instead of 6 seconds.",
"name": "key",
"type": "None"
},
{
"default": "None",
"description": ": Can only be used if an API key is provided. The amount of time to sleep in between requests. Must be a value above 0.6 seconds if an API key is present. delay is set to 6 seconds if no API key is passed.",
"name": "delay",
"type": "None"
},
{
"default": "None",
"description": ": Prints the URL request for debugging purposes.",
"name": "verbose",
"type": "None"
}
]
}
]
} |
data/toolenv/tools/Customized/emailrep.json | {
"tool_description": "emailrep",
"tool_name": "emailrep",
"title": "emailrep",
"standardized_name": "emailrep",
"api_list": [
{
"name": "emailrep_post",
"url": "",
"description": "\nQuery an email address\n\nParameters\nemail (string, required): Email address being queried\n",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "Email address being queried",
"name": "email",
"type": "str"
}
],
"optional_parameters": []
},
{
"name": "emailrep_report",
"url": "",
"description": "\nReports an email address. Date of malicious activity defaults to the current time unless otherwise specified.\n\nParameters:\nemail (string, required): Email address being reported.\nkey (string, required): The API key of the user.\n",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "Email address being reported.",
"name": "email",
"type": "str"
},
{
"default": "None",
"description": "The API key of the user.",
"name": "key",
"type": "str"
}
],
"optional_parameters": []
}
]
} |
data/toolenv/tools/Customized/virustotal.json | {
"tool_description": "virustotal",
"tool_name": "virustotal",
"title": "virustotal",
"standardized_name": "virustotal",
"api_list": [
{
"name": "vt_get_dns_resolution_object",
"url": "",
"description": "\n This endpoint retrieves a Resolution object by its ID. A resolution object ID is made by appending the IP and the domain it resolves to together.\n\n Domain-IP resolutions. Resolution objects include the following attributes:\n date: <integer> date when the resolution was made (UTC timestamp).\n host_name: <string> domain or subdomain requested to the resolver.\n host_name_last_analysis_stats: <dictionary> last detection stats from the resolution's domain. Similar to the domains's last_analysis_stats attribute.\n ip_address: <string> IP address the domain was resolved to.\n ip_address_last_analysis_stats: <dictionary> last detection stats from the resolution's IP address. Similar to the IP address' last_analysis_stats attribute.\n resolver: <string> source of the resolution.\n\n Args:\n - id: string, required, Resolution object ID\n - x-apikey: string, required, Your API key\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "id",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": []
},
{
"name": "vt_get_objects_related_to_ip_address",
"url": "",
"description": "\n IP addresses have number of relationships to other objects. This returns ALL objects that fit the relationship.\n\n The relationships are documented here:\n - comments: The comments for the IP address. Returns a list of comments.\n - communicating_files: Files that communicate with the IP address. Returns a list of files.\n - downloaded_files: Files downloaded from the IP address. VT Enterprise users only. Returns a list of files.\n - graphs: Graphs including the IP address. Returns a list of graphs.\n - historical_ssl_certificates: SSL certificates associated with the IP. Returns a list of SSL certificates.\n - historical_whois: WHOIS information for the IP address. Retrurns a list of Whois attributes.\n - related_comments: Community posted comments in the IP's related objects. Returns a list of comments.\n - related_references: Returns the references related to the IP address. Returns a list of References.\n - related_threat_actors: Threat actors related to the IP address. Returns a list of threat actors.\n - referrer_files: Files containing the IP address. Returns a list of Files.\n - resolutions: Resolves the IP addresses. Returns a list of resolutions.\n - urls: Returns a list of URLs related to the IP address. Returns a list of URLs.\n\n Args:\n - ip, string, required, IP address\n - relationship, string, required, Relationship name (see the list of items from above)\n - x-apikey, string, required, Your API key\n - limit, int32, optional, Maximum number of comments to retrieve\n - cursor, string, optional, Continuation cursor\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "relationship",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": [
{
"default": null,
"description": "",
"name": "limit",
"type": "int"
},
{
"default": null,
"description": "",
"name": "cursor",
"type": "str"
}
]
},
{
"name": "vt_get_ip_address_report",
"url": "",
"description": "\n Retrieve an IP address report. These reports condense all of the recent activity that VirusTotal has seen for the resource under consideration, as well as contextual information about it.\n This function specifically generates these reports using the IP address parameter.\n\n Args:\n - ip: string, required, IP address\n - x-apikey: string, required, Your API key\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": []
},
{
"name": "vt_add_votes_to_ip_address",
"url": "",
"description": "\n With this function you can post a vote for a given file. The body for the POST request must be the JSON representation of a vote object. Note however that you don't need to provide an ID for the object, as they are automatically generated for new votes. The verdict attribute must have be either harmless or malicious.\n\n Please ensure that the JSON object you provide conforms accurately to valid JSON standards.\n\n Args:\n - ip, string, required, IP address\n - data, json, Vote object\n - x-apikey, string, required, Your API key\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "data",
"type": "dict"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": []
},
{
"name": "vt_get_domain_report",
"url": "",
"description": "\n Retrieves a domain report. These reports contain information regarding the domain itself that VirusTotal has collected.\n\n Args:\n - domain: string, required, Domain name\n - x-apikey: string, required, Your API key\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "domain",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": []
},
{
"name": "vt_get_comments_on_ip_address",
"url": "",
"description": "\n Retrieves the comments on a provided IP address. Returns a list of Comment objects.\n\n Args:\n - ip, string, required, IP address\n - x-apikey, string, required, Your API key\n - limit, int32, optional, Maximum number of comments to retrieve\n - cursor, string, optional, Continuation cursor\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": [
{
"default": null,
"description": "",
"name": "limit",
"type": "int"
},
{
"default": null,
"description": "",
"name": "cursor",
"type": "str"
}
]
},
{
"name": "vt_add_comment_to_ip_address",
"url": "",
"description": "\n With this function you can post a comment for a given IP address. The body for the POST request must be the JSON representation of a comment object. Notice however that you don't need to provide an ID for the object, as they are automatically generated for new comments.\n However, please note that you will need to provide a valid data JSON for using this function.\n\n Any word starting with # in your comment's text will be considered a tag, and added to the comment's tag attribute.\n\n Returns a Comment object.\n\n Args:\n - ip: string, required, IP address\n - data: json, required, A comment object\n - x-apikey: string, required, Your API key\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "data",
"type": "dict"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": []
},
{
"name": "vt_get_object_descriptors_related_to_ip_address",
"url": "",
"description": "\n This specifically returns related object's IDs (and context attributes, if any). Please note that this will not return all attributes.\n\n You are expected to provide the relationship to the object you're interested in. The valid relationships are as follows.\n\n The relationships are documented here:\n - comments: The comments for the IP address.\n - communicating_files: Files that communicate with the IP address.\n - downloaded_files: Files downloaded from the IP address. VT Enterprise users only.\n - graphs: Graphs including the IP address.\n - historical_ssl_certificates: SSL certificates associated with the IP.\n - historical_whois: WHOIS information for the IP address. Retrurns a list of Whois attributes.\n - related_comments: Community posted comments in the IP's related objects.\n - related_references: Returns the references related to the IP address.\n - related_threat_actors: Threat actors related to the IP address.\n - referrer_files: Files containing the IP address.\n - resolutions: Resolves the IP addresses.\n - urls: Returns a list of URLs related to the IP address.\n\n Here are some useful descriptions of the arguments in this API, with the format - name of this argument: type of the data, required or optional, description of this argument.\n - ip: string, required, IP address\n - relationship: string, required, Relationship name (see table)\n - x-apikey: string, required, Your API key\n - limit: int32, optional, Maximum number of comments to retrieve\n - cursor: string, optional, Continuation cursor\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "relationship",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": [
{
"default": null,
"description": "",
"name": "limit",
"type": "int"
},
{
"default": null,
"description": "",
"name": "cursor",
"type": "str"
}
]
},
{
"name": "vt_get_objects_related_to_domain",
"url": "",
"description": "\n Objects are a key concept in the VirusTotal API. Each object has an identifier and a type.\n Each object has an associated URL, and each domain is associated with objects.\n This function returns ALL of the objects related to the domain, based on the specified relationship.\n\n The following describe the valid relationship:\n - caa_records: Records CAA for the domain.\n - cname_records: Records CNAME for the domain.\n - comments: Community posted comments about the domain.\n - communicating_files: Files that communicate with the domain.\n - downloaded_files: Files downloaded from that domain.\n - graphs: All graphs that include the domain.\n - historical_ssl_certificates: SSL certificates associated with the domain.\n - historical_whois: WHOIS information for the domain.\n - immediate_parent: Domain's immediate parent.\n - mx_records: Records MX for the domain.\n - ns_records: Records NS for the domain.\n - parent: Domain's top parent.\n - referrer_files: Refers to any and all files that contain this domain.\n - related_comments: Community posted comments in the domain's related objects.\n - related_references: Refers to the References related to the domain.\n - related_threat_actors: Refers to the threat actors related to the domain. A list of Threat Actors.\n - resolutions: DNS resolutions for the domain.\n - soa_records: Records SOA for the domain.\n - siblings: Refers to the Domain's sibling domains.\n - subdomains: Refers to the Domain's subdomains.\n - urls: Refers to the URLs that contain this domain.\n - user_votes: Refers to the current user's votes.\n\n\n Args:\n - domain: string, required, Domain name\n - relationship, string, required, Relationship name (see table)\n - x-apikey, string, required, Your API key\n - limit, int32, optional, Maximum number of comments to retrieve\n - cursor, string, optional, Continuation cursor\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "domain",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "relationship",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": [
{
"default": null,
"description": "",
"name": "limit",
"type": "int"
},
{
"default": null,
"description": "",
"name": "cursor",
"type": "str"
}
]
},
{
"name": "vt_get_object_descriptors_related_to_domain",
"url": "",
"description": "\n This specifically returns related object's IDs (and context attributes, if any). Please note that this will not return all attributes. This will return objects relating to a domain.\n\n - caa_records: Records CAA for the domain.\n - cname_records: Records CNAME for the domain.\n - comments: Community posted comments about the domain.\n - communicating_files: Files that communicate with the domain.\n - downloaded_files: Files downloaded from that domain.\n - graphs: All graphs that include the domain.\n - historical_ssl_certificates: SSL certificates associated with the domain.\n - historical_whois: WHOIS information for the domain.\n - immediate_parent: Domain's immediate parent.\n - mx_records: Records MX for the domain.\n - ns_records: Records NS for the domain.\n - parent: Domain's top parent.\n - referrer_files: Refers to any and all files that contain this domain.\n - related_comments: Community posted comments in the domain's related objects.\n - related_references: Refers to the References related to the domain.\n - related_threat_actors: Refers to the threat actors related to the domain. A list of Threat Actors.\n - resolutions: DNS resolutions for the domain.\n - soa_records: Records SOA for the domain.\n - siblings: Refers to the Domain's sibling domains.\n - subdomains: Refers to the Domain's subdomains.\n - urls: Refers to the URLs that contain this domain.\n - user_votes: Refers to the current user's votes.\n\n Args:\n - domain: string, required, Domain name\n - relationship: string, required, Relationship name (see table)\n - x-apikey: string, required, Your API key\n - limit: int32, optional, Maximum number of comments to retrieve\n - cursor: string, optional, Continuation cursor\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "domain",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "relationship",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": [
{
"default": null,
"description": "",
"name": "limit",
"type": "int"
},
{
"default": null,
"description": "",
"name": "cursor",
"type": "str"
}
]
},
{
"name": "vt_get_comments_on_domain",
"url": "",
"description": "\n This function will retrieve comments on a specified domain.\n\n Args:\n - domain, string, required, Domain name\n - x-apikey, string, required, Your API key\n - limit, int32, optional, Maximum number of comments to retrieve\n - cursor, string, optional, Continuation cursor\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "domain",
"type": "str"
},
{
"default": "None",
"description": "",
"name": "x_apikey",
"type": "str"
}
],
"optional_parameters": [
{
"default": null,
"description": "",
"name": "limit",
"type": "int"
},
{
"default": null,
"description": "",
"name": "cursor",
"type": "str"
}
]
},
{
"name": "vt_get_votes_on_ip_address",
"url": "",
"description": "\n This function will retrieve votes on a provided IP address.\n\n Args:\n - ip: string, required, ip address\n ",
"method": "",
"required_parameters": [
{
"default": "None",
"description": "",
"name": "ip",
"type": "str"
}
],
"optional_parameters": []
}
]
} |
toolbench/inference/Downstream_tasks/rapidapi.py | # pylint: disable-all
"""
This is an exact copy of https://github.com/OpenBMB/ToolBench/blob/master/toolbench/inference/Downstream_tasks/rapidapi.py
except the output results are written to `results.txt`. (see line 688)
"""
import re
import os
import json
import time
import requests
from tqdm import tqdm
from termcolor import colored
import random
from toolbench.inference.LLM.chatgpt_function_model import ChatGPTFunction
from toolbench.inference.LLM.davinci_model import Davinci
from toolbench.inference.LLM.tool_llama_lora_model import ToolLLaMALoRA
from toolbench.inference.LLM.tool_llama_model import ToolLLaMA
from toolbench.inference.LLM.retriever import ToolRetriever
from toolbench.inference.Algorithms.single_chain import single_chain
from toolbench.inference.Algorithms.DFS import DFS_tree_search
from toolbench.inference.server import get_rapidapi_response
from toolbench.utils import standardize, change_name, replace_llama_with_condense
from toolbench.inference.Downstream_tasks.base_env import base_env
# For pipeline environment preparation
def get_white_list(tool_root_dir):
# print(tool_root_dir)
white_list_dir = os.path.join(tool_root_dir)
white_list = {}
for cate in tqdm(os.listdir(white_list_dir)):
if not os.path.isdir(os.path.join(white_list_dir, cate)):
continue
for file in os.listdir(os.path.join(white_list_dir, cate)):
if not file.endswith(".json"):
continue
standard_tool_name = file.split(".")[0]
# print(standard_tool_name)
with open(os.path.join(white_list_dir, cate, file)) as reader:
js_data = json.load(reader)
origin_tool_name = js_data["tool_name"]
white_list[standardize(origin_tool_name)] = {
"description": js_data["tool_description"],
"standard_tool_name": standard_tool_name,
}
return white_list
def contain(candidate_list, white_list):
output = []
for cand in candidate_list:
if cand not in white_list.keys():
return False
output.append(white_list[cand])
return output
# rapidapi env wrapper
class rapidapi_wrapper(base_env):
def __init__(self, query_json, tool_descriptions, retriever, args, process_id=0):
super(rapidapi_wrapper).__init__()
self.tool_root_dir = args.tool_root_dir
self.toolbench_key = args.toolbench_key
self.rapidapi_key = args.rapidapi_key
self.use_rapidapi_key = args.use_rapidapi_key
self.api_customization = args.api_customization
self.service_url = "http://8.218.239.54:8080/rapidapi"
self.max_observation_length = args.max_observation_length
self.observ_compress_method = args.observ_compress_method
self.retriever = retriever
self.process_id = process_id
self.tool_names = []
self.cate_names = []
self.input_description = query_json["query"]
self.functions = []
self.api_name_reflect = {}
if self.retriever is not None:
query_json = self.retrieve_rapidapi_tools(
self.input_description, args.retrieved_api_nums, args.tool_root_dir
)
data_dict = self.fetch_api_json(query_json)
tool_descriptions = self.build_tool_description(data_dict)
else:
data_dict = self.fetch_api_json(query_json)
for k, api_json in enumerate(data_dict["api_list"]):
standard_tool_name = tool_descriptions[k][0]
(
openai_function_json,
cate_name,
pure_api_name,
) = self.api_json_to_openai_json(api_json, standard_tool_name)
self.functions.append(openai_function_json)
self.api_name_reflect[openai_function_json["name"]] = pure_api_name
self.tool_names.append(standard_tool_name)
self.cate_names.append(cate_name)
finish_func = {
"name": "Finish",
"description": "If you believe that you have obtained a result that can answer the task, please call this function to provide the final answer. Alternatively, if you recognize that you are unable to proceed with the task in the current state, call this function to restart. Remember: you must ALWAYS call this function at the end of your attempt, and the only part that will be shown to the user is the final answer, so it should contain sufficient information.",
"parameters": {
"type": "object",
"properties": {
"return_type": {
"type": "string",
"enum": ["give_answer", "give_up_and_restart"],
},
"final_answer": {
"type": "string",
"description": 'The final answer you want to give the user. You should have this field if "return_type"=="give_answer"',
},
},
"required": ["return_type"],
},
}
self.functions.append(finish_func)
self.CALL_MAX_TIME = 3
self.task_description = f"""You should use functions to help handle the real time user querys. Remember:
1.ALWAYS call \"Finish\" function at the end of the task. And the final answer should contain enough information to show to the user,If you can't handle the task, or you find that function calls always fail(the function is not valid now), use function Finish->give_up_and_restart.
2.Do not use origin tool names, use only subfunctions' names.
You have access of the following tools:\n"""
unduplicated_reflection = {}
for standardize_tool_name, tool_des in tool_descriptions:
unduplicated_reflection[standardize_tool_name] = tool_des
for k, (standardize_tool_name, tool_des) in enumerate(
unduplicated_reflection.items()
):
striped = tool_des[:512].replace("\n", "").strip()
if striped == "":
striped = "None"
self.task_description += f"{k+1}.{standardize_tool_name}: {striped}\n"
self.success = 0
def build_tool_description(self, data_dict):
white_list = get_white_list(self.tool_root_dir)
origin_tool_names = [
standardize(cont["tool_name"]) for cont in data_dict["api_list"]
]
tool_des = contain(origin_tool_names, white_list)
tool_descriptions = [
[cont["standard_tool_name"], cont["description"]] for cont in tool_des
]
return tool_descriptions
def retrieve_rapidapi_tools(self, query, top_k, jsons_path):
retrieved_tools = self.retriever.retrieving(query, top_k=top_k)
query_json = {"api_list": []}
for tool_dict in retrieved_tools:
if len(query_json["api_list"]) == top_k:
break
category = tool_dict["category"]
tool_name = tool_dict["tool_name"]
api_name = tool_dict["api_name"]
if os.path.exists(jsons_path):
if os.path.exists(os.path.join(jsons_path, category)):
if os.path.exists(
os.path.join(jsons_path, category, tool_name + ".json")
):
query_json["api_list"].append(
{
"category_name": category,
"tool_name": tool_name,
"api_name": api_name,
}
)
return query_json
def fetch_api_json(self, query_json):
data_dict = {"api_list": []}
for item in query_json["api_list"]:
cate_name = item["category_name"]
tool_name = standardize(item["tool_name"])
api_name = change_name(standardize(item["api_name"]))
tool_json = json.load(
open(
os.path.join(self.tool_root_dir, cate_name, tool_name + ".json"),
"r",
)
)
append_flag = False
api_dict_names = []
for api_dict in tool_json["api_list"]:
api_dict_names.append(api_dict["name"])
pure_api_name = change_name(standardize(api_dict["name"]))
if pure_api_name != api_name:
continue
api_json = {}
api_json["category_name"] = cate_name
api_json["api_name"] = api_dict["name"]
api_json["api_description"] = api_dict["description"]
api_json["required_parameters"] = api_dict["required_parameters"]
api_json["optional_parameters"] = api_dict["optional_parameters"]
api_json["tool_name"] = tool_json["tool_name"]
data_dict["api_list"].append(api_json)
append_flag = True
break
if not append_flag:
print(api_name, api_dict_names)
return data_dict
def api_json_to_openai_json(self, api_json, standard_tool_name):
description_max_length = 256
templete = {
"name": "",
"description": "",
"parameters": {
"type": "object",
"properties": {},
"required": [],
"optional": [],
},
}
map_type = {"NUMBER": "integer", "STRING": "string", "BOOLEAN": "boolean"}
pure_api_name = change_name(standardize(api_json["api_name"]))
templete["name"] = pure_api_name + f"_for_{standard_tool_name}"
templete["name"] = templete["name"][-64:]
templete[
"description"
] = f'This is the subfunction for tool "{standard_tool_name}", you can use this tool.'
if api_json["api_description"].strip() != "":
tuncated_description = (
api_json["api_description"]
.strip()
.replace(api_json["api_name"], templete["name"])[
:description_max_length
]
)
templete["description"] = (
templete["description"]
+ f'The description of this function is: "{tuncated_description}"'
)
if (
"required_parameters" in api_json.keys()
and len(api_json["required_parameters"]) > 0
):
for para in api_json["required_parameters"]:
name = standardize(para["name"])
name = change_name(name)
if para["type"] in map_type:
param_type = map_type[para["type"]]
else:
param_type = "string"
prompt = {
"type": param_type,
"description": para["description"][:description_max_length],
}
default_value = para["default"]
if len(str(default_value)) != 0:
prompt = {
"type": param_type,
"description": para["description"][:description_max_length],
"example_value": default_value,
}
else:
prompt = {
"type": param_type,
"description": para["description"][:description_max_length],
}
templete["parameters"]["properties"][name] = prompt
templete["parameters"]["required"].append(name)
for para in api_json["optional_parameters"]:
name = standardize(para["name"])
name = change_name(name)
if para["type"] in map_type:
param_type = map_type[para["type"]]
else:
param_type = "string"
default_value = para["default"]
if len(str(default_value)) != 0:
prompt = {
"type": param_type,
"description": para["description"][:description_max_length],
"example_value": default_value,
}
else:
prompt = {
"type": param_type,
"description": para["description"][:description_max_length],
}
templete["parameters"]["properties"][name] = prompt
templete["parameters"]["optional"].append(name)
return templete, api_json["category_name"], pure_api_name
def check_success(self):
return self.success
def to_json(self):
return {}
def restart(self):
pass
def get_score(self):
return 0.0
def step(self, **args):
obs, code = self._step(**args)
if len(obs) > self.max_observation_length:
obs = obs[: self.max_observation_length] + "..."
return obs, code
def _step(self, action_name="", action_input=""):
"""Need to return an observation string and status code:
0 means normal response
1 means there is no corresponding api name
2 means there is an error in the input
3 represents the end of the generation and the final answer appears
4 means that the model decides to pruning by itself
5 represents api call timeout
6 for 404
7 means not subscribed
8 represents unauthorized
9 represents too many requests
10 stands for rate limit
11 message contains "error" field
12 error sending request
"""
if action_name == "Finish":
try:
json_data = json.loads(action_input, strict=False)
except:
json_data = {}
if '"return_type": "' in action_input:
if '"return_type": "give_answer"' in action_input:
return_type = "give_answer"
elif '"return_type": "give_up_and_restart"' in action_input:
return_type = "give_up_and_restart"
else:
return_type = action_input[
action_input.find('"return_type": "')
+ len('"return_type": "') : action_input.find('",')
]
json_data["return_type"] = return_type
if '"final_answer": "' in action_input:
final_answer = action_input[
action_input.find('"final_answer": "')
+ len('"final_answer": "') :
]
json_data["final_answer"] = final_answer
if "return_type" not in json_data.keys():
return '{error:"must have "return_type""}', 2
if json_data["return_type"] == "give_up_and_restart":
return '{"response":"chose to give up and restart"}', 4
elif json_data["return_type"] == "give_answer":
if "final_answer" not in json_data.keys():
return '{error:"must have "final_answer""}', 2
self.success = 1 # succesfully return final_answer
return '{"response":"successfully giving the final answer."}', 3
else:
return '{error:""return_type" is not a valid choice"}', 2
else:
for k, function in enumerate(self.functions):
if function["name"].endswith(action_name):
pure_api_name = self.api_name_reflect[function["name"]]
payload = {
"category": self.cate_names[k],
"tool_name": self.tool_names[k],
"api_name": pure_api_name,
"tool_input": action_input,
"strip": self.observ_compress_method,
"toolbench_key": self.toolbench_key,
}
if self.process_id == 0:
print(
colored(
f"query to {self.cate_names[k]}-->{self.tool_names[k]}-->{action_name}",
color="yellow",
)
)
if self.use_rapidapi_key or self.api_customization:
payload["rapidapi_key"] = self.rapidapi_key
response = get_rapidapi_response(
payload, api_customization=self.api_customization
)
else:
time.sleep(2) # rate limit: 30 per minute
headers = {"toolbench_key": self.toolbench_key}
response = requests.post(
self.service_url, json=payload, headers=headers, timeout=15
)
if response.status_code != 200:
return (
json.dumps(
{
"error": f"request invalid, data error. status_code={response.status_code}",
"response": "",
}
),
12,
)
try:
response = response.json()
except:
print(response)
return (
json.dumps(
{
"error": f"request invalid, data error",
"response": "",
}
),
12,
)
# 1 Hallucinating function names
# 4 means that the model decides to pruning by itself
# 5 represents api call timeout
# 6 for 404
# 7 means not subscribed
# 8 represents unauthorized
# 9 represents too many requests
# 10 stands for rate limit
# 11 message contains "error" field
# 12 error sending request
if response["error"] == "API not working error...":
status_code = 6
elif response["error"] == "Unauthorized error...":
status_code = 7
elif response["error"] == "Unsubscribed error...":
status_code = 8
elif response["error"] == "Too many requests error...":
status_code = 9
elif response["error"] == "Rate limit per minute error...":
print("Reach api calling limit per minute, sleeping...")
time.sleep(10)
status_code = 10
elif response["error"] == "Message error...":
status_code = 11
else:
status_code = 0
return json.dumps(response), status_code
# except Exception as e:
# return json.dumps({"error": f"Timeout error...{e}", "response": ""}), 5
return (
json.dumps(
{"error": f"No such function name: {action_name}", "response": ""}
),
1,
)
class pipeline_runner:
def __init__(self, args, add_retrieval=False, process_id=0, server=False):
self.args = args
self.add_retrieval = add_retrieval
self.process_id = process_id
self.server = server
if not self.server:
self.task_list = self.generate_task_list()
else:
self.task_list = []
def get_backbone_model(self):
args = self.args
if args.backbone_model == "toolllama":
# ratio = 4 means the sequence length is expanded by 4, remember to change the model_max_length to 8192 (2048 * ratio) for ratio = 4
replace_llama_with_condense(ratio=4)
if args.lora:
backbone_model = ToolLLaMALoRA(
base_name_or_path=args.model_path, model_name_or_path=args.lora_path
)
else:
backbone_model = ToolLLaMA(model_name_or_path=args.model_path)
else:
backbone_model = args.backbone_model
return backbone_model
def get_retriever(self):
return ToolRetriever(
corpus_tsv_path=self.args.corpus_tsv_path,
model_path=self.args.retrieval_model_path,
)
def get_args(self):
return self.args
def generate_task_list(self):
args = self.args
query_dir = args.input_query_file
answer_dir = args.output_answer_file
if not os.path.exists(answer_dir):
os.mkdir(answer_dir)
method = args.method
backbone_model = self.get_backbone_model()
white_list = get_white_list(args.tool_root_dir)
task_list = []
querys = json.load(open(query_dir, "r"))
for query_id, data_dict in enumerate(querys):
if "query_id" in data_dict:
query_id = data_dict["query_id"]
if "api_list" in data_dict:
origin_tool_names = [
standardize(cont["tool_name"]) for cont in data_dict["api_list"]
]
tool_des = contain(origin_tool_names, white_list)
if tool_des == False:
continue
tool_des = [
[cont["standard_tool_name"], cont["description"]]
for cont in tool_des
]
else:
tool_des = None
task_list.append(
(
method,
backbone_model,
query_id,
data_dict,
args,
answer_dir,
tool_des,
)
)
return task_list
def method_converter(
self,
backbone_model,
openai_key,
method,
env,
process_id,
single_chain_max_step=12,
max_query_count=60,
callbacks=None,
):
if callbacks is None:
callbacks = []
if backbone_model == "chatgpt_function":
model = "gpt-3.5-turbo-16k-0613"
llm_forward = ChatGPTFunction(model=model, openai_key=openai_key)
elif backbone_model == "davinci":
model = "text-davinci-003"
llm_forward = Davinci(model=model, openai_key=openai_key)
else:
model = backbone_model
llm_forward = model
if method.startswith("CoT"):
passat = int(method.split("@")[-1])
chain = single_chain(llm=llm_forward, io_func=env, process_id=process_id)
result = chain.start(
pass_at=passat, single_chain_max_step=single_chain_max_step, answer=1
)
elif method.startswith("DFS"):
pattern = r".+_w(\d+)"
re_result = re.match(pattern, method)
assert re_result != None
width = int(re_result.group(1))
with_filter = True
if "woFilter" in method:
with_filter = False
chain = DFS_tree_search(
llm=llm_forward, io_func=env, process_id=process_id, callbacks=callbacks
)
result = chain.start(
single_chain_max_step=single_chain_max_step,
tree_beam_size=width,
max_query_count=max_query_count,
answer=1,
with_filter=with_filter,
)
else:
print("invalid method")
raise NotImplementedError
return chain, result
def run_single_task(
self,
method,
backbone_model,
query_id,
data_dict,
args,
output_dir_path,
tool_des,
retriever=None,
process_id=0,
callbacks=None,
server=None,
):
if server is None:
server = self.server
if callbacks is None:
if server:
print("Warning: no callbacks are defined for server mode")
callbacks = []
splits = output_dir_path.split("/")
os.makedirs("/".join(splits[:-1]), exist_ok=True)
os.makedirs("/".join(splits), exist_ok=True)
output_file_path = os.path.join(output_dir_path, f"{query_id}_{method}.json")
if (not server) and os.path.exists(output_file_path):
return
[callback.on_tool_retrieval_start() for callback in callbacks]
env = rapidapi_wrapper(
data_dict, tool_des, retriever, args, process_id=process_id
)
[callback.on_tool_retrieval_end(tools=env.functions) for callback in callbacks]
query = data_dict["query"]
if process_id == 0:
print(
colored(
f"[process({process_id})]now playing {query}, with {len(env.functions)} APIs",
"green",
)
)
[
callback.on_request_start(
user_input=query,
method=method,
)
for callback in callbacks
]
chain, result = self.method_converter(
backbone_model=backbone_model,
openai_key=args.openai_key,
method=method,
env=env,
process_id=process_id,
single_chain_max_step=12,
max_query_count=200,
callbacks=callbacks,
)
[
callback.on_request_end(
chain=chain.terminal_node[0].messages,
outputs=chain.terminal_node[0].description,
)
for callback in callbacks
]
if output_dir_path is not None:
with open(output_file_path, "w") as writer:
data = chain.to_json(answer=True, process=True)
data["answer_generation"]["query"] = query
json.dump(data, writer, indent=2)
success = (
data["answer_generation"]["valid_data"]
and "give_answer" in data["answer_generation"]["final_answer"]
)
print(colored(f"[process({process_id})]valid={success}", "green"))
return result
def run(self):
task_list = self.task_list
random.seed(42)
random.shuffle(task_list)
print(f"total tasks: {len(task_list)}")
new_task_list = []
for task in task_list:
out_dir_path = task[-2]
query_id = task[2]
output_file_path = os.path.join(
out_dir_path, f"{query_id}_{self.args.method}.json"
)
if not os.path.exists(output_file_path):
new_task_list.append(task)
task_list = new_task_list
print(f"undo tasks: {len(task_list)}")
if self.add_retrieval:
retriever = self.get_retriever()
else:
retriever = None
for k, task in enumerate(task_list):
print(
f"process[{self.process_id}] doing task {k}/{len(task_list)}: real_task_id_{task[2]}"
)
"""
START Output query to `results.txt`
"""
import json, time
d_str = json.dumps(
{
"task_id": task[2],
"query": task[3]["query"],
"timestamp": time.time(),
}
)
with open("results.txt", "a+") as f:
f.write(f"========\n{d_str}\n")
"""
END Output query to `results.txt`
"""
result = self.run_single_task(
*task, retriever=retriever, process_id=self.process_id
)
|
toolbench/inference/server.py | # pylint: disable-all
"""
This is an exact copy of https://github.com/OpenBMB/ToolBench/blob/master/toolbench/inference/server.py
except the results are output to `results.txt` (see line 109)
"""
from pydantic import BaseModel
import json
import os
from typing import Union
from toolbench.utils import standardize, change_name
import random
class Info(BaseModel):
category: str
tool_name: str
api_name: str
tool_input: Union[str, dict]
strip: str
def prepare_tool_name_and_url(tools_root, info):
category = info.category
standard_category = category.replace(" ", "_").replace(",", "_").replace("/", "_")
while " " in standard_category or "," in standard_category:
standard_category = standard_category.replace(" ", "_").replace(",", "_")
standard_category = standard_category.replace("__", "_")
tool_name = info.tool_name
api_name = change_name(standardize(info.api_name))
if not tool_name.endswith(f"_for_{standard_category}"):
tool_name = standardize(info.tool_name)
code_string = f"""from {tools_root}.{standard_category}.{tool_name}.api import {api_name}"""
tool_name += f"_for_{standard_category}"
else:
tmp_tool_name = standardize(tool_name.replace(f"_for_{standard_category}", ""))
code_string = f"""from {tools_root}.{standard_category}.{tmp_tool_name}.api import {api_name}"""
return tool_name, standard_category, api_name, code_string
def process_error(response):
save_cache_flag = False
switch_flag = False
if (
"The request to the API has timed out. Please try again later, or if the issue persists"
in str(response)
):
return_dict = {
"error": "API temporarily not working error...",
"response": response,
}
if "Your Client (working) ---> Gateway (working) ---> API (not working)" in str(
response
):
return_dict = {"error": "API not working error...", "response": response}
elif "Unauthorized" in str(response) or "unauthorized" in str(response):
save_cache_flag = True
return_dict = {"error": "Unauthorized error...", "response": response}
elif "You are not subscribed to this API." in str(response):
switch_flag = True
return_dict = {"error": "Unsubscribed error...", "response": response}
elif "Too many requests" in str(response):
switch_flag = True
return_dict = {"error": "Too many requests error...", "response": response}
elif "You have exceeded" in str(response) or "you are being rate limited" in str(
response
):
switch_flag = True
return_dict = {"error": "Rate limit error...", "response": response}
elif (
"Access restricted. Check credits balance or enter the correct API key."
in str(response)
):
switch_flag = True
return_dict = {"error": "Rate limit error...", "response": response}
elif "Oops, an error in the gateway has occurred." in str(response):
switch_flag = True
return_dict = {"error": "Gateway error...", "response": response}
elif "Blocked User. Please contact your API provider." in str(response):
switch_flag = True
return_dict = {"error": "Blocked error...", "response": response}
elif "error" in str(response):
return_dict = {"error": "Message error...", "response": response}
else:
save_cache_flag = True
return_dict = {"error": "", "response": response}
return return_dict, save_cache_flag, switch_flag
def run(toolbench_code_string, toolbench_api_name, toolbench_input_params_str):
# get observation
success_flag = False
switch_flag = False
save_cache = False
exec(toolbench_code_string)
try:
eval_func_str = f"{toolbench_api_name}({toolbench_input_params_str})"
"""
START Output query to to `results.txt`
"""
import json, time
d_str = json.dumps({"function_call": eval_func_str, "timestamp": time.time()})
with open("results.txt", "a+") as f:
f.write(f"{d_str}\n")
"""
END Output query to to `results.txt`
"""
new_func = eval(eval_func_str)
response, save_cache, switch_flag = process_error(new_func)
success_flag = True
except Exception as e:
response = {
"error": f"Function executing {toolbench_code_string} error...\n{e}",
"response": "",
}
save_cache = False
return success_flag, switch_flag, response, save_cache
def dict_shorten(origin: dict, schema: dict):
for key, value in list(origin.items()):
if key not in schema:
del origin[key]
else:
if isinstance(value, dict):
dict_shorten(value, schema[key]) # schema[key] should be a dict
elif isinstance(value, list):
if value:
if isinstance(value[0], dict):
for item in value:
dict_shorten(
item, schema[key][0]
) # schema[key] should be a list with only one dict element
return origin
def observation_shorten(
schema_root, response_dict, category, tool_name, api_name, strip_method
):
print(random.random())
if strip_method == "filter" or (strip_method == "random" and random.random() > 0.5):
if isinstance(response_dict["response"], dict):
if os.path.exists(os.path.join(schema_root, category)):
if os.path.exists(
os.path.join(schema_root, category, tool_name + ".json")
):
schema_dicts = json.load(
open(
os.path.join(schema_root, category, tool_name + ".json"),
"r",
)
)
api_list = schema_dicts["api_list"]
schema = None
for schema_dict in api_list:
schema_api_name = change_name(standardize(schema_dict["name"]))
if (
schema_api_name == api_name
and len(schema_dict["schema"]) > 0
):
schema = schema_dict["schema"]
break
if schema is not None:
response_dict["response"] = dict_shorten(
response_dict["response"], schema
)
return str(response_dict["response"])
def get_rapidapi_response(
input_dict: dict,
api_customization: bool = False,
tools_root: str = "data.toolenv.tools",
schema_root: str = "data/toolenv/response_examples",
):
info = Info
info.category = input_dict["category"]
info.tool_name = input_dict["tool_name"]
info.api_name = input_dict["api_name"]
info.tool_input = input_dict["tool_input"]
info.strip = input_dict["strip"]
rapidapi_key = input_dict["rapidapi_key"]
tool_name, standard_category, api_name, code_string = prepare_tool_name_and_url(
tools_root, info
)
tool_input = info.tool_input
strip_method = info.strip
try:
tool_input = json.loads(tool_input)
except Exception as e:
if tool_input == "":
tool_input = {}
else:
print(f"Can not parse tool input into json: {tool_input}")
response_dict = {"error": f"Tool input parse error...\n", "response": ""}
return response_dict
input_params_str = ""
if len(tool_input) > 0:
for key, value in tool_input.items():
if isinstance(value, str):
input_params_str += f'{key}="{value}", '
else:
input_params_str += f"{key}={value}, "
if not api_customization:
input_params_str += f"toolbench_rapidapi_key='{rapidapi_key}'"
success_flag, switch_flag, response_dict, save_cache = run(
code_string, api_name, input_params_str
)
observation = observation_shorten(
schema_root,
response_dict,
standard_category,
tool_name.replace(f"_for_{standard_category}", ""),
api_name,
strip_method,
)
result = str(observation)[:2048]
return {"error": response_dict["error"], "response": result}
if __name__ == "__main__":
result = get_rapidapi_response(
{
"category": "Social",
"tool_name": "olato_quotes",
"api_name": "love_quote",
"tool_input": "{}",
"strip": "filter",
"rapidapi_key": "",
}
)
print(result)
|
README.md exists but content is empty.
- Downloads last month
- 7