Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangomez24 committed Nov 7, 2024
2 parents d6ed8ba + 89b3e2e commit bdaee95
Show file tree
Hide file tree
Showing 22 changed files with 145 additions and 1,216 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Coinbase Developer Platform (CDP) Agentkit simplifies bringing your AI Agent
- Getting wallet details and balances
- Transferring and trading tokens
- Registering Basenames
- Deploying ERC20 tokens and creating uniswap_v3 pools for trading
- Deploying ERC20 tokens
- Deploying ERC721 tokens and minting NFTs

## Examples
Expand Down
3 changes: 0 additions & 3 deletions cdp-agentkit-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

### Added

- Added `uniswap_v3_create_pool` action.
- Added `uniswap_v3_get_pool`, `uniswap_v3_get_pool_observe`, `uniswap_v3_get_pool_slot0`, and `uniswap_v3_get_pool_liquidity` actions.

## [0.0.1] - 2024-11-04

### Added
Expand Down
10 changes: 0 additions & 10 deletions cdp-agentkit-core/cdp_agentkit_core/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
from cdp_agentkit_core.actions.request_faucet_funds import RequestFaucetFundsAction
from cdp_agentkit_core.actions.trade import TradeAction
from cdp_agentkit_core.actions.transfer import TransferAction
from cdp_agentkit_core.actions.uniswap_v3.create_pool import UniswapV3CreatePoolAction
from cdp_agentkit_core.actions.uniswap_v3.get_pool import UniswapV3GetPoolAction
from cdp_agentkit_core.actions.uniswap_v3.get_pool_liquidity import UniswapV3GetPoolLiquidityAction
from cdp_agentkit_core.actions.uniswap_v3.get_pool_observe import UniswapV3GetPoolObserveAction
from cdp_agentkit_core.actions.uniswap_v3.get_pool_slot0 import UniswapV3GetPoolSlot0Action


# WARNING: All new CdpAction subclasses must be imported above, otherwise they will not be discovered
Expand All @@ -38,10 +33,5 @@ def get_all_cdp_actions() -> list[type[CdpAction]]:
"RequestFaucetFundsAction",
"TradeAction",
"TransferAction",
"UniswapV3CreatePoolAction",
"UniswapV3GetPoolAction",
"UniswapV3GetPoolSlot0Action",
"UniswapV3GetPoolObserveAction",
"UniswapV3GetPoolLiquidityAction",
"CDP_ACTIONS",
]
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from cdp_agentkit_core.actions.social.twitter.post_tweet import (
POST_TWEET_PROMPT as POST_TWEET_PROMPT,
from cdp_agentkit_core.actions.social.twitter.account_details import (
ACCOUNT_DETAILS_PROMPT as ACCOUNT_DETAILS_PROMPT,
)
from cdp_agentkit_core.actions.social.twitter.post_tweet import (
PostTweetInput as PostTweetInput,
from cdp_agentkit_core.actions.social.twitter.account_details import (
AccountDetailsInput as AccountDetailsInput,
)
from cdp_agentkit_core.actions.social.twitter.account_details import (
account_details as account_details,
)
from cdp_agentkit_core.actions.social.twitter.post_tweet import (
post_tweet as post_tweet,
POST_TWEET_PROMPT as POST_TWEET_PROMPT,
)
from cdp_agentkit_core.actions.social.twitter.post_tweet import PostTweetInput as PostTweetInput
from cdp_agentkit_core.actions.social.twitter.post_tweet import post_tweet as post_tweet
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import tweepy
from pydantic import BaseModel, Field

ACCOUNT_DETAILS_PROMPT = """
This tool will return account details for the currently authenticated Twitter (X) user context."""

class AccountDetailsInput(BaseModel):
"""Input argument schema for Twitter account details action."""

no_input: str = Field(
"",
description="No input required, e.g. `` (empty string).",
)

def account_details(client: tweepy.Client) -> str:
"""Get the authenticated Twitter (X) user account details.
Returns:
str: A message containing account details for the authenticated user context.
"""
message = ""

try:
response = client.get_me()
user = response.data

message = f"""Successfully retrieved authenticated user account details. Please present the following as json and not markdown:
id: {user.id}
name: {user.name}
username: {user.username}
link: https://x.com/{user.username}"""
except tweepy.errors.TweepyException as e:
message = f"Error retrieving authenticated user account details: {e}"

return message
Loading

0 comments on commit bdaee95

Please sign in to comment.