code stringlengths 17 6.64M |
|---|
class RealTerminalExecute(FunctionTool):
name = 'TerminalExecute'
summary = 'Execute a terminal command and return the output. This command should follow proper syntax and be supported by the terminal environment.'
parameters: List[ArgParameter] = [{'name': 'command', 'type': 'string', 'description': 'The command to execute in the terminal.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'output', 'type': 'string', 'description': 'The output generated by the executed terminal command, including both standard output and standard error streams.'}, {'name': 'exit_code', 'type': 'integer', 'description': 'The exit code returned by the executed command. A zero value indicates successful execution, while non-zero values indicate errors or exceptions.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'command' parameter contains an invalid or malformed command, which results in a failed execution attempt."}]
_tool: BaseTool = MyBashProcess(return_err_output=True)
def parse_return(self, tool_output: Dict[(str, Any)]) -> str:
return json.dumps({'output': tool_output[0], 'exit_code': tool_output[1]})
def _runtool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return self._tool._run(tool_input['command'])
def _aruntool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return self._tool._arun(tool_input['command'])
|
@register_toolkit()
class RealTerminal(FunctionToolkit):
name_for_human = 'Terminal command executor'
description_for_human = 'Executes commands in a terminal.'
name_for_model = 'Terminal'
description_for_model = "Executes commands in a terminal on the user's local system. Use it to run valid terminal commands for tasks such as file management, system control, and more"
tool_classes = [RealTerminalExecute]
|
class RealPythonInterpreterExecute(FunctionTool):
name = 'PythonInterpreterExecute'
summary = 'Execute a Python script.'
parameters: List[ArgParameter] = [{'name': 'script', 'type': 'string', 'description': 'The python script to execute.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'result', 'type': 'string', 'description': 'The printed output of the script.'}]
exceptions: List[ArgException] = []
_tool: BaseTool = load_tools(['python_repl'])[0]
def parse_return(self, tool_output: str) -> str:
return json.dumps({'result': tool_output})
def _runtool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return self._tool._run(tool_input['script'])
def _aruntool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return self._tool._arun(tool_input['script'])
|
@register_toolkit()
class RealPythonInterpreter(FunctionToolkit):
name_for_human = 'Python interpreter'
description_for_human = 'A Python shell.'
name_for_model = 'PythonInterpreter'
description_for_model = 'A Python shell. Use it to execute python scripts. If you want to see the output of a value, you should print it out with `print(...)`.'
tool_classes = [RealPythonInterpreterExecute]
|
class RealWikipediaSearch(FunctionTool):
name = 'WikipediaSearch'
summary = 'Query the Wikipedia tool for a given query.'
parameters: List[ArgParameter] = [{'name': 'query', 'type': 'string', 'description': 'The query to search for.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'result', 'type': 'string', 'description': 'The summary of the Wikipedia article.'}]
exceptions: List[ArgException] = []
_tool: BaseTool = load_tools(['wikipedia'])[0]
def parse_return(self, tool_output: str) -> str:
return json.dumps({'result': tool_output})
def _runtool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return self._tool._run(tool_input['query'])
def _aruntool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return self._tool._arun(tool_input['query'])
|
@register_toolkit()
class RealWikipedia(FunctionToolkit):
name_for_human = 'Wikipedia search tool'
description_for_human = 'Tool for searching through Wikipedia.'
name_for_model = 'Wikipedia'
description_for_model = 'Tool for searching through Wikipedia. Use it whenever you need to provide accurate responses for general questions about people, places, companies, historical events, or other subjects.'
tool_classes = [RealWikipediaSearch]
|
class RealHumanAssistanceQuery(FunctionTool):
name = 'HumanAssistanceQuery'
summary = 'Ask the human a specific question'
parameters: List[ArgParameter] = [{'name': 'question', 'type': 'string', 'description': 'The question to ask.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'answer', 'type': 'string', 'description': 'The answer from the human.'}]
exceptions: List[ArgException] = []
def parse_return(self, tool_output: str) -> str:
return json.dumps({'answer': tool_output})
def _runtool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
print((('\n' + tool_input['question']) + '\n'))
return input(tool_input['question'])
def _aruntool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
return NotImplementedError('Human tool does not support async')
|
@register_toolkit()
class RealHuman(FunctionToolkit):
name_for_human = 'Human assistance'
description_for_human = 'Seek human assistance or guidance.'
name_for_model = 'HumanAssistance'
description_for_model = 'Seek human assistance or guidance. Use it when expert human or user input is necessary, e.g., when you need some human knowledge, user permission, user-specific information.'
tool_classes = [RealHumanAssistanceQuery]
|
def get_toolkit_dict():
return __TOOLKITS_DICT__
|
def toolkits_factory(name):
return __TOOLKITS_DICT__.get(name, None)
|
def register_toolkit(overwrite=None):
def register_function_fn(cls):
name = overwrite
if (name is None):
name = cls.__name__
if (name in __TOOLKITS_DICT__):
raise ValueError(f'Name {name} already registered!')
if (not issubclass(cls, BaseToolkit)):
raise ValueError(f'Class {cls} is not a subclass of {BaseToolkit}')
__TOOLKITS_DICT__[name] = cls
return cls
return register_function_fn
|
class FunctionTool(BaseTool):
'\n Function tool is defined according to our specifciation that resembles Python function docstring, see `tool_interface.md`.\n '
name: str = None
summary: str = None
parameters: List[ArgParameter] = None
returns: List[ArgReturn] = None
exceptions: List[ArgException] = None
description: str = None
def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)
if ((self.description is None) and self.summary):
self.description = self.create_description()
def create_description(self, detail_level='high') -> str:
if (detail_level not in ['none', 'low', 'medium', 'high']):
raise ValueError(f"detail_level must be one of 'none', 'low', 'medium', 'high'")
include_args_returns = (detail_level in ['low', 'medium', 'high'])
include_desc = (detail_level in ['medium', 'high'])
include_exceptions = (detail_level in ['high'])
def get_combined_desc(name, items):
prefix = f' {name}:'
item_strs = [create_str(item, include_desc=include_desc) for item in items]
if include_desc:
desc = (((prefix + '\n') + '\n'.join(item_strs)) + '\n')
else:
desc = (((prefix + ' ') + ', '.join(item_strs)) + '\n')
return desc
desc = (self.summary.rstrip('., ') + '\n')
if include_args_returns:
desc += get_combined_desc('Arguments', self.parameters)
desc += get_combined_desc('Returns', self.returns)
if include_exceptions:
desc += get_combined_desc('Exceptions', self.exceptions)
return desc
def parse_parameters(self, tool_input: str) -> Dict[(str, Any)]:
'Parse the input string into a dictionary of parameters'
params = load_dict(tool_input)
validate_inputs(self.parameters, params)
return params
@abstractmethod
def parse_return(self, tool_output: Dict[(str, Any)]) -> str:
'Parse the output dictionary into a string'
@abstractmethod
def _runtool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
'Run the tool'
@abstractmethod
def _aruntool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
'Run the tool asynchronously'
def _process(self, run_func: Callable, tool_input: str) -> str:
try:
inputs = self.parse_parameters(tool_input)
except Exception as e:
return f'Invalid Action Input: {e}'
outputs = run_func(inputs)
return self.parse_return(outputs)
def _run(self, tool_input: str) -> str:
return self._process(self._runtool, tool_input)
def _arun(self, tool_input: str) -> str:
return self._process(self._aruntool, tool_input)
|
class VirtualFunctionTool(FunctionTool):
'Virtual function tool that does not require implemented'
def __init__(self, name_prefix: str='', tool_spec: Dict[(str, Any)]={}, **kwargs):
super().__init__(**kwargs)
for (k, v) in tool_spec.items():
if (k == 'name'):
v = (name_prefix + v)
if (k not in self.__dict__):
raise ValueError(f'Invalid key {k} in tool spec')
setattr(self, k, v)
if (self.description is None):
self.description = self.create_description()
def parse_return(self, tool_output: Dict[(str, Any)]) -> str:
pass
def _runtool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
pass
def _aruntool(self, tool_input: Dict[(str, Any)]) -> Dict[(str, Any)]:
pass
|
class BaseToolkit():
'\n The toolkit consists of a collection of tools that are `BaseTool` objects.\n An example is a `Gmail` toolkit that may have multiple tool APIs, such as `Send`, `Read`, etc.\n '
name: str
tool_classes: List[Any]
def __init__(self):
self.tools = self.load_tools()
@abstractmethod
def load_tools(self) -> List[BaseTool]:
'Load the tools'
def _get_toolkit_summary(self) -> str:
name = self.toolkit_marker(self.name)
return f'''{name} toolkit: contain the following tool APIs:
'''
def create_description(self, detail_level: str) -> str:
desc = self._get_toolkit_summary()
for tool in self.tools:
tool_name = self.toolapi_marker(tool.name)
tool_desc = (tool.create_description(detail_level) if isinstance(tool, FunctionTool) else tool.description)
tool_desc = insert_indent(tool_desc, insert_first=False)
desc += f' * {tool_name}: {tool_desc}'
return desc
@property
def description(self) -> str:
return self.create_description('high')
@staticmethod
def toolkit_marker(s) -> str:
'Get the toolkit marker'
return f'<{s}>'
@staticmethod
def toolapi_marker(s) -> str:
'Get the tool API marker'
return s
def get_tool(self, tool_name: str) -> BaseTool:
'Get a tool by its name'
for tool in self.tools:
if (tool.name == tool_name):
return tool
raise ValueError(f'Tool {tool_name} does not exist in this toolkit')
def __getitem__(self, tool_name: str) -> BaseTool:
'Get a tool by its name'
return self.get_tool(tool_name)
def __contains__(self, tool_name: str) -> bool:
'Check if a tool exists in the toolkit'
for tool in self.tools:
if (tool.name == tool_name):
return True
return False
def __iter__(self):
'Iterate over the tools'
for tool in self.tools:
(yield tool)
def __len__(self):
'Get the number of tools'
return len(self.tools)
def __repr__(self):
'Get the representation of the toolkit'
return f'<Toolkit {self.name} with {len(self.tools)} tools>'
def __str__(self):
'Get the string representation of the toolkit'
return self.__repr__()
|
class FunctionToolkit(BaseToolkit):
'\n Function toolkit consists of a collection of tools that are `FunctionToolAPI` objects.\n Defined according to our specifciation that resembles OpenAPI spec, see `tool_interface.md`\n '
name_for_human: str
description_for_human: str
name_for_model: str
description_for_model: str
tool_classes: List[Any]
def __init__(self):
super().__init__()
self.name = self.name_for_model
def load_tools(self) -> List[BaseTool]:
'Load the tools'
return [tool_class() for tool_class in self.tool_classes]
def _get_toolkit_summary(self) -> str:
toolkit_name = self.toolkit_marker(self.name_for_model)
desc = f'''{toolkit_name}: {self.description_for_model}
'''
desc += f'''Tool APIs:
'''
return desc
|
class TerminalExecute(VirtualFunctionTool):
name = 'TerminalExecute'
summary = 'Execute a terminal command and return the output. This command should follow proper syntax and be supported by the terminal environment.'
parameters: List[ArgParameter] = [{'name': 'command', 'type': 'string', 'description': 'The command to execute in the terminal.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'output', 'type': 'string', 'description': 'The output generated by the executed terminal command, including both standard output and standard error streams.'}, {'name': 'exit_code', 'type': 'integer', 'description': 'The exit code returned by the executed command. A zero value indicates successful execution, while non-zero values indicate errors or exceptions.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'command' parameter contains an invalid or malformed command, which results in a failed execution attempt."}]
|
@register_toolkit()
class Terminal(FunctionToolkit):
name_for_human = 'Terminal command executor'
description_for_human = 'Executes commands in a terminal.'
name_for_model = 'Terminal'
description_for_model = "Executes commands in a terminal on the user's local system. Use it to run valid terminal commands for tasks such as file management, system control, and more"
tool_classes = [TerminalExecute]
|
class GmailSendEmail(VirtualFunctionTool):
name = 'GmailSendEmail'
summary = 'Send an email to one or multiple recipients, with optional scheduling, cc, and bcc.'
parameters: List[ArgParameter] = [{'name': 'to', 'type': 'string', 'description': 'A string of email addresses to send to, separated by commas.', 'required': True}, {'name': 'subject', 'type': 'string', 'description': 'The subject of the email.', 'required': True}, {'name': 'body', 'type': 'string', 'description': 'The body of the email.', 'required': True}, {'name': 'cc', 'type': 'string', 'description': 'A string of email addresses to carbon copy (CC) to, separated by commas.', 'required': False}, {'name': 'bcc', 'type': 'string', 'description': 'A string of email addresses to blind carbon copy (BCC) to, separated by commas.', 'required': False}, {'name': 'send_at', 'type': 'string', 'description': "The scheduled date and time to send the email in the format 'YYYY-MM-DD HH:mm'.", 'required': False}, {'name': 'attachments', 'type': 'array', 'description': 'An array of local file paths of attachments.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'An boolean value indicating whether the email was sent successfully.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The provided email address in 'to', 'cc', or 'bcc' is malformed, any file path in 'attachments' is invalid, or the 'send_at' is not in the correct format."}]
|
class GmailSearchEmails(VirtualFunctionTool):
name = 'GmailSearchEmails'
summary = 'Search for emails based on keywords, folders, labels, date range, or sender and recipient. If certain arguments are not provided, the corresponding filters are not applied.'
parameters: List[ArgParameter] = [{'name': 'keywords', 'type': 'array', 'description': 'The list of keywords to search for.', 'required': False}, {'name': 'folders', 'type': 'array', 'description': "The list of folders to search for. Each value should be a valid folder such as 'inbox', 'sent', 'drafts', or 'spam'.", 'required': False}, {'name': 'limit', 'type': 'integer', 'description': 'The maximum number of emails to retrieve. Default is 5.', 'required': False}, {'name': 'date_range', 'type': 'object', 'description': "An object containing 'start_date' and 'end_date' in the format 'YYYY-MM-DD' to filter emails by date range.", 'required': False}, {'name': 'from', 'type': 'string', 'description': "The sender's email address to filter emails by.", 'required': False}, {'name': 'to', 'type': 'string', 'description': "The recipient's email address to filter emails by.", 'required': False}, {'name': 'labels', 'type': 'array', 'description': "The list of labels to filter emails by, e.g. 'important'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'emails', 'type': 'array', 'description': "An array of at most 'limit' emails that match the search criteria, each containing the 'id', 'subject', 'from', 'to', and 'timestamp' (in the format 'YYYY-MM-DD HH:mm') of the email."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'limit' is negative or not an integer, the 'date_range' has incorrect date format, or the 'from' or 'to' email addresses are invalid."}]
|
class GmailReadEmail(VirtualFunctionTool):
name = 'GmailReadEmail'
summary = 'Read the content of an email, including attachments.'
parameters: List[ArgParameter] = [{'name': 'email_id', 'type': 'string', 'description': 'The unique identifier of the email.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'from', 'type': 'string', 'description': 'The email address the email was sent from.'}, {'name': 'to', 'type': 'string', 'description': 'A string of email addresses that the email was sent to, separated by commas.'}, {'name': 'cc', 'type': 'string', 'description': "A string of email addresses that the email was cc'ed to, separated by commas."}, {'name': 'bcc', 'type': 'string', 'description': "A string of email addresses that the email was bcc'ed to, separated by commas."}, {'name': 'subject', 'type': 'string', 'description': 'The subject of the email.'}, {'name': 'body', 'type': 'string', 'description': 'The body of the email.'}, {'name': 'timestamp', 'type': 'string', 'description': 'The timestamp of when the email was sent (YYYY-MM-DD hh:mm:ss).'}, {'name': 'folder', 'type': 'string', 'description': "The folder the email is in, such as 'inbox', 'sent', 'drafts', or 'spam'."}, {'name': 'labels', 'type': 'array', 'description': 'The labels of the email (e.g., `important`).'}, {'name': 'attachments', 'type': 'array', 'description': 'An array of objects with attachment names and ids (attachment_id).'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'email_id' is not found."}]
|
class GmailOrganizeEmail(VirtualFunctionTool):
name = 'GmailOrganizeEmail'
summary = 'Move an email to a specific folder or update its labels.'
parameters: List[ArgParameter] = [{'name': 'email_id', 'type': 'string', 'description': 'The unique identifier of the email.', 'required': True}, {'name': 'folder', 'type': 'string', 'description': "The folder to move the email to, such as 'inbox', 'sent', 'drafts', or 'spam'.", 'required': False}, {'name': 'labels', 'type': 'array', 'description': "A list of updated labels of the email, e.g. 'important'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'A boolean indicating whether the operation was successful.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'email_id' is not found."}, {'name': 'InvalidRequestException', 'description': "The 'folder' is invalid."}]
|
class GmailDeleteEmails(VirtualFunctionTool):
name = 'GmailDeleteEmails'
summary = 'Delete one or multiple emails from the mailbox.'
parameters: List[ArgParameter] = [{'name': 'email_ids', 'type': 'array', 'description': 'An array of unique identifiers of the emails to be deleted.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'A boolean indicating whether the operation was successful.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "One or more 'email_ids' are not found."}]
|
class GmailAddOrUpdateContact(VirtualFunctionTool):
name = 'GmailAddOrUpdateContact'
summary = "Add a new contact to the contact list or update an existing contact's information."
parameters: List[ArgParameter] = [{'name': 'contact_id', 'type': 'string', 'description': 'The unique identifier of the contact. If not provided, a new contact will be added.', 'required': False}, {'name': 'name', 'type': 'string', 'description': "The name of the contact. Required when 'contact_id' is not provided.", 'required': False}, {'name': 'email', 'type': 'string', 'description': "The email address of the contact. Required when 'contact_id' is not provided.", 'required': False}, {'name': 'remark', 'type': 'string', 'description': 'An optional remark or label for the contact.', 'required': False}, {'name': 'info', 'type': 'object', 'description': "An object containing additional contact information, such as 'phone' and 'address'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'contact_id', 'type': 'string', 'description': 'The unique identifier of the added or updated contact.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'name' or 'email' is empty when 'contact_id' is not provided, or the 'email' is an invalid email address."}, {'name': 'NotFoundException', 'description': "The provided 'contact_id' is not found."}, {'name': 'ConflictException', 'description': 'A contact with the same email address already exists when adding a new contact or updating an existing contact with a new email address.'}]
|
class GmailDeleteContact(VirtualFunctionTool):
name = 'GmailDeleteContact'
summary = 'Delete a contact from the contact list.'
parameters: List[ArgParameter] = [{'name': 'contact_id', 'type': 'string', 'description': 'The unique identifier of the contact.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'A boolean indicating whether the operation was successful.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'contact_id' is not found."}]
|
class GmailSearchContacts(VirtualFunctionTool):
name = 'GmailSearchContacts'
summary = 'Search for contacts based on filters. If certain arguments are not provided, the corresponding filters are not applied.'
parameters: List[ArgParameter] = [{'name': 'name', 'type': 'string', 'description': 'The name of the contact to search for.', 'required': False}, {'name': 'email', 'type': 'string', 'description': 'The email of the contact to search for.', 'required': False}, {'name': 'remark', 'type': 'string', 'description': 'The remark of the contact to search for.', 'required': False}, {'name': 'limit', 'type': 'integer', 'description': 'The maximum number of search results to return. Default is 5.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'contacts', 'type': 'array', 'description': "An array of contact objects containing contact information, each object includes 'contact_id', 'name', 'email', 'remark', and 'info'."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'limit' is negative or not an integer."}]
|
class GmailDownloadAttachment(VirtualFunctionTool):
name = 'GmailDownloadAttachment'
summary = 'Download attachments using their ids.'
parameters: List[ArgParameter] = [{'name': 'attachment_ids', 'type': 'array', 'description': 'The unique identifiers of the attachments.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'attachment_paths', 'type': 'array', 'description': 'The local file paths of the downloaded attachments.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "One or multiple 'attachment_ids' do not exist."}]
|
@register_toolkit()
class Gmail(FunctionToolkit):
name_for_human = 'Gmail'
description_for_human = 'Tool for managing emails and contacts in Gmail.'
name_for_model = 'Gmail'
description_for_model = 'Tool for managing emails and contacts in Gmail. Use it to send, search, read, organize, and delete emails, as well as manage and search contacts.'
tool_classes = [GmailSendEmail, GmailSearchEmails, GmailReadEmail, GmailOrganizeEmail, GmailDeleteEmails, GmailAddOrUpdateContact, GmailDeleteContact, GmailSearchContacts, GmailDownloadAttachment]
|
class GoogleCalendarCreateOrUpdateEvent(VirtualFunctionTool):
name = 'GoogleCalendarCreateOrUpdateEvent'
summary = 'Create a new event or update an existing event in the calendar.'
parameters: List[ArgParameter] = [{'name': 'event_id', 'type': 'string', 'description': 'The unique identifier of the event to be updated. If not provided, a new event will be created.', 'required': False}, {'name': 'event_name', 'type': 'string', 'description': 'The name of the event. Required when creating a new event.', 'required': False}, {'name': 'content', 'type': 'string', 'description': 'The content of the event.', 'required': False}, {'name': 'start_time', 'type': 'string', 'description': 'The start time of the event in ISO 8601 format. Required when creating a new event.', 'required': False}, {'name': 'end_time', 'type': 'string', 'description': 'The end time of the event in ISO 8601 format. Required when creating a new event.', 'required': False}, {'name': 'timezone', 'type': 'string', 'description': 'The timezone of the event, e.g. UTC-04:00.', 'required': False}, {'name': 'location', 'type': 'string', 'description': 'The location of the event.', 'required': False}, {'name': 'attendees', 'type': 'array', 'description': 'An array of email addresses of the attendees.', 'required': False}, {'name': 'recurrence', 'type': 'string', 'description': 'The recurrence of the event in Google Calendar format. For instance, use `RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO` to set the event to repeat every week on Monday.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'event_id', 'type': 'string', 'description': 'The unique identifier of the created or updated event.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': 'The start_time is later than the end_time, the format of start_time, end_time or recurrence is incorrect, or start_time, end_time and event_name are not provided when creating a new event.'}, {'name': 'NotFoundException', 'description': 'The provided event_id does not exist.'}]
|
class GoogleCalendarDeleteEvents(VirtualFunctionTool):
name = 'GoogleCalendarDeleteEvents'
summary = 'Delete a list of events from the calendar.'
parameters: List[ArgParameter] = [{'name': 'event_ids', 'type': 'array', 'description': 'The unique identifiers of the events to be deleted.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Indicates whether the events was successfully deleted.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "One or multiple 'event_ids' do not exist."}]
|
class GoogleCalendarReadEvents(VirtualFunctionTool):
name = 'GoogleCalendarReadEvents'
summary = 'Read events by event_ids.'
parameters: List[ArgParameter] = [{'name': 'event_ids', 'type': 'array', 'description': 'An array of unique event identifiers to read events.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'event_details', 'type': 'array', 'description': 'An array of objects, each containing the details of an event, including event_id, event_name, content, start_time, end_time, timezone, location, organizer, attendees, and recurrence.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "One or multiple 'event_ids' do not exist."}]
|
class GoogleCalendarSearchEvents(VirtualFunctionTool):
name = 'GoogleCalendarSearchEvents'
summary = 'Search events by keywords, date range, or attendees. If certain arguments are not provided, the corresponding filters are not applied.'
parameters: List[ArgParameter] = [{'name': 'keywords', 'type': 'array', 'description': 'A list of keywords to search for.', 'required': False}, {'name': 'start_date', 'type': 'string', 'description': 'The start date of the date range in ISO 8601 format.', 'required': False}, {'name': 'end_date', 'type': 'string', 'description': 'The end date of the date range in ISO 8601 format.', 'required': False}, {'name': 'attendees', 'type': 'array', 'description': 'An array of email addresses of the attendees to search for.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'event_ids', 'type': 'array', 'description': 'An array of unique identifiers of the searched events.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': 'The start_date and end_date are not formatted correctly, or start_date is later than the end_date.'}]
|
class GoogleCalendarSendInvitations(VirtualFunctionTool):
name = 'GoogleCalendarSendInvitations'
summary = 'Send event invitations to attendees.'
parameters: List[ArgParameter] = [{'name': 'event_id', 'type': 'string', 'description': 'The unique identifier of the event.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Indicates whether the invitations were successfully sent.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': 'The event_id does not exist.'}]
|
class GoogleCalendarSetReminder(VirtualFunctionTool):
name = 'GoogleCalendarSetReminder'
summary = 'Set or update a reminder for an event.'
parameters: List[ArgParameter] = [{'name': 'event_id', 'type': 'string', 'description': 'The unique identifier of the event.', 'required': True}, {'name': 'reminder_time', 'type': 'string', 'description': 'The reminder time in ISO 8601 format.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Indicates whether the reminder was successfully set.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': 'The event_id does not exist.'}, {'name': 'InvalidRequestException', 'description': 'The reminder_time is later than the event start_time.'}]
|
class GoogleCalendarGetEventsFromSharedCalendar(VirtualFunctionTool):
name = 'GoogleCalendarGetEventsFromSharedCalendar'
summary = "Get events from other users' shared calendar."
parameters: List[ArgParameter] = [{'name': 'email', 'type': 'string', 'description': 'The email of the user who shared the calendar.', 'required': True}, {'name': 'start_date', 'type': 'string', 'description': 'The start date to retrieve events in ISO 8601 format.', 'required': True}, {'name': 'end_date', 'type': 'string', 'description': 'The end date to retrieve events in ISO 8601 format.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'event_blocks', 'type': 'array', 'description': "An array of objects containing the event blocks without any details, each containing the event_name ('busy'), start_time, and end_time. It is an empty array if the user of the specified email address does not share their calendar."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': 'The start_date and end_date are not formatted correctly, or start_date is later than the end_date.'}]
|
@register_toolkit()
class GoogleCalendar(FunctionToolkit):
name_for_human = 'Google Calendar management tool'
description_for_human = 'Tool for managing Google Calendar events.'
name_for_model = 'GoogleCalendar'
description_for_model = 'Tool for managing Google Calendar events, including creating, deleting, updating, searching, setting reminders, and sharing the calendar with other users.'
tool_classes = [GoogleCalendarCreateOrUpdateEvent, GoogleCalendarDeleteEvents, GoogleCalendarReadEvents, GoogleCalendarSearchEvents, GoogleCalendarSendInvitations, GoogleCalendarSetReminder, GoogleCalendarGetEventsFromSharedCalendar]
|
class BankManagerGetAccountInformation(VirtualFunctionTool):
name = 'BankManagerGetAccountInformation'
summary = 'Retrieve information (e.g., account number or balance) about an account that belongs to the User. '
parameters: List[ArgParameter] = [{'name': 'account_type', 'type': 'string', 'description': "The account type, one of ['checking', 'savings', 'mutual fund TFSA', 'mutual fund non-registered', 'self-directed TFSA', 'self-directed non-registered', 'mortgage', 'credit_card'].", 'required': True}]
returns: List[ArgReturn] = [{'name': 'accounts', 'type': 'array', 'description': "A list of objects containing information about accounts of the specified account type, including details like account number (in the format 'XXX-XXXX-XXXX'), type, balance, and status. Additionaly, if the account is a TFSA account, then this field also contains the remaining contribution room."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'account_type' parameter is not one of ['checking', 'savings', 'mutual fund TFSA', 'mutual fund non-registered', 'self-directed TFSA', 'self-directed non-registered', 'mortgage', 'credit_card']."}]
|
class BankManagerTransferFunds(VirtualFunctionTool):
name = 'BankManagerTransferFunds'
summary = 'Transfer funds between two accounts.'
parameters: List[ArgParameter] = [{'name': 'from_account_number', 'type': 'string', 'description': "The user's bank account number to transfer funds from, in the format 'XXX-XXXX-XXXX'.", 'required': True}, {'name': 'to_account_number', 'type': 'string', 'description': "The bank account number to transfer funds to, in the format 'XXX-XXXX-XXXX'.", 'required': True}, {'name': 'amount', 'type': 'number', 'description': 'The amount to transfer, must be positive.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the transfer was successful.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'from_account_number' or 'to_account_number' parameter is not in the correct format, the 'from_account_number' is not owned by the user, or the 'amount' parameter is not positive."}]
|
class BankManagerSearchPayee(VirtualFunctionTool):
name = 'BankManagerSearchPayee'
summary = 'Search for a payee by keywords.'
parameters: List[ArgParameter] = [{'name': 'keywords', 'type': 'array', 'description': 'A list of keywords to search for in the payee name.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'payees', 'type': 'array', 'description': "A list of dictionaries containing the payee_id (in the format 'P-XXXXXX') and payee_name of each matching payee."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'keywords' parameter is empty or contains invalid characters."}]
|
class BankManagerPayBill(VirtualFunctionTool):
name = 'BankManagerPayBill'
summary = 'Pay a bill to a specified payee with your service acccount number.'
parameters: List[ArgParameter] = [{'name': 'from_account_number', 'type': 'string', 'description': "The user's bank account number used for paying the bill in the format 'XXX-XXXX-XXXX'.", 'required': True}, {'name': 'payee_id', 'type': 'string', 'description': "The unique identifier of the payee in the format 'P-XXXXXX'.", 'required': True}, {'name': 'service_account_number', 'type': 'string', 'description': 'Your account number assigned by the service provider, which helps the provider identify transactions related to that specific customer.', 'required': True}, {'name': 'payment_date', 'type': 'string', 'description': "The date the payment should be paid, in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'amount', 'type': 'number', 'description': 'The amount to pay, must be positive.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the bill payment was successful.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'from_account_number' parameter is not in the correct format, the 'from_account_number' is not owned by the user, the 'payee_id' is invalid, or the 'amount' parameter is not positive."}]
|
class BankManagerGetAccountStatement(VirtualFunctionTool):
name = 'BankManagerGetAccountStatement'
summary = 'Retrieve an account statement for a specified period.'
parameters: List[ArgParameter] = [{'name': 'account_number', 'type': 'string', 'description': "The user's bank account number in the format 'XXX-XXXX-XXXX'.", 'required': True}, {'name': 'start_date', 'type': 'string', 'description': "The start date of the transaction history in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'end_date', 'type': 'string', 'description': "The end date of the transaction history in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'download', 'type': 'boolean', 'description': 'Whether to download the statement as a CSV file. Default is false.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'transactions', 'type': 'array', 'description': 'A list of dictionaries containing the date, description, amount, and balance of each transaction.'}, {'name': 'statement_file_path', 'type': 'string', 'description': "The file path of the downloaded statement file. When 'download' is false, this is an empty string."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'account_number' parameter is not in the correct format, or the 'start_date' or 'end_date' parameter is not in the correct format."}]
|
class BankManagerSearchTransactions(VirtualFunctionTool):
name = 'BankManagerSearchTransactions'
summary = 'Search transactions by keyword or amount range. If certain arguments are not provided, the corresponding filters are not applied.'
parameters: List[ArgParameter] = [{'name': 'account_number', 'type': 'string', 'description': "The account number in the format 'XXX-XXXX-XXXX'.", 'required': True}, {'name': 'keyword', 'type': 'string', 'description': 'The keyword to search for in the transaction description.', 'required': False}, {'name': 'min_amount', 'type': 'number', 'description': 'The minimum transaction amount to search for.', 'required': False}, {'name': 'max_amount', 'type': 'number', 'description': 'The maximum transaction amount to search for.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'transactions', 'type': 'array', 'description': 'A list of dictionaries containing the date, description, amount, and balance of each matching transaction.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'account_number' parameter is not in the correct format, or the 'min_amount' and 'max_amount' parameters are not valid."}]
|
@register_toolkit()
class BankManager(FunctionToolkit):
name_for_human = 'Bank Manager'
description_for_human = 'Toolkit for managing personal online banking tasks.'
name_for_model = 'BankManager'
description_for_model = 'A comprehensive toolkit for managing personal online banking tasks, such as viewing account information, transferring funds, searching for payees, paying bills, searching transaction history, and retriving statements.'
tool_classes = [BankManagerGetAccountInformation, BankManagerTransferFunds, BankManagerSearchPayee, BankManagerPayBill, BankManagerGetAccountStatement, BankManagerSearchTransactions]
|
class AmazonSearchProducts(VirtualFunctionTool):
name = 'AmazonSearchProducts'
summary = 'Search for products based on keywords.'
parameters: List[ArgParameter] = [{'name': 'search_keywords', 'type': 'array', 'description': 'A list of keywords to search for in the product name.', 'required': True}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of search results to return. Default is 5, maximum is 10.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'products', 'type': 'array', 'description': "A list of objects containing the keys 'product_id' (string), 'name' (string), 'description' (string) and 'price' (number). The 'product_id' is a unique identifier of the product."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'search_keywords' parameter is empty or contains invalid characters."}]
|
class AmazonGetProductDetails(VirtualFunctionTool):
name = 'AmazonGetProductDetails'
summary = 'Retrieve detailed information about a product.'
parameters: List[ArgParameter] = [{'name': 'product_id', 'type': 'string', 'description': 'The unique identifier of the product.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'product_details', 'type': 'object', 'description': "An object containing 'name' (string), 'description' (string), 'price' (number), 'rating' (integer from 0 to 5), and 'reviews' (an array of objects, each object contains 'reviewer_name' (string), 'review_date' (string, format: 'YYYY-MM-DD'), 'review_content' (string))."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The product with the specified 'product_id' was not found."}]
|
class AmazonAddToCart(VirtualFunctionTool):
name = 'AmazonAddToCart'
summary = 'Add a product to the shopping cart.'
parameters: List[ArgParameter] = [{'name': 'product_id', 'type': 'string', 'description': 'The unique identifier of the product.', 'required': True}, {'name': 'quantity', 'type': 'integer', 'description': 'The quantity of the product to add.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the addition was successful.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The product with the specified 'product_id' was not found."}, {'name': 'ConflictException', 'description': 'The product is already in the cart.'}]
|
class AmazonViewCart(VirtualFunctionTool):
name = 'AmazonViewCart'
summary = 'View the contents of the shopping cart.'
parameters: List[ArgParameter] = []
returns: List[ArgReturn] = [{'name': 'cart_contents', 'type': 'array', 'description': "A list of objects, each containing 'product_id' (string), 'product_name' (string), 'quantity' (integer), 'price' (number), and 'subtotal' (number, in USD)."}, {'name': 'total_price', 'type': 'number', 'description': 'The total price of the shopping cart, in USD.'}]
exceptions: List[ArgException] = []
|
class AmazonRemoveFromCart(VirtualFunctionTool):
name = 'AmazonRemoveFromCart'
summary = 'Remove a list of products from the shopping cart entirely, regardless of the quantity.'
parameters: List[ArgParameter] = [{'name': 'product_ids', 'type': 'array', 'description': 'The unique identifiers of the products to remove.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the removal was successful.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "one or more of the products with the specified 'product_ids' was not found."}]
|
class AmazonPlaceOrder(VirtualFunctionTool):
name = 'AmazonPlaceOrder'
summary = 'Place an order for the products in the shopping cart, using the specified shipping address and payment method. The shopping cart is emptied after the order is placed.'
parameters: List[ArgParameter] = [{'name': 'shipping_address', 'type': 'object', 'description': "The shipping address, containing 'name' (string), 'phone_number' (string) and 'address' (string).", 'required': True}, {'name': 'payment_method', 'type': 'object', 'description': "The payment method, containing 'card_number' (string), 'expiry_date' (string, format: 'MM/YY'), 'cvv' (string).", 'required': True}]
returns: List[ArgReturn] = [{'name': 'order_id', 'type': 'string', 'description': 'The unique identifier of the placed order.'}, {'name': 'total_price', 'type': 'string', 'description': 'The total price of the order, in USD.'}, {'name': 'order_contents', 'type': 'array', 'description': "A list of objects, each containing 'product_id' (string), 'product_name' (string), 'quantity' (integer) and 'subtotal' (string, in USD)."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The fields in 'shipping_address' or 'payment_method' are invalid. Or the shopping cart is empty."}, {'name': 'AuthorizationException', 'description': 'Payment authorization failed.'}]
|
class AmazonSearchOrderHistory(VirtualFunctionTool):
name = 'AmazonSearchOrderHistory'
summary = "Search the user's order history."
parameters: List[ArgParameter] = [{'name': 'search_keywords', 'type': 'array', 'description': 'A list of keywords to search for in the order history.', 'required': True}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of search results to return. Default is 10.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'orders', 'type': 'array', 'description': "A list of objects, each containing 'order_id', 'order_timestamp' (format: 'YYYY-MM-DD:HH:MM:SS'), 'order_status' (one of ['pending', 'shipped', 'delivered'])."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'search_keywords' parameter is empty or contains invalid characters."}]
|
class AmazonViewOrderDetails(VirtualFunctionTool):
name = 'AmazonViewOrderDetails'
summary = 'View the details of an order, including shipment and payment information.'
parameters: List[ArgParameter] = [{'name': 'order_id', 'type': 'string', 'description': 'The unique identifier of the order.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'order_timestamp', 'type': 'string', 'description': "The time the order was placed. Format: 'YYYY-MM-DD:HH:MM:SS'."}, {'name': 'order_status', 'type': 'string', 'description': "The status of the order, one of ['pending', 'shipped', 'delivered']."}, {'name': 'order_contents', 'type': 'array', 'description': "A list of objects, each containing 'product_id', 'product_name' and 'quantity'."}, {'name': 'shipment_details', 'type': 'object', 'description': "An object containing 'tracking_number', 'carrier', 'arrival_date' (for delivered orders) or 'estimated_arrival_date' (for pending or shipped orders), and 'shipping_address'."}, {'name': 'payment_details', 'type': 'object', 'description': "An object containing 'card_number', and 'amount_paid'."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The order with the specified 'order_id' was not found."}]
|
class AmazonManageWishlist(VirtualFunctionTool):
name = 'AmazonManageWishlist'
summary = "Add, remove, or view items in the user's wish list."
parameters: List[ArgParameter] = [{'name': 'action', 'type': 'string', 'description': "The action to perform, one of ['add', 'remove', 'view'].", 'required': True}, {'name': 'product_id', 'type': 'string', 'description': "The unique identifier of the product, needed for 'add' and 'remove' actions.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'result', 'type': 'object', 'description': "An object containing 'success' (boolean) indicating whether the action was successful, and 'wishlist_contents' (array of objects, each object contains the product identifiers and name in the wishlist, only for 'view' action)."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The product with the specified 'product_id' was not found for 'remove' action."}, {'name': 'ConflictException', 'description': "The product is already in the wishlist for 'add' action."}]
|
class AmazonViewSavedAddresses(VirtualFunctionTool):
name = 'AmazonViewSavedAddresses'
summary = "View the user's saved addresses."
parameters: List[ArgParameter] = []
returns: List[ArgReturn] = [{'name': 'addresses', 'type': 'array', 'description': "A list of objects, each containing 'remark', 'name', 'phone_number' and 'address'."}]
exceptions: List[ArgException] = []
|
class AmazonViewSavedPaymentMethods(VirtualFunctionTool):
name = 'AmazonViewSavedPaymentMethods'
summary = "View the user's saved payment methods."
parameters: List[ArgParameter] = []
returns: List[ArgReturn] = [{'name': 'payment_methods', 'type': 'array', 'description': "A list of objects, each containing 'card_number', 'expiry_date', 'cvv'."}]
exceptions: List[ArgException] = []
|
class AmazonPostReview(VirtualFunctionTool):
name = 'AmazonPostReview'
summary = 'Post a review for a previous product that was purchased.'
parameters: List[ArgParameter] = [{'name': 'product_id', 'type': 'string', 'description': 'The unique identifier of the product.', 'required': True}, {'name': 'review', 'type': 'string', 'description': 'The public review to post.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the review was successfully posted.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The product with the specified 'product_id' was not found."}]
|
@register_toolkit()
class Amazon(FunctionToolkit):
name_for_human = 'Amazon'
description_for_human = 'Toolkit for common online shopping tasks on Amazon.'
name_for_model = 'Amazon'
description_for_model = 'An Amazon toolkit to perform common online shopping tasks like searching for products, viewing product details, managing the shopping cart and wish list, placing orders, and posting reviews. It also allows users to view their saved addresses and payment methods, and search their order history.'
tool_classes = [AmazonSearchProducts, AmazonGetProductDetails, AmazonAddToCart, AmazonViewCart, AmazonRemoveFromCart, AmazonPlaceOrder, AmazonSearchOrderHistory, AmazonViewOrderDetails, AmazonManageWishlist, AmazonViewSavedAddresses, AmazonViewSavedPaymentMethods, AmazonPostReview]
|
class ExpediaSearchFlights(VirtualFunctionTool):
name = 'ExpediaSearchFlights'
summary = 'Search for available flights based on origin, destination, and departure date. Optionally, return flights can be searched for by providing a return date.'
parameters: List[ArgParameter] = [{'name': 'origin', 'type': 'string', 'description': 'The departure location, should be a valid airport code or city name.', 'required': True}, {'name': 'destination', 'type': 'string', 'description': 'The arrival location, should be a valid airport code or city name.', 'required': True}, {'name': 'departure_date', 'type': 'string', 'description': "The departure date in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'return_date', 'type': 'string', 'description': "The return date in the format 'YYYY-MM-DD'.", 'required': False}, {'name': 'travellers', 'type': 'object', 'description': 'An object containing fields adults (integer), children (integer), infants (integer).', 'required': True}, {'name': 'travel_class', 'type': 'string', 'description': "The travel class, possible values: 'economy', 'premium_economy', 'business', 'first_class'.", 'required': True}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of results to return. Default is 5, maximum is 10.', 'required': False}, {'name': 'filters', 'type': 'object', 'description': "An object containing optional fields min_price (number), max_price (number), stops_filter (array of strings, each string is a allowed stop type, possible values: 'direct', '1_stop', '2_plus_stops'), airline (string), departure_time (string, one of ['morning', 'afternoon', 'evening']), arrival_time (string, one of ['morning', 'afternoon', 'evening']). Default is no filters.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'flight_options', 'type': 'array', 'description': "A list of objects, each object contains option_id (string, starts with 'outbound' or 'return'), airline (string), flight_numbers (array of strings), departure_airport (string, the airport code), departure_time (string, format: 'YYYY-MM-DD:HH:MM'), arrival_airport (string, the airport code), arrival_time (string, format: 'YYYY-MM-DD:HH:MM'), duration (string, format: 'HH:MM'), stops (integer), layovers (array of strings, each string is an airport code with the layover duration in format 'HH:MM'), price (number, in USD), additional_information (object, containing additional information such as baggage allowance, change fees, cancellation fees, etc.). At most `max_results` flights are returned."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'origin' or 'destination' is not a valid airport code or city name, or the 'departure_date' or 'return_date' is invalid, or the 'travellers' or 'travel_class' is invalid, or the 'max_results' is not an integer between 1 and 10, or the fields in 'filters' are invalid."}]
|
class ExpediaGetFlightDetails(VirtualFunctionTool):
name = 'ExpediaGetFlightDetails'
summary = 'Retrieve detailed information for a specific flight using its unique number and departure date.'
parameters: List[ArgParameter] = [{'name': 'departure_date', 'type': 'string', 'description': "The departure date in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'flight_number', 'type': 'string', 'description': "The flight number used to identify the flight, e.g. 'AC 123'.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'flight_details', 'type': 'object', 'description': "An object containing airline (string), departure_airport (string, the airport code), departure_time (string, format: 'YYYY-MM-DD:HH:MM'), arrival_airport (string, the airport code), arrival_time (string, format: 'YYYY-MM-DD:HH:MM'), duration (string, format: 'HH:MM'), aircraft_type (string), aircraft_age (integer)."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "'flight_number' not found for 'departure_date'."}]
|
class ExpediaSearchAccommodations(VirtualFunctionTool):
name = 'ExpediaSearchAccommodations'
summary = 'Search for available accommodations based on city, location, check-in date, check-out date, and guests.'
parameters: List[ArgParameter] = [{'name': 'city', 'type': 'string', 'description': 'The city of the accommodation.', 'required': True}, {'name': 'location', 'type': 'string', 'description': 'The location of the accommodation.', 'required': False}, {'name': 'check_in_date', 'type': 'string', 'description': "The check-in date in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'check_out_date', 'type': 'string', 'description': "The check-out date in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'guests', 'type': 'array', 'description': 'An array of objects, each object contains adults (integer), children (integer).', 'required': True}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of results to return. Default is 5, maximum is 10.', 'required': False}, {'name': 'filters', 'type': 'object', 'description': 'An object containing optional fields min_price (number), max_price (number), accommodation_type (string), room_type (string), min_rating (number), free_cancellation (boolean), free_breakfast (boolean), allow_smoking (boolean), allow_pets (boolean). Default is no filters.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'accommodation_options', 'type': 'array', 'description': "A list of objects, each object contains option_id (string, starts with 'acc'), name (string), address (string), rating (number), total_price (number, in USD), free_cancellation (boolean), free_breakfast (boolean), allow_smoking (boolean), allow_pets (boolean), additional_information (object, containing additional information such as amenities). At most `max_results` accommodations are returned."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'city' is not a valid city, or 'location' is not valid, or the 'check_in_date' and 'check_out_date' are invalid, or the 'guests' is invalid, or the 'max_results' is not an integer between 1 and 10, or the fields in 'filters' are invalid."}]
|
class ExpediaBooking(VirtualFunctionTool):
name = 'ExpediaBooking'
summary = 'Book flight or accommodation options using user-provided details and payment information.'
parameters: List[ArgParameter] = [{'name': 'option_ids', 'type': 'array', 'description': 'An non-empty array of unique identifiers of the options to book. The options must be of the same type, either all flights or all accommodations.', 'required': True}, {'name': 'payment_method', 'type': 'object', 'description': 'An object containing payment information including card number, expiry date, and CVV.', 'required': True}, {'name': 'travellers', 'type': 'array', 'description': "An array of objects, each object contains name (string), date_of_birth (string, format: 'YYYY-MM-DD'), passport_number (string), passport_expiry_date (string, format: 'YYYY-MM-DD'). Only required for flight booking.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'booking_results', 'type': 'object', 'description': "An object indicates the booking results, including success (boolean). If success is true, the object also contains reservation_id (string), reservation_type (string, one of ['flight', 'accommodation']), total_price (number, in USD)."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "One or more of the 'option_ids' does not exist."}, {'name': 'InvalidRequestException', 'description': "The options in 'option_ids' are not of the same type, or the 'option_ids' is empty, or payment information is invalid, or the 'travellers' parameter is not provided for flight booking, or there are invalid information in the 'travellers' parameter."}]
|
class ExpediaSearchReservations(VirtualFunctionTool):
name = 'ExpediaSearchReservations'
summary = 'Search for existing flight or accommodation reservations based on reservation type, query string, start date, and end date. The query string is searched for in the reservation details.'
parameters: List[ArgParameter] = [{'name': 'reservation_type', 'type': 'string', 'description': "The type of reservation, possible values: 'flight', 'accommodation'.", 'required': True}, {'name': 'query', 'type': 'string', 'description': 'The query string to search for in the reservation details.', 'required': True}, {'name': 'start_date', 'type': 'string', 'description': "The start date of the reserved flight or accommodation in the format 'YYYY-MM-DD'.", 'required': False}, {'name': 'end_date', 'type': 'string', 'description': "The end date of the reserved flight or accommodation in the format 'YYYY-MM-DD'.", 'required': False}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of results to return. Default is 5.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'reservations', 'type': 'array', 'description': "A list of objects, each object contains 'reservation_id' (string), 'booking_timestamp' (string, format: 'YYYY-MM-DD:HH:MM:SS'), 'reservation_status' (string, one of ['confirmed', 'cancelled']), 'total_price' (number, in USD), 'refundable_amount' (number, in USD), 'additional_information' (object, containing additional information such as flight or accommodation details). At most `max_results` reservations are returned."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'reservation_type' is not one of ['flight', 'accommodation'], or the 'query' is empty, or the 'start_date' or 'end_date' is malformed, or the 'max_results' is not a positive integer."}]
|
class ExpediaCancelReservations(VirtualFunctionTool):
name = 'ExpediaCancelReservations'
summary = 'Cancel a list of existing flight or accommodation reservation and process any applicable refunds.'
parameters: List[ArgParameter] = [{'name': 'reservation_ids', 'type': 'array', 'description': 'An array of unique identifiers of the reservations to cancel.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the cancellation was successful.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "One or more of the 'reservation_ids' does not exist."}, {'name': 'ConflictException', 'description': "At least one of the reservations in 'reservation_ids' is already cancelled."}]
|
class ExpediaRetrieveSavedInformation(VirtualFunctionTool):
name = 'ExpediaRetrieveSavedInformation'
summary = "Retrieve user's saved payment methods or people information."
parameters: List[ArgParameter] = [{'name': 'information_type', 'type': 'string', 'description': "The type of information, must be one of ['payments', 'people'].", 'required': True}]
returns: List[ArgReturn] = [{'name': 'retrieved_information', 'type': 'array', 'description': "If the 'information_type' is 'payments', the returned array contains objects, each object contains remark, card number, expiry date, and CVV. If the 'information_type' is 'people', the returned array contains objects, each object contains remark, name, date_of_birth, passport_number and passport_expiry_date."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'information_type' is not one of ['payments', 'people']."}]
|
@register_toolkit()
class Expedia(FunctionToolkit):
name_for_human = 'Expedia'
description_for_human = 'Toolkit for searching, booking, and managing flights and accommodations.'
name_for_model = 'Expedia'
description_for_model = 'A toolkit for searching, booking, and managing flights and accommodations. It enables search and book flights and accommodations, retrieve flight and accommodation details, search and manage existing reservations, and retrieve user saved travel and payment information.'
tool_classes = [ExpediaSearchFlights, ExpediaGetFlightDetails, ExpediaSearchAccommodations, ExpediaBooking, ExpediaSearchReservations, ExpediaCancelReservations, ExpediaRetrieveSavedInformation]
|
class TwitterManagerPostTweet(VirtualFunctionTool):
name = 'TwitterManagerPostTweet'
summary = "Post a new tweet to the user's timeline."
parameters: List[ArgParameter] = [{'name': 'content', 'type': 'string', 'description': 'The content of the tweet, max length 280 characters.', 'required': True}, {'name': 'media_paths', 'type': 'array', 'description': 'An optional list of media file paths to attach to the tweet, max 4 items. Each item must be a valid image or video file path in the local file system.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'tweet_id', 'type': 'string', 'description': 'The unique identifier of the posted tweet.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'content' parameter is too long, or the 'media_paths' parameter contains too many items, or at least one of the media files is not a valid image or video file."}, {'name': 'NotFoundException', 'description': 'At least one of the media files does not exist in the local file system.'}]
|
class TwitterManagerSearchTweets(VirtualFunctionTool):
name = 'TwitterManagerSearchTweets'
summary = "Search for user's own tweets or public tweets containing specific keywords or hashtags."
parameters: List[ArgParameter] = [{'name': 'query', 'type': 'string', 'description': 'The query string to search for in tweets.', 'required': True}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of results to return, default is 10.', 'required': False}, {'name': 'own_tweets', 'type': 'boolean', 'description': "Whether to search only the user's own tweets, default is false.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'tweets', 'type': 'array', 'description': "A list of objects containing the 'tweet_id', 'user_id', 'content', and 'timestamp' of each matching tweet."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'query' parameter is empty."}]
|
class TwitterManagerReadTweet(VirtualFunctionTool):
name = 'TwitterManagerReadTweet'
summary = 'Read the content of a specific tweet by its ID.'
parameters: List[ArgParameter] = [{'name': 'tweet_id', 'type': 'string', 'description': 'The unique identifier of the tweet to read.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'tweet', 'type': 'object', 'description': "An object containing the 'tweet_id', 'user_id', 'content', and 'timestamp' of the specified tweet."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'tweet_id' parameter is not found."}]
|
class TwitterManagerDeleteTweets(VirtualFunctionTool):
name = 'TwitterManagerDeleteTweets'
summary = 'Delete a tweet by its ID.'
parameters: List[ArgParameter] = [{'name': 'tweet_ids', 'type': 'array', 'description': 'An array of unique identifiers of the tweets to delete.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the tweet was successfully deleted.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "At least one of id in 'tweet_ids' parameter is not found."}]
|
class TwitterManagerFollowUsers(VirtualFunctionTool):
name = 'TwitterManagerFollowUsers'
summary = 'Follow other users by their IDs.'
parameters: List[ArgParameter] = [{'name': 'user_ids', 'type': 'array', 'description': 'An array of unique identifiers of the users to follow.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the users was successfully followed.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "At least one of id in 'user_ids' parameter is not found."}]
|
class TwitterManagerUnfollowUsers(VirtualFunctionTool):
name = 'TwitterManagerUnfollowUsers'
summary = 'Unfollow other users by their IDs.'
parameters: List[ArgParameter] = [{'name': 'user_ids', 'type': 'array', 'description': 'An array of unique identifiers of the users to unfollow.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the users were successfully unfollowed.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "At least one of id in 'user_ids' parameter is not found."}]
|
class TwitterManagerGetUserProfile(VirtualFunctionTool):
name = 'TwitterManagerGetUserProfile'
summary = "Retrieve the user's own profile or another user's profile information by their ID."
parameters: List[ArgParameter] = [{'name': 'user_id', 'type': 'string', 'description': 'The unique identifier of the user to retrieve the profile information for. If not provided, return own profile.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'profile', 'type': 'object', 'description': "An object containing the 'user_id', 'user_name', 'display_name', and 'bio' of the specified user."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'user_id' parameter is not found and not getting own profile."}]
|
class TwitterManagerLikeTweet(VirtualFunctionTool):
name = 'TwitterManagerLikeTweet'
summary = 'Like a tweet by its ID.'
parameters: List[ArgParameter] = [{'name': 'tweet_id', 'type': 'string', 'description': 'The unique identifier of the tweet to like.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the tweet was successfully liked.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'tweet_id' parameter is not found."}]
|
class TwitterManagerUnlikeTweet(VirtualFunctionTool):
name = 'TwitterManagerUnlikeTweet'
summary = 'Undo like a tweet by its ID.'
parameters: List[ArgParameter] = [{'name': 'tweet_id', 'type': 'string', 'description': 'The unique identifier of the tweet to undo like.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the tweet was successfully unliked.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'tweet_id' parameter is not found."}]
|
class TwitterManagerRetweet(VirtualFunctionTool):
name = 'TwitterManagerRetweet'
summary = 'Retweet a tweet by its ID.'
parameters: List[ArgParameter] = [{'name': 'tweet_id', 'type': 'string', 'description': 'The unique identifier of the tweet to retweet.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the tweet was successfully retweeted.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'tweet_id' parameter is not found."}]
|
class TwitterManagerReplyToTweet(VirtualFunctionTool):
name = 'TwitterManagerReplyToTweet'
summary = 'Reply to a tweet by its ID.'
parameters: List[ArgParameter] = [{'name': 'tweet_id', 'type': 'string', 'description': 'The unique identifier of the tweet to reply to.', 'required': True}, {'name': 'content', 'type': 'string', 'description': 'The content of the reply, max length 280 characters.', 'required': True}, {'name': 'media_paths', 'type': 'array', 'description': 'An optional list of media file paths to attach to the tweet, max 4 items. Each item must be a valid image or video file path in the local file system.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'reply_tweet_id', 'type': 'string', 'description': 'The unique identifier of the posted reply tweet.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'content' parameter is too long, or the 'media_paths' parameter contains too many items, or at least one of the media files is not a valid image or video file."}, {'name': 'NotFoundException', 'description': "The 'tweet_id' parameter is not found, or at least one of the media files does not exist in the local file system."}]
|
@register_toolkit()
class TwitterManager(FunctionToolkit):
name_for_human = 'Twitter Manager'
description_for_human = 'Toolkit for managing a Twitter account.'
name_for_model = 'TwitterManager'
description_for_model = "A toolkit for managing a Twitter account, enabling users to send, search, read, delete, and reply to tweets, as well as follow, unfollow, and interact with other users' tweets."
tool_classes = [TwitterManagerPostTweet, TwitterManagerSearchTweets, TwitterManagerReadTweet, TwitterManagerDeleteTweets, TwitterManagerFollowUsers, TwitterManagerUnfollowUsers, TwitterManagerGetUserProfile, TwitterManagerLikeTweet, TwitterManagerUnlikeTweet, TwitterManagerRetweet, TwitterManagerReplyToTweet]
|
class GoogleHomeSearchDevices(VirtualFunctionTool):
name = 'GoogleHomeSearchDevices'
summary = "Searches for smart home devices connected to the user's Google Home."
parameters: List[ArgParameter] = [{'name': 'device_type', 'type': 'string', 'description': "The type of device to search for, e.g., 'light', 'thermostat', etc. If not specified, it returns all connected devices.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'devices', 'type': 'array', 'description': "A list of devices, each containing 'device_id', 'device_name', 'device_type', and 'device_status' (including its state, settings, etc)."}]
exceptions: List[ArgException] = []
|
class GoogleHomeListDeviceActions(VirtualFunctionTool):
name = 'GoogleHomeListDeviceActions'
summary = 'Retrieves a list of possible actions that can be performed on a specified smart home device.'
parameters: List[ArgParameter] = [{'name': 'device_id', 'type': 'string', 'description': 'The unique identifier of the smart home device.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'actions', 'type': 'array', 'description': "A list of possible actions for the device, each is an object containing 'action_name' (e.g., 'turn on', 'turn off', 'adjust temperature', etc), 'action_description', and 'action_parameters' (a detailed description of the parameters required for the action, with their types, descriptions, and constraints)"}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'device_id' parameter is invalid or not supported."}]
|
class GoogleHomeControlDevice(VirtualFunctionTool):
name = 'GoogleHomeControlDevice'
summary = "Controls a specified smart home device by turning it on/off, adjusting its settings, or performing other actions. The available actions and parameters depend on the device type, which can be retrieved using 'ListDeviceActions'."
parameters: List[ArgParameter] = [{'name': 'device_id', 'type': 'string', 'description': 'The unique identifier of the smart home device to control.', 'required': True}, {'name': 'action', 'type': 'string', 'description': "The action to perform on the device, etc. Must match the actions returned by 'ListDeviceActions' for the specified device.", 'required': True}, {'name': 'parameters', 'type': 'object', 'description': "Additional parameters for the action. Must match the parameters returned by 'ListDeviceActions' for the specified device.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the action was successfully performed on the device.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'device_id' parameter is not found."}, {'name': 'InvalidRequestException', 'description': "The 'action' or 'parameters' parameters are invalid or not supported."}]
|
class GoogleHomeScheduleDeviceAction(VirtualFunctionTool):
name = 'GoogleHomeScheduleDeviceAction'
summary = 'Schedules a specified smart home device to perform an action at a specified date and time.'
parameters: List[ArgParameter] = [{'name': 'device_id', 'type': 'string', 'description': 'The unique identifier of the smart home device to schedule.', 'required': True}, {'name': 'action', 'type': 'string', 'description': "The action to perform on the device. Must match the actions returned by 'ListDeviceActions' for the specified device.", 'required': True}, {'name': 'date_time', 'type': 'string', 'description': "The scheduled date and time for the action, in the format 'YYYY-MM-DD HH:MM'.", 'required': True}, {'name': 'parameters', 'type': 'object', 'description': "Additional parameters for the action. Must match the parameters returned by 'ListDeviceActions' for the specified device.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the action was successfully scheduled.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'device_id' parameter is not found."}, {'name': 'InvalidRequestException', 'description': "The 'action' or 'parameters' parameters are invalid or not supported, or the 'date_time' parameter format is incorrect, or the 'date_time' parameter is in the past."}]
|
class GoogleHomePlayMedia(VirtualFunctionTool):
name = 'GoogleHomePlayMedia'
summary = 'Plays specified media (music, podcasts, etc.) on a connected device.'
parameters: List[ArgParameter] = [{'name': 'media', 'type': 'string', 'description': 'The media to play, e.g., a song title, podcast name, or radio station.', 'required': True}, {'name': 'device_id', 'type': 'string', 'description': 'The unique identifier of the device to play the media on. If not specified, it defaults to the Google Home device.', 'required': False}, {'name': 'parameters', 'type': 'object', 'description': "Additional parameters for the media. Must match the parameters returned by 'ListDeviceActions'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the media was successfully played on the device.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'media' or 'device_id' parameter is not found."}, {'name': 'InvalidRequestException', 'description': "The 'parameters' parameter is invalid or not supported."}]
|
class GoogleHomeSetReminder(VirtualFunctionTool):
name = 'GoogleHomeSetReminder'
summary = 'Sets a reminder for a specified date and time.'
parameters: List[ArgParameter] = [{'name': 'reminder_text', 'type': 'string', 'description': 'The text of the reminder.', 'required': True}, {'name': 'date_time', 'type': 'string', 'description': "The date and time for the reminder, in the format 'YYYY-MM-DD HH:MM'.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'reminder_id', 'type': 'string', 'description': 'The unique identifier of the created reminder.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'date_time' parameter format is incorrect."}]
|
class GoogleHomeListReminders(VirtualFunctionTool):
name = 'GoogleHomeListReminders'
summary = "Lists all reminders set on the user's Google Home."
parameters: List[ArgParameter] = []
returns: List[ArgReturn] = [{'name': 'reminders', 'type': 'array', 'description': "A list of reminders, each containing 'reminder_id', 'reminder_text', and 'date_time'."}]
exceptions: List[ArgException] = []
|
class GoogleHomeAskQuestion(VirtualFunctionTool):
name = 'GoogleHomeAskQuestion'
summary = 'Asks a question and receives an answer from Google Home.'
parameters: List[ArgParameter] = [{'name': 'question', 'type': 'string', 'description': 'The question to ask.', 'required': True}]
returns: List[ArgReturn] = [{'name': 'answer', 'type': 'string', 'description': 'The answer to the question.'}]
exceptions: List[ArgException] = []
|
@register_toolkit()
class GoogleHome(FunctionToolkit):
name_for_human = 'Google Home'
description_for_human = 'Toolkit for controlling and managing Google Home devices.'
name_for_model = 'GoogleHome'
description_for_model = 'A toolkit for controlling and managing Google Home devices, enabling users to control smart home devices, play media, set reminders, ask questions, and retrieve device status and actions.'
tool_classes = [GoogleHomeSearchDevices, GoogleHomeListDeviceActions, GoogleHomeControlDevice, GoogleHomeScheduleDeviceAction, GoogleHomePlayMedia, GoogleHomeSetReminder, GoogleHomeListReminders, GoogleHomeAskQuestion]
|
class DropboxUploadFile(VirtualFunctionTool):
name = 'DropboxUploadFile'
summary = "Upload a file from the local system to the user's Dropbox account."
parameters: List[ArgParameter] = [{'name': 'local_file_path', 'type': 'string', 'description': 'The path of the file on the local system.', 'required': True}, {'name': 'cloud_folder_path', 'type': 'string', 'description': "The cloud folder path in the user's Dropbox account where the file will be uploaded. If not specified, the file will be uploaded to the root folder '/MyDropbox/'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the file was successfully uploaded.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'local_file_path' is invalid or the 'cloud_folder_path' is invalid."}, {'name': 'NotFoundException', 'description': "The 'local_file_path' does not exist or the 'cloud_folder_path' does not exist."}]
|
class DropboxDownloadFile(VirtualFunctionTool):
name = 'DropboxDownloadFile'
summary = 'Download a file from the Dropbox to the local system. It could be a file uploaded by the user or a file shared with the user by others.'
parameters: List[ArgParameter] = [{'name': 'user_cloud_file_path', 'type': 'string', 'description': "The cloud file path in the user's Dropbox account. Required for downloading a file uploaded by the user.", 'required': False}, {'name': 'shared_file_id', 'type': 'string', 'description': 'The unique identifier of the shared file. Required for downloading a file shared with the user by others.', 'required': False}, {'name': 'local_destination_folder', 'type': 'string', 'description': 'The path of the folder on the local system where the file will be downloaded; default: the default download folder of the local system.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the file was successfully downloaded.'}, {'name': 'local_file_path', 'type': 'string', 'description': 'The path of the downloaded file on the local system. Empty if the file was not successfully downloaded.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "neither 'user_cloud_file_path' nor 'shared_file_id' is specified, or the 'user_cloud_file_path' is invalid, or the 'shared_file_id' is invalid, or ."}, {'name': 'NotFoundException', 'description': "The 'user_cloud_file_path' does not exist, or the 'shared_file_id' does not exist, or the 'shared_file_id' is not shared with the user, or the 'local_destination_folder' does not exist."}]
|
class DropboxListFilesAndFolders(VirtualFunctionTool):
name = 'DropboxListFilesAndFolders'
summary = "List files and folders in a given folder in the user's Dropbox account."
parameters: List[ArgParameter] = [{'name': 'cloud_folder_path', 'type': 'string', 'description': "The cloud folder path in the user's Dropbox account. If not specified, the root folder '/MyDropbox/' will be used.", 'required': False}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of files and folders to return; default: 10.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'items', 'type': 'array', 'description': "An array of objects, each with 'id' (the unique identifier of the file or folder), 'name' (the name of the file or folder), and 'type' (the type of the item, either 'file' or 'folder')."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'cloud_folder_path' is invalid, or the 'max_results' is not a positive integer."}, {'name': 'NotFoundException', 'description': "The 'cloud_folder_path' does not exist."}]
|
class DropboxCreateFolder(VirtualFunctionTool):
name = 'DropboxCreateFolder'
summary = 'Create a folder in the cloud storage.'
parameters: List[ArgParameter] = [{'name': 'folder_name', 'type': 'string', 'description': 'The name of the new folder.', 'required': True}, {'name': 'parent_folder_path', 'type': 'string', 'description': "The cloud folder path in the user's Dropbox account where the new folder will be created. If not specified, the new folder will be created in the root folder '/MyDropbox/'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the folder was successfully created.'}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'folder_name' is invalid or the 'parent_folder_path' does not exist."}, {'name': 'NotFoundException', 'description': "The 'parent_folder_path' does not exist."}]
|
class DropboxShareItem(VirtualFunctionTool):
name = 'DropboxShareItem'
summary = "Share a file or folder in user's Dropbox account with another user."
parameters: List[ArgParameter] = [{'name': 'item_path', 'type': 'string', 'description': "The cloud file or folder path in the user's Dropbox account to be shared.", 'required': True}, {'name': 'recipient_email', 'type': 'string', 'description': 'The email address of the recipient.', 'required': True}, {'name': 'access_level', 'type': 'string', 'description': "The level of access granted to the recipient; valid values: 'view', 'comment', 'edit'.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the item was successfully shared.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'item_path' does not exist."}, {'name': 'InvalidRequestException', 'description': "The 'recipient_email' is invalid or 'access_level' is not one of the valid values."}]
|
class DropboxDeleteItem(VirtualFunctionTool):
name = 'DropboxDeleteItem'
summary = "Delete a file or folder from the user's Dropbox account."
parameters: List[ArgParameter] = [{'name': 'item_path', 'type': 'string', 'description': "The cloud file or folder path in the user's Dropbox account to be deleted.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the file or folder was successfully deleted.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'item_path' does not exist."}]
|
class DropboxSearchItems(VirtualFunctionTool):
name = 'DropboxSearchItems'
summary = "Search for files and folders by name or metadata in the user's Dropbox account."
parameters: List[ArgParameter] = [{'name': 'query', 'type': 'string', 'description': 'The search query.', 'required': True}, {'name': 'max_results', 'type': 'integer', 'description': 'The maximum number of files and folders to return; default: 50.', 'required': False}]
returns: List[ArgReturn] = [{'name': 'items', 'type': 'array', 'description': "An array of objects, each with 'id' (the unique identifier of the file or folder), 'path' (the path of the file or folder), and 'type' (the type of the item, either 'file' or 'folder')."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'query' is malformed."}]
|
class DropboxGetItemMetadata(VirtualFunctionTool):
name = 'DropboxGetItemMetadata'
summary = "Get metadata of a file or folder in the user's Dropbox account."
parameters: List[ArgParameter] = [{'name': 'item_path', 'type': 'string', 'description': "The cloud file or folder path in the user's Dropbox account.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'metadata', 'type': 'object', 'description': "An object with fields such as 'id' (the unique identifier of the file or folder), 'name' (the name of the file or folder), 'type' (the type of the item, either 'file' or 'folder'), 'size' (the size of the file in bytes), 'created_at' (the creation timestamp), 'modified_at' (the last modification timestamp), etc."}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'item_path' does not exist."}]
|
class DropboxMoveItem(VirtualFunctionTool):
name = 'DropboxMoveItem'
summary = "Move a file or folder to a different folder in the user's Dropbox account."
parameters: List[ArgParameter] = [{'name': 'item_path', 'type': 'string', 'description': "The cloud file or folder path in the user's Dropbox account to be moved.", 'required': True}, {'name': 'destination_folder_path', 'type': 'string', 'description': "The destination folder path in the user's Dropbox account.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the file or folder was successfully moved.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'item_path' or 'destination_folder_path' does not exist."}]
|
class DropboxCreateLink(VirtualFunctionTool):
name = 'DropboxCreateLink'
summary = 'Create a shareable link for a file or folder in the cloud storage.'
parameters: List[ArgParameter] = [{'name': 'item_path', 'type': 'string', 'description': "The cloud file or folder path in the user's Dropbox account to be shared.", 'required': True}, {'name': 'access_level', 'type': 'string', 'description': "The level of access granted; valid values: 'view', 'comment', 'edit'.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'link', 'type': 'string', 'description': 'The shareable link.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'item_path' does not exist."}, {'name': 'InvalidRequestException', 'description': "The 'access_level' is not one of the valid values."}]
|
class DropboxDisableLink(VirtualFunctionTool):
name = 'DropboxDisableLink'
summary = 'Disable the shareable link for a file or folder in the cloud storage.'
parameters: List[ArgParameter] = [{'name': 'item_path', 'type': 'string', 'description': "The cloud file or folder path in the user's Dropbox account to be unshared.", 'required': True}]
returns: List[ArgReturn] = [{'name': 'success', 'type': 'boolean', 'description': 'Whether the link was successfully disabled.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'item_path' does not exist."}, {'name': 'InvalidRequestException', 'description': "The 'item_path' is not a shared file or folder."}]
|
@register_toolkit()
class Dropbox(FunctionToolkit):
name_for_human = 'Dropbox'
description_for_human = 'Toolkit for managing files and folders in Dropbox.'
name_for_model = 'Dropbox'
description_for_model = 'A comprehensive toolkit for managing files and folders in Dropbox, including uploading, downloading, sharing, searching, and organizing content, as well as managing access permissions, creating and disabling shareable links.'
tool_classes = [DropboxUploadFile, DropboxDownloadFile, DropboxListFilesAndFolders, DropboxCreateFolder, DropboxShareItem, DropboxDeleteItem, DropboxSearchItems, DropboxGetItemMetadata, DropboxMoveItem, DropboxCreateLink, DropboxDisableLink]
|
class TeladocSearchDoctors(VirtualFunctionTool):
name = 'TeladocSearchDoctors'
summary = 'Search for doctors based on keywords, specialty, location, and a specific date.'
parameters: List[ArgParameter] = [{'name': 'keywords', 'type': 'string', 'description': 'Keywords to search doctors by, such as name or specialty.', 'required': False}, {'name': 'location', 'type': 'string', 'description': 'Location to filter doctors by.', 'required': False}, {'name': 'date', 'type': 'string', 'description': "Date to check doctor's availability in the format 'YYYY-MM-DD'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'doctors', 'type': 'array', 'description': "A list of doctors with their respective unique identifiers, names, specialties, locations, and available time slots (list of start and end times in the format 'YYYY-MM-DD HH:MM')."}]
exceptions: List[ArgException] = [{'name': 'InvalidRequestException', 'description': "The 'date' parameter is not in the correct format or the 'location' parameter is not valid."}]
|
class TeladocConsultDoctor(VirtualFunctionTool):
name = 'TeladocConsultDoctor'
summary = "Start a consultation with a doctor by providing the doctor's unique identifier and reason for consultation."
parameters: List[ArgParameter] = [{'name': 'doctor_id', 'type': 'string', 'description': 'The unique identifier of the chosen doctor.', 'required': True}, {'name': 'reason', 'type': 'string', 'description': "Reason for consultation (e.g., 'cold symptoms', 'allergy concerns').", 'required': True}]
returns: List[ArgReturn] = [{'name': 'consultation_id', 'type': 'string', 'description': 'A unique identifier for the consultation.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'doctor_id' parameter does not exist."}]
|
class TeladocScheduleAppointment(VirtualFunctionTool):
name = 'TeladocScheduleAppointment'
summary = "Schedule an appointment with a doctor by providing the doctor's unique identifier, appointment date and time, and reason for appointment."
parameters: List[ArgParameter] = [{'name': 'doctor_id', 'type': 'string', 'description': 'The unique identifier of the chosen doctor.', 'required': True}, {'name': 'date', 'type': 'string', 'description': "Date of the appointment in the format 'YYYY-MM-DD'.", 'required': True}, {'name': 'time', 'type': 'string', 'description': "Time of the appointment in the format 'HH:mm'.", 'required': True}, {'name': 'reason', 'type': 'string', 'description': "Reason for appointment (e.g., 'routine checkup', 'follow-up visit').", 'required': True}]
returns: List[ArgReturn] = [{'name': 'appointment_id', 'type': 'string', 'description': 'A unique identifier for the appointment if successfully scheduled, otherwise null.'}, {'name': 'success', 'type': 'boolean', 'description': 'A boolean indicating whether the appointment was successfully scheduled.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'doctor_id' parameter does not exist."}, {'name': 'InvalidRequestException', 'description': "The 'date' or 'time' parameter is not in the correct format or the 'reason' parameter is not valid."}]
|
class TeladocManageAppointments(VirtualFunctionTool):
name = 'TeladocManageAppointments'
summary = "View, update, or cancel appointments by providing the appointment's unique identifier and any updates or cancellation requests."
parameters: List[ArgParameter] = [{'name': 'appointment_id', 'type': 'string', 'description': 'The unique identifier of the appointment.', 'required': True}, {'name': 'action', 'type': 'string', 'description': "The action to perform on the appointment ('view', 'update', 'cancel').", 'required': True}, {'name': 'date', 'type': 'string', 'description': "Updated date of the appointment in the format 'YYYY-MM-DD' if action is 'update'.", 'required': False}, {'name': 'time', 'type': 'string', 'description': "Updated time of the appointment in the format 'HH:mm' if action is 'update'.", 'required': False}]
returns: List[ArgReturn] = [{'name': 'appointment_details', 'type': 'object', 'description': 'An object containing the appointment details, such as appointment_id, doctor_id, date, time, reason, and status.'}]
exceptions: List[ArgException] = [{'name': 'NotFoundException', 'description': "The 'appointment_id' parameter does not exist."}, {'name': 'InvalidRequestException', 'description': "The 'action' parameter is not valid or the 'date' or 'time' (for update action) parameter is not in the correct format."}]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.