TwitterPostTool
class is a tool for posting tweets to Twitter. It allows agents to post new tweets and replies to existing tweets using the Twitter API v2.
name
(str): Tool identifier ("twitter_post_tool"
).description
(str): A description of the tool’s functionality.inputs
(dict): A dictionary defining the schema for required input parameters:
tweet
(str): The content of the tweet to post.in_reply_to_id
(str): The ID of the tweet to reply to (optional; use an empty string for new tweets).output_type
(str): Type of data returned by the tool ("object"
).__init__(self, _credentials: Optional[TwitterCredentials] = None)
_credentials
is None
.CredentialsException
if required credentials are missing._credentials
(Optional[TwitterCredentials]): Twitter API credentials.forward(self, tweet: str, in_reply_to_id: str) -> Dict
tweet
(str): The content of the tweet to post.in_reply_to_id
(str): The ID of the tweet to reply to (use an empty string for new tweets).Dict
: Response data from the Twitter API.TwitterSearchTool
class is a tool for searching tweets on Twitter using the Twitter API v2 search functionality.
name
(str): Tool identifier ("twitter_search_tool"
).description
(str): A description of the tool’s functionality.inputs
(dict): A dictionary defining the schema for required input parameters:
search_query
(str): The search query supported by the Twitter API.output_type
(str): Type of data returned by the tool ("string"
).__init__(self, _credentials: Optional[TwitterCredentials] = None)
_credentials
is None
.CredentialsException
if required credentials are missing._credentials
(Optional[TwitterCredentials]): Twitter API credentials.forward(self, search_query: str) -> str
search_query
(str): The search query to execute.str
: JSON string containing search results.TwitterRepliesTool
class is a tool for retrieving replies to a specific tweet using the Twitter API v2.
name
(str): Tool identifier ("twitter_replies_tool"
).description
(str): A description of the tool’s functionality.inputs
(dict): A dictionary defining the schema for required input parameters:
conversation_id
(str): The conversation ID, which is set to the original tweet ID.output_type
(str): Type of data returned by the tool ("string"
).__init__(self, _credentials: Optional[TwitterCredentials] = None)
_credentials
is None
.CredentialsException
if required credentials are missing._credentials
(Optional[TwitterCredentials]): Twitter API credentials.forward(self, conversation_id: str) -> str
conversation_id
(str): The ID of the conversation to fetch replies from.str
: JSON string containing reply tweets.TwitterGetPostTool
class is a tool for retrieving a specific tweet by its ID using the Twitter API v2.
name
(str): Tool identifier ("twitter_get_post_tool"
).description
(str): A description of the tool’s functionality.inputs
(dict): A dictionary defining the schema for required input parameters:
tweet_id
(str): The ID of the tweet to fetch.output_type
(str): Type of data returned by the tool ("string"
).__init__(self, _credentials: Optional[TwitterCredentials] = None)
_credentials
is None
.CredentialsException
if required credentials are missing._credentials
(Optional[TwitterCredentials]): Twitter API credentials.forward(self, tweet_id: str) -> str
tweet_id
(str): The ID of the tweet to fetch.str
: JSON string containing tweet data, or an empty string if not found.