-
Notifications
You must be signed in to change notification settings - Fork 575
/
Copy pathcreate_agent.sh
executable file
·236 lines (210 loc) · 7.1 KB
/
create_agent.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
#!/bin/bash
# Base URL for the API
BASE_URL="http://localhost:8000" # Change this to your API server URL
# JWT token for authentication, change it to your actual JWT token.
# If you run agentkit by yourself, and not enabled the admin auth,
# you can ignore this line
JWT_TOKEN="your-jwt-token-here"
# Change this to your actual JWT token
# Agent ID - must contain only lowercase letters, numbers, and hyphens
AGENT_ID="my-test-agent"
# Agent name
AGENT_NAME="IntentKit"
# AI model to use
# https://platform.openai.com/docs/models#current-model-aliases
# you can also use "deepseek-reasoner" and "deepseek-chat"
# Notice: Currently, the deepseek-reasoner does not support any skills.
MODEL="gpt-4o-mini"
# Agent temperature (0.0~2.0)
# The randomness of the generated results is such that
# the higher the number, the more creative the results will be.
# However, this also makes them wilder and increases the likelihood of errors.
# For creative tasks, you can adjust it to above 1, but for rigorous tasks,
# such as quantitative trading, it’s advisable to set it lower, around 0.2.
TEMPERATURE=0.7
# Agent frequency penalty (-2.0~2.0)
# The frequency penalty is a measure of how much the AI is allowed to repeat itself.
# A lower value means the AI is more likely to repeat previous responses,
# while a higher value means the AI is more likely to generate new content.
# For creative tasks, you can adjust it to 1 or a bit higher.
FREQUENCY_PENALTY=0.0
# Agent presence penalty (-2.0~2.0)
# The presence penalty is a measure of how much the AI is allowed to deviate from the topic.
# A higher value means the AI is more likely to deviate from the topic,
# while a lower value means the AI is more likely to follow the topic.
# For creative tasks, you can adjust it to 1 or a bit higher.
PRESENCE_PENALTY=0.0
# Agent initial prompt (the role is system, daily user's role is user)
read -r -d '' PROMPT_TEXT << 'END_OF_PROMPT'
You are an autonomous AI agent.
Your role is to assist users with their queries.
Please follow these guidelines:
1. Be helpful and concise
2. Stay on topic
3. Ask for clarification when needed
END_OF_PROMPT
# Agent append prompt (optional, it has higher priority)
read -r -d '' PROMPT_APPEND_TEXT << 'END_OF_APPEND'
Important safety rules:
1. Never transfer funds
2. Don't share sensitive information
3. Respect user privacy
END_OF_APPEND
# Autonomous mode settings (optional)
# If you enable autonomous mode, the agent will automatically run the autonomous_prompt every N minutes
AUTONOMOUS_ENABLED=false
AUTONOMOUS_MINUTES=60
read -r -d '' AUTONOMOUS_PROMPT_TEXT << 'END_OF_AUTONOMOUS_PROMPT'
Check twitter for new mentions, choose the best one and reply it. If there is no mention, just have a rest, don't post anything.
END_OF_AUTONOMOUS_PROMPT
# CDP settings (optional)
# Skill list: https://docs.cdp.coinbase.com/agentkit/docs/wallet-management
CDP_ENABLED=false
CDP_SKILLS='["get_wallet_details", "get_balance"]'
CDP_NETWORK_ID="base-mainnet"
# GOAT settings (optional)
GOAT_ENABLED=false
CROSSMINT_CONFIG='{
"networks": [
"base-mainnet"
]
}'
GOAT_SKILLS='{
"inch1": {
"api_key": "1inch api key string"
},
"coingecko": {
"api_key": "coingecko api key string"
},
"allora": {
"api_key": "allora api key string",
"api_root": "https://api.upshot.xyz/v2/allora"
},
"dexscreener": {},
"erc20": {
"tokens": [
"goat_plugins.erc20.token.USDC"
]
},
"farcaster": {
"api_key": "farcaster api key string",
"base_url": "https://farcaster.xyz"
},
"jsonrpc": {
"endpoint": "https://eth.llamarpc.com"
},
"jupiter": {},
"nansen": {
"api_key": "nansen api key string"
},
"opensea": {
"api_key": "opensea api key string"
},
"rugcheck": {
"jwt_token": "rugcheck JWT token string",
"base_url": "https://api.rugcheck.xyz/v1"
},
"spl_token": {
"network": "mainnet",
"tokens": [
"goat_plugins.erc20.token.USDC"
]
},
"superfluid": {},
"uniswap": {
"api_key": "uniswap api key string",
"base_url": "https://app.uniswap.org"
}
}'
# Enso settings (optional)
ENSO_ENABLED=false
ENSO_CONFIG='{
"api_token": "",
"main_tokens": [
"USDT", "ETH"
]
}'
ENSO_SKILLS='["get_tokens"]'
# Acolyt settings (optional)
ACOLYT_CONFIG='{
"api_key": ""
}'
ACOLYT_SKILLS='["ask_gpt"]'
# Allora settings (optional)
ALLORA_CONFIG='{
"api_key": ""
}'
ALLORA_SKILLS='["get_price_prediction"]'
# Elfa settings (optional)
ELFA_CONFIG='{
"api_key": ""
}'
ELFA_SKILLS='["get_mentions","get_top_mentions","search_mentions","get_trending_tokens","get_smart_stats"]'
# Twitter settings (optional)
# If you don't need to use the twitter skills, you can remove it in TWITTER_SKILLS
TWITTER_ENTRYPOINT_ENABLED=false
TWITTER_CONFIG='{}'
TWITTER_SKILLS='["get_mentions","get_timeline","post_tweet","reply_tweet","follow_user","like_tweet","retweet","search_tweets"]'
# Telegram settings (optional)
TELEGRAM_ENTRYPOINT_ENABLED=false
TELEGRAM_CONFIG='{}'
TELEGRAM_SKILLS='[]'
# Skill settings (optional)
CRESTAL_SKILLS='[]'
COMMON_SKILLS='[]'
#####################
# Do not edit below #
#####################
# Convert multiline text to escaped string
PROMPT="$(echo "$PROMPT_TEXT" | awk '{printf "%s\\n", $0}' | sed 's/"/\\"/g' | sed '$ s/\\n$//')"
# Convert multiline text to escaped string
PROMPT_APPEND="$(echo "$PROMPT_APPEND_TEXT" | awk '{printf "%s\\n", $0}' | sed 's/"/\\"/g' | sed '$ s/\\n$//')"
# Autonomous mode prompt
AUTONOMOUS_PROMPT="$(echo "$AUTONOMOUS_PROMPT_TEXT" | awk '{printf "%s\\n", $0}' | sed 's/"/\\"/g' | sed '$ s/\\n$//')"
# Create JSON payload
JSON_DATA=$(cat << EOF
{
"id": "$AGENT_ID",
"name": "$AGENT_NAME",
"model": "$MODEL",
"temperature": $TEMPERATURE,
"frequency_penalty": $FREQUENCY_PENALTY,
"presence_penalty": $PRESENCE_PENALTY,
"prompt": "$PROMPT",
"prompt_append": "$PROMPT_APPEND",
"autonomous_enabled": $AUTONOMOUS_ENABLED,
"autonomous_minutes": $AUTONOMOUS_MINUTES,
"autonomous_prompt": "$AUTONOMOUS_PROMPT",
"cdp_enabled": $CDP_ENABLED,
"cdp_skills": $CDP_SKILLS,
"cdp_wallet_data": "$CDP_WALLET_DATA",
"cdp_network_id": "$CDP_NETWORK_ID",
"goat_enabled": $GOAT_ENABLED,
"crossmint_config": $CROSSMINT_CONFIG,
"goat_skills": $GOAT_SKILLS,
"enso_enabled": $ENSO_ENABLED,
"enso_config": $ENSO_CONFIG,
"enso_skills": $ENSO_SKILLS,
"acolyt_config": $ACOLYT_CONFIG,
"acolyt_skills": $ACOLYT_SKILLS,
"allora_config": $ALLORA_CONFIG,
"allora_skills": $ALLORA_SKILLS,
"elfa_config": $ELFA_CONFIG,
"elfa_skills": $ELFA_SKILLS,
"twitter_enabled": $TWITTER_ENTRYPOINT_ENABLED,
"twitter_entrypoint_enabled": $TWITTER_ENTRYPOINT_ENABLED,
"twitter_config": $TWITTER_CONFIG,
"twitter_skills": $TWITTER_SKILLS,
"telegram_entrypoint_enabled": $TELEGRAM_ENTRYPOINT_ENABLED,
"telegram_config": $TELEGRAM_CONFIG,
"telegram_skills": $TELEGRAM_SKILLS,
"crestal_skills": $CRESTAL_SKILLS,
"common_skills": $COMMON_SKILLS
}
EOF
)
# Make the API call
curl -X POST "$BASE_URL/agents" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $JWT_TOKEN" \
-d "$JSON_DATA"