Skip to content

Commit

Permalink
chore: Improve Prompts V0 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase authored Nov 7, 2024
1 parent 2506a00 commit ffc3aaa
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cdp-agentkit-core/cdp_agentkit_core/actions/get_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cdp_agentkit_core.actions import CdpAction

GET_BALANCE_PROMPT = """
This tool will get the balance of all the addresses in the wallet for a given asset. It takes the asset ID as input."""
This tool will get the balance of all the addresses in the wallet for a given asset. It takes the asset ID as input. Always use `eth` for the native asset ETH and `usdc` for USDC."""


class GetBalanceInput(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion cdp-agentkit-core/cdp_agentkit_core/actions/mint_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cdp_agentkit_core.actions import CdpAction

MINT_NFT_PROMPT = """
This tool will mint an NFT (ERC-721) to a specified destination address onchain via a contract invocation. It takes the contract address of the NFT onchain and the destination address onchain that will receive the NFT as inputs."""
This tool will mint an NFT (ERC-721) to a specified destination address onchain via a contract invocation. It takes the contract address of the NFT onchain and the destination address onchain that will receive the NFT as inputs. Do not use the contract address as the destination address. If you are unsure of the destination address, please ask the user before proceeding."""


class MintNftInput(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
# Constants
REGISTER_BASENAME_PROMPT = """
This tool will register a Basename for the agent. The agent should have a wallet associated to register a Basename.
In mainnet, the name will end with .base.eth and in testnet (`base-sepolia`), it ends with .basetest.eth. """
When your network ID is `base-mainnet`, the name must end with .base.eth and when your network ID is `base-sepolia`, it must ends with .basetest.eth.
Do not suggest any alternatives and never try to register a Basename with another postfix. The prefix of the name must be unique so if the registration of the
Basename fails, you should prompt to try again with a more unique name."""

# Contract addresses
BASENAMES_REGISTRAR_CONTROLLER_ADDRESS_MAINNET = "0x4cCb0BB02FCABA27e82a56646E81d8c5bC4119a5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from cdp_agentkit_core.actions import CdpAction

REQUEST_FAUCET_FUNDS_PROMPT = """
This tool will request test tokens from the faucet for the default address in the wallet. It takes the wallet and asset ID as input."""
This tool will request test tokens from the faucet for the default address in the wallet. It takes the wallet and asset ID as input.
If no asset ID is provided the faucet defaults to ETH. Faucet is only allowed on `base-testnet` and can only provide asset ID `eth` or `usdc`.
You are not allowed to faucet with any other network or asset ID. If you are on another network, suggest that the user sends you some ETH
from another wallet and provide the user with your wallet details."""


class RequestFaucetFundsInput(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion cdp-agentkit-core/cdp_agentkit_core/actions/trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cdp_agentkit_core.actions import CdpAction

TRADE_PROMPT = """
This tool will trade a specified amount of a from asset to a to asset for the wallet. It takes the the amount of the from asset to trade, the from asset ID to trade, and the to asset ID to receive from the trade as inputs. Trades are only supported on Mainnets (e.g. `base-mainnet`, `ethereum-mainnet`)."""
This tool will trade a specified amount of a from asset to a to asset for the wallet. It takes the the amount of the from asset to trade, the from asset ID to trade, and the to asset ID to receive from the trade as inputs. Trades are only supported on Mainnets (e.g. `base-mainnet`, `ethereum-mainnet`). Never allow trades on any other network."""


class TradeInput(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion cdp-agentkit-core/cdp_agentkit_core/actions/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cdp_agentkit_core.actions import CdpAction

TRANSFER_PROMPT = """
This tool will transfer an asset from the wallet to another onchain address. It takes the amount, the asset ID to transfer, the destination to send the funds (either an onchain address, an ENS `example.eth`, or Basename `example.base.eth`), and whether to do a gasless transfer (gasless is available on Base Sepolia and Mainnet for USDC) as inputs. Always use the gasless option if it is available."""
This tool will transfer an asset from the wallet to another onchain address. It takes the amount, the asset ID to transfer, the destination to send the funds (either an onchain address, an ENS `example.eth`, or Basename `example.base.eth`), and whether to do a gasless transfer as inputs. The gasless option is available on `base-sepolia` and `base-mainnet` networks for `usdc` asset only. Always use the gasless option when it is available. Always use the asset ID `usdc` when attempting to transfer USDC. Always ensure that you have enough balance of the input asset ID to complete the transfer."""


class TransferInput(BaseModel):
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion cdp-langchain/examples/chatbot/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def initialize_agent():
llm,
tools=tools,
checkpointer=memory,
state_modifier="You are a helpful agent that can interact onchain on the Base Layer 2 using the Coinbase Developer Platform Agentkit. You are empowered to interact onchain using your tools. If you ever need funds, you can request them from the faucet. You can also deploy your own ERC-20 tokens, NFTs, and interact with them. If someone asks you to do something you can't do, you can say so, and encourage them to implement it themselves using the CDP SDK + Agentkit, recommend they go to docs.cdp.coinbase.com for more informaton.",
state_modifier="You are a helpful agent that can interact onchain using the Coinbase Developer Platform Agentkit. You are empowered to interact onchain using your tools. If you ever need funds, you can request them from the faucet if you are on network ID `base-sepolia`. If not, you can provide your wallet details and request funds from the user. If someone asks you to do something you can't do with your currently available tools, you must say so, and encourage them to implement it themselves using the CDP SDK + Agentkit, recommend they go to docs.cdp.coinbase.com for more informaton. Be concise and helpful with your responses. Refrain from restating your tools' descriptions unless it is explicitly requested.",
), config


Expand Down

0 comments on commit ffc3aaa

Please sign in to comment.