intentkit 0.6.10.dev7__py3-none-any.whl → 0.6.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of intentkit might be problematic. Click here for more details.
- intentkit/__init__.py +1 -1
- intentkit/clients/cdp.py +21 -7
- intentkit/config/config.py +43 -16
- intentkit/core/credit.py +29 -0
- intentkit/core/engine.py +10 -138
- intentkit/core/prompt.py +423 -42
- intentkit/models/llm.py +6 -5
- intentkit/skills/xmtp/__init__.py +16 -0
- intentkit/skills/xmtp/price.py +72 -0
- intentkit/skills/xmtp/schema.json +32 -0
- intentkit/skills/xmtp/swap.py +213 -0
- intentkit/skills/xmtp/transfer.py +16 -5
- {intentkit-0.6.10.dev7.dist-info → intentkit-0.6.11.dist-info}/METADATA +2 -1
- {intentkit-0.6.10.dev7.dist-info → intentkit-0.6.11.dist-info}/RECORD +16 -14
- {intentkit-0.6.10.dev7.dist-info → intentkit-0.6.11.dist-info}/WHEEL +0 -0
- {intentkit-0.6.10.dev7.dist-info → intentkit-0.6.11.dist-info}/licenses/LICENSE +0 -0
intentkit/__init__.py
CHANGED
intentkit/clients/cdp.py
CHANGED
|
@@ -17,6 +17,7 @@ from intentkit.models.agent import Agent
|
|
|
17
17
|
from intentkit.models.agent_data import AgentData
|
|
18
18
|
|
|
19
19
|
_clients: Dict[str, "CdpClient"] = {}
|
|
20
|
+
_origin_cdp_client: Optional[OriginCdpClient] = None
|
|
20
21
|
|
|
21
22
|
logger = logging.getLogger(__name__)
|
|
22
23
|
|
|
@@ -56,6 +57,24 @@ def bip39_seed_to_eth_keys(seed_hex: str) -> Dict[str, str]:
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
|
|
60
|
+
def get_origin_cdp_client(skill_store: SkillStoreABC) -> OriginCdpClient:
|
|
61
|
+
global _origin_cdp_client
|
|
62
|
+
if _origin_cdp_client:
|
|
63
|
+
return _origin_cdp_client
|
|
64
|
+
|
|
65
|
+
# Get credentials from skill store system config
|
|
66
|
+
api_key_id = skill_store.get_system_config("cdp_api_key_id")
|
|
67
|
+
api_key_secret = skill_store.get_system_config("cdp_api_key_secret")
|
|
68
|
+
wallet_secret = skill_store.get_system_config("cdp_wallet_secret")
|
|
69
|
+
|
|
70
|
+
_origin_cdp_client = OriginCdpClient(
|
|
71
|
+
api_key_id=api_key_id,
|
|
72
|
+
api_key_secret=api_key_secret,
|
|
73
|
+
wallet_secret=wallet_secret,
|
|
74
|
+
)
|
|
75
|
+
return _origin_cdp_client
|
|
76
|
+
|
|
77
|
+
|
|
59
78
|
class CdpClient:
|
|
60
79
|
def __init__(self, agent_id: str, skill_store: SkillStoreABC) -> None:
|
|
61
80
|
self._agent_id = agent_id
|
|
@@ -81,11 +100,7 @@ class CdpClient:
|
|
|
81
100
|
# new agent or address not migrated yet
|
|
82
101
|
if not address:
|
|
83
102
|
# create cdp client for later use
|
|
84
|
-
cdp_client =
|
|
85
|
-
api_key_id=api_key_id,
|
|
86
|
-
api_key_secret=api_key_secret,
|
|
87
|
-
wallet_secret=wallet_secret,
|
|
88
|
-
)
|
|
103
|
+
cdp_client = get_origin_cdp_client(self._skill_store)
|
|
89
104
|
# try migrating from v1 cdp_wallet_data
|
|
90
105
|
if agent_data.cdp_wallet_data:
|
|
91
106
|
wallet_data = json.loads(agent_data.cdp_wallet_data)
|
|
@@ -115,8 +130,7 @@ class CdpClient:
|
|
|
115
130
|
address = new_account.address
|
|
116
131
|
logger.info("Created new wallet: %s", address)
|
|
117
132
|
|
|
118
|
-
# close client
|
|
119
|
-
await cdp_client.close()
|
|
133
|
+
# do not close cached global client
|
|
120
134
|
# now it should be created or migrated, store it
|
|
121
135
|
agent_data.evm_wallet_address = address
|
|
122
136
|
await agent_data.save()
|
intentkit/config/config.py
CHANGED
|
@@ -51,23 +51,23 @@ class Config:
|
|
|
51
51
|
}
|
|
52
52
|
else:
|
|
53
53
|
self.db = {
|
|
54
|
-
"username": self.load("DB_USERNAME"),
|
|
55
|
-
"password": self.load("DB_PASSWORD"),
|
|
56
|
-
"host": self.load("DB_HOST"),
|
|
57
|
-
"port": self.load("DB_PORT"),
|
|
58
|
-
"dbname": self.load("DB_NAME"),
|
|
54
|
+
"username": self.load("DB_USERNAME", ""),
|
|
55
|
+
"password": self.load("DB_PASSWORD", ""),
|
|
56
|
+
"host": self.load("DB_HOST", ""),
|
|
57
|
+
"port": self.load("DB_PORT", "5432"),
|
|
58
|
+
"dbname": self.load("DB_NAME", ""),
|
|
59
59
|
}
|
|
60
60
|
# ==== this part can be load from env or aws secrets manager
|
|
61
61
|
self.db["auto_migrate"] = self.load("DB_AUTO_MIGRATE", "true") == "true"
|
|
62
|
-
self.db["pool_size"] =
|
|
62
|
+
self.db["pool_size"] = self.load_int("DB_POOL_SIZE", 3)
|
|
63
63
|
self.debug = self.load("DEBUG") == "true"
|
|
64
64
|
self.debug_checkpoint = (
|
|
65
65
|
self.load("DEBUG_CHECKPOINT", "false") == "true"
|
|
66
66
|
) # log with checkpoint
|
|
67
67
|
# Redis
|
|
68
68
|
self.redis_host = self.load("REDIS_HOST")
|
|
69
|
-
self.redis_port =
|
|
70
|
-
self.redis_db =
|
|
69
|
+
self.redis_port = self.load_int("REDIS_PORT", 6379)
|
|
70
|
+
self.redis_db = self.load_int("REDIS_DB", 0)
|
|
71
71
|
# AWS
|
|
72
72
|
self.aws_s3_bucket = self.load("AWS_S3_BUCKET")
|
|
73
73
|
self.aws_s3_cdn_url = self.load("AWS_S3_CDN_URL")
|
|
@@ -97,7 +97,7 @@ class Config:
|
|
|
97
97
|
self.reigent_api_key = self.load("REIGENT_API_KEY")
|
|
98
98
|
self.venice_api_key = self.load("VENICE_API_KEY")
|
|
99
99
|
self.system_prompt = self.load("SYSTEM_PROMPT")
|
|
100
|
-
self.input_token_limit =
|
|
100
|
+
self.input_token_limit = self.load_int("INPUT_TOKEN_LIMIT", 60000)
|
|
101
101
|
# Telegram server settings
|
|
102
102
|
self.tg_base_url = self.load("TG_BASE_URL")
|
|
103
103
|
self.tg_server_host = self.load("TG_SERVER_HOST", "127.0.0.1")
|
|
@@ -107,8 +107,8 @@ class Config:
|
|
|
107
107
|
self.twitter_oauth2_client_id = self.load("TWITTER_OAUTH2_CLIENT_ID")
|
|
108
108
|
self.twitter_oauth2_client_secret = self.load("TWITTER_OAUTH2_CLIENT_SECRET")
|
|
109
109
|
self.twitter_oauth2_redirect_uri = self.load("TWITTER_OAUTH2_REDIRECT_URI")
|
|
110
|
-
self.twitter_entrypoint_interval =
|
|
111
|
-
|
|
110
|
+
self.twitter_entrypoint_interval = self.load_int(
|
|
111
|
+
"TWITTER_ENTRYPOINT_INTERVAL", 5
|
|
112
112
|
) # in minutes
|
|
113
113
|
# Slack Alert
|
|
114
114
|
self.slack_alert_token = self.load("SLACK_ALERT_TOKEN")
|
|
@@ -126,12 +126,12 @@ class Config:
|
|
|
126
126
|
self.firecrawl_api_key = self.load("FIRECRAWL_API_KEY")
|
|
127
127
|
# Sentry
|
|
128
128
|
self.sentry_dsn = self.load("SENTRY_DSN")
|
|
129
|
-
self.sentry_sample_rate =
|
|
130
|
-
self.sentry_traces_sample_rate =
|
|
131
|
-
|
|
129
|
+
self.sentry_sample_rate = self.load_float("SENTRY_SAMPLE_RATE", 0.1)
|
|
130
|
+
self.sentry_traces_sample_rate = self.load_float(
|
|
131
|
+
"SENTRY_TRACES_SAMPLE_RATE", 0.01
|
|
132
132
|
)
|
|
133
|
-
self.sentry_profiles_sample_rate =
|
|
134
|
-
|
|
133
|
+
self.sentry_profiles_sample_rate = self.load_float(
|
|
134
|
+
"SENTRY_PROFILES_SAMPLE_RATE", 0.01
|
|
135
135
|
)
|
|
136
136
|
# RPC Providers
|
|
137
137
|
self.quicknode_api_key = self.load("QUICKNODE_API_KEY")
|
|
@@ -164,11 +164,38 @@ class Config:
|
|
|
164
164
|
def load(self, key, default=None):
|
|
165
165
|
"""Load a secret from the secrets map or env"""
|
|
166
166
|
value = self.secrets.get(key, os.getenv(key, default))
|
|
167
|
+
|
|
168
|
+
# If value is empty string, use default instead
|
|
169
|
+
if value == "":
|
|
170
|
+
value = default
|
|
171
|
+
|
|
167
172
|
if value:
|
|
168
173
|
value = value.replace("\\n", "\n")
|
|
169
174
|
if value and value.startswith("'") and value.endswith("'"):
|
|
170
175
|
value = value[1:-1]
|
|
171
176
|
return value
|
|
172
177
|
|
|
178
|
+
def load_int(self, key, default=0):
|
|
179
|
+
"""Load an integer value from env, handling empty strings gracefully"""
|
|
180
|
+
value = self.load(key, str(default))
|
|
181
|
+
if value is None or value == "":
|
|
182
|
+
return default
|
|
183
|
+
try:
|
|
184
|
+
return int(value)
|
|
185
|
+
except (ValueError, TypeError):
|
|
186
|
+
logger.warning(f"Invalid integer value for {key}, using default: {default}")
|
|
187
|
+
return default
|
|
188
|
+
|
|
189
|
+
def load_float(self, key, default=0.0):
|
|
190
|
+
"""Load a float value from env, handling empty strings gracefully"""
|
|
191
|
+
value = self.load(key, str(default))
|
|
192
|
+
if value is None or value == "":
|
|
193
|
+
return default
|
|
194
|
+
try:
|
|
195
|
+
return float(value)
|
|
196
|
+
except (ValueError, TypeError):
|
|
197
|
+
logger.warning(f"Invalid float value for {key}, using default: {default}")
|
|
198
|
+
return default
|
|
199
|
+
|
|
173
200
|
|
|
174
201
|
config: Config = Config()
|
intentkit/core/credit.py
CHANGED
|
@@ -38,6 +38,7 @@ from intentkit.models.credit import (
|
|
|
38
38
|
)
|
|
39
39
|
from intentkit.models.db import get_session
|
|
40
40
|
from intentkit.models.skill import Skill
|
|
41
|
+
from intentkit.utils.slack_alert import send_slack_message
|
|
41
42
|
|
|
42
43
|
logger = logging.getLogger(__name__)
|
|
43
44
|
|
|
@@ -185,6 +186,19 @@ async def recharge(
|
|
|
185
186
|
# Commit all changes
|
|
186
187
|
await session.commit()
|
|
187
188
|
|
|
189
|
+
# Send Slack notification for recharge
|
|
190
|
+
try:
|
|
191
|
+
send_slack_message(
|
|
192
|
+
f"💰 **Credit Recharge**\n"
|
|
193
|
+
f"• User ID: `{user_id}`\n"
|
|
194
|
+
f"• Amount: `{amount}` credits\n"
|
|
195
|
+
f"• Transaction ID: `{upstream_tx_id}`\n"
|
|
196
|
+
f"• New Balance: `{user_account.credits + user_account.free_credits + user_account.reward_credits}` credits\n"
|
|
197
|
+
f"• Note: {note or 'N/A'}"
|
|
198
|
+
)
|
|
199
|
+
except Exception as e:
|
|
200
|
+
logger.error(f"Failed to send Slack notification for recharge: {str(e)}")
|
|
201
|
+
|
|
188
202
|
return user_account
|
|
189
203
|
|
|
190
204
|
|
|
@@ -294,6 +308,21 @@ async def reward(
|
|
|
294
308
|
# Commit all changes
|
|
295
309
|
await session.commit()
|
|
296
310
|
|
|
311
|
+
# Send Slack notification for reward
|
|
312
|
+
try:
|
|
313
|
+
reward_type_name = reward_type.value if reward_type else "REWARD"
|
|
314
|
+
send_slack_message(
|
|
315
|
+
f"🎁 **Credit Reward**\n"
|
|
316
|
+
f"• User ID: `{user_id}`\n"
|
|
317
|
+
f"• Amount: `{amount}` reward credits\n"
|
|
318
|
+
f"• Transaction ID: `{upstream_tx_id}`\n"
|
|
319
|
+
f"• Reward Type: `{reward_type_name}`\n"
|
|
320
|
+
f"• New Balance: `{user_account.credits + user_account.free_credits + user_account.reward_credits}` credits\n"
|
|
321
|
+
f"• Note: {note or 'N/A'}"
|
|
322
|
+
)
|
|
323
|
+
except Exception as e:
|
|
324
|
+
logger.error(f"Failed to send Slack notification for reward: {str(e)}")
|
|
325
|
+
|
|
297
326
|
return user_account
|
|
298
327
|
|
|
299
328
|
|
intentkit/core/engine.py
CHANGED
|
@@ -26,12 +26,10 @@ from langchain_core.messages import (
|
|
|
26
26
|
BaseMessage,
|
|
27
27
|
HumanMessage,
|
|
28
28
|
)
|
|
29
|
-
from langchain_core.prompts import ChatPromptTemplate
|
|
30
29
|
from langchain_core.tools import BaseTool
|
|
31
30
|
from langgraph.errors import GraphRecursionError
|
|
32
31
|
from langgraph.graph.state import CompiledStateGraph
|
|
33
32
|
from langgraph.prebuilt import create_react_agent
|
|
34
|
-
from langgraph.runtime import Runtime
|
|
35
33
|
from sqlalchemy import func, update
|
|
36
34
|
from sqlalchemy.exc import SQLAlchemyError
|
|
37
35
|
|
|
@@ -39,7 +37,10 @@ from intentkit.abstracts.graph import AgentContext, AgentError, AgentState
|
|
|
39
37
|
from intentkit.config.config import config
|
|
40
38
|
from intentkit.core.credit import expense_message, expense_skill
|
|
41
39
|
from intentkit.core.node import PreModelNode, post_model_node
|
|
42
|
-
from intentkit.core.prompt import
|
|
40
|
+
from intentkit.core.prompt import (
|
|
41
|
+
create_formatted_prompt_function,
|
|
42
|
+
explain_prompt,
|
|
43
|
+
)
|
|
43
44
|
from intentkit.core.skill import skill_store
|
|
44
45
|
from intentkit.models.agent import Agent, AgentTable
|
|
45
46
|
from intentkit.models.agent_data import AgentData, AgentQuota
|
|
@@ -53,51 +54,13 @@ from intentkit.models.chat import (
|
|
|
53
54
|
from intentkit.models.credit import CreditAccount, OwnerType
|
|
54
55
|
from intentkit.models.db import get_langgraph_checkpointer, get_session
|
|
55
56
|
from intentkit.models.llm import LLMModelInfo, LLMProvider
|
|
56
|
-
from intentkit.models.skill import AgentSkillData,
|
|
57
|
+
from intentkit.models.skill import AgentSkillData, ThreadSkillData
|
|
57
58
|
from intentkit.models.user import User
|
|
58
59
|
from intentkit.utils.error import IntentKitAPIError
|
|
59
60
|
|
|
60
61
|
logger = logging.getLogger(__name__)
|
|
61
62
|
|
|
62
63
|
|
|
63
|
-
async def explain_prompt(message: str) -> str:
|
|
64
|
-
"""
|
|
65
|
-
Process message to replace @skill:*:* patterns with (call skill xxxxx) format.
|
|
66
|
-
|
|
67
|
-
Args:
|
|
68
|
-
message (str): The input message to process
|
|
69
|
-
|
|
70
|
-
Returns:
|
|
71
|
-
str: The processed message with @skill patterns replaced
|
|
72
|
-
"""
|
|
73
|
-
# Pattern to match @skill:category:config_name with word boundaries
|
|
74
|
-
pattern = r"\b@skill:([^:]+):([^\s]+)\b"
|
|
75
|
-
|
|
76
|
-
async def replace_skill_pattern(match):
|
|
77
|
-
category = match.group(1)
|
|
78
|
-
config_name = match.group(2)
|
|
79
|
-
|
|
80
|
-
# Get skill by category and config_name
|
|
81
|
-
skill = await Skill.get_by_config_name(category, config_name)
|
|
82
|
-
|
|
83
|
-
if skill:
|
|
84
|
-
return f"(call skill {skill.name})"
|
|
85
|
-
else:
|
|
86
|
-
# If skill not found, keep original pattern
|
|
87
|
-
return match.group(0)
|
|
88
|
-
|
|
89
|
-
# Find all matches
|
|
90
|
-
matches = list(re.finditer(pattern, message))
|
|
91
|
-
|
|
92
|
-
# Process matches in reverse order to maintain string positions
|
|
93
|
-
result = message
|
|
94
|
-
for match in reversed(matches):
|
|
95
|
-
replacement = await replace_skill_pattern(match)
|
|
96
|
-
result = result[: match.start()] + replacement + result[match.end() :]
|
|
97
|
-
|
|
98
|
-
return result
|
|
99
|
-
|
|
100
|
-
|
|
101
64
|
# Global variable to cache all agent executors
|
|
102
65
|
_agents: dict[str, CompiledStateGraph] = {}
|
|
103
66
|
_private_agents: dict[str, CompiledStateGraph] = {}
|
|
@@ -176,106 +139,15 @@ async def create_agent(
|
|
|
176
139
|
has_search
|
|
177
140
|
and llm_model.info.provider == LLMProvider.OPENAI
|
|
178
141
|
and llm_model.info.supports_search
|
|
142
|
+
and not agent.model.startswith(
|
|
143
|
+
"gpt-5"
|
|
144
|
+
) # tmp disable gpt-5 search since package bugs
|
|
179
145
|
):
|
|
180
146
|
tools.append({"type": "web_search_preview"})
|
|
181
147
|
|
|
182
|
-
#
|
|
183
|
-
|
|
184
|
-
# Escape curly braces in the prompt
|
|
185
|
-
escaped_prompt = prompt.replace("{", "{{").replace("}", "}}")
|
|
186
|
-
# Process message to handle @skill patterns
|
|
187
|
-
if config.admin_llm_skill_control:
|
|
188
|
-
escaped_prompt = await explain_prompt(escaped_prompt)
|
|
189
|
-
prompt_array = [
|
|
190
|
-
("placeholder", "{system_prompt}"),
|
|
191
|
-
("placeholder", "{messages}"),
|
|
192
|
-
]
|
|
193
|
-
if agent.prompt_append:
|
|
194
|
-
# Escape any curly braces in prompt_append
|
|
195
|
-
escaped_append = agent.prompt_append.replace("{", "{{").replace("}", "}}")
|
|
196
|
-
# Process message to handle @skill patterns
|
|
197
|
-
if config.admin_llm_skill_control:
|
|
198
|
-
escaped_append = await explain_prompt(escaped_append)
|
|
199
|
-
prompt_array.append(("system", escaped_append))
|
|
200
|
-
|
|
201
|
-
prompt_temp = ChatPromptTemplate.from_messages(prompt_array)
|
|
202
|
-
|
|
203
|
-
async def formatted_prompt(
|
|
204
|
-
state: AgentState, runtime: Runtime[AgentContext]
|
|
205
|
-
) -> list[BaseMessage]:
|
|
206
|
-
final_system_prompt = escaped_prompt
|
|
207
|
-
context = runtime.context
|
|
208
|
-
logger.debug(f"formatted_prompt, context: {context}")
|
|
209
|
-
if context.entrypoint:
|
|
210
|
-
entrypoint = context.entrypoint
|
|
211
|
-
entrypoint_prompt = None
|
|
212
|
-
if (
|
|
213
|
-
agent.twitter_entrypoint_enabled
|
|
214
|
-
and agent.twitter_entrypoint_prompt
|
|
215
|
-
and entrypoint == AuthorType.TWITTER.value
|
|
216
|
-
):
|
|
217
|
-
entrypoint_prompt = agent.twitter_entrypoint_prompt
|
|
218
|
-
logger.debug("twitter entrypoint prompt added")
|
|
219
|
-
elif (
|
|
220
|
-
agent.telegram_entrypoint_enabled
|
|
221
|
-
and agent.telegram_entrypoint_prompt
|
|
222
|
-
and entrypoint == AuthorType.TELEGRAM.value
|
|
223
|
-
):
|
|
224
|
-
entrypoint_prompt = agent.telegram_entrypoint_prompt
|
|
225
|
-
logger.debug("telegram entrypoint prompt added")
|
|
226
|
-
elif entrypoint == AuthorType.TRIGGER.value:
|
|
227
|
-
task_id = context.chat_id.removeprefix("autonomous-")
|
|
228
|
-
# Find the autonomous task by task_id
|
|
229
|
-
autonomous_task = None
|
|
230
|
-
if agent.autonomous:
|
|
231
|
-
for task in agent.autonomous:
|
|
232
|
-
if task.id == task_id:
|
|
233
|
-
autonomous_task = task
|
|
234
|
-
break
|
|
235
|
-
|
|
236
|
-
if autonomous_task:
|
|
237
|
-
# Build detailed task info - always include task_id
|
|
238
|
-
if autonomous_task.name:
|
|
239
|
-
task_info = f"You are running an autonomous task '{autonomous_task.name}' (ID: {task_id})"
|
|
240
|
-
else:
|
|
241
|
-
task_info = (
|
|
242
|
-
f"You are running an autonomous task (ID: {task_id})"
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
# Add description if available
|
|
246
|
-
if autonomous_task.description:
|
|
247
|
-
task_info += f": {autonomous_task.description}"
|
|
248
|
-
|
|
249
|
-
# Add cycle info
|
|
250
|
-
if autonomous_task.minutes:
|
|
251
|
-
task_info += f". This task runs every {autonomous_task.minutes} minute(s)"
|
|
252
|
-
elif autonomous_task.cron:
|
|
253
|
-
task_info += (
|
|
254
|
-
f". This task runs on schedule: {autonomous_task.cron}"
|
|
255
|
-
)
|
|
148
|
+
# Create the formatted_prompt function using the refactored prompt module
|
|
149
|
+
formatted_prompt = create_formatted_prompt_function(agent, agent_data)
|
|
256
150
|
|
|
257
|
-
entrypoint_prompt = f"{task_info}. "
|
|
258
|
-
else:
|
|
259
|
-
# Fallback if task not found
|
|
260
|
-
entrypoint_prompt = f"You are running an autonomous task. The task id is {task_id}. "
|
|
261
|
-
if entrypoint_prompt:
|
|
262
|
-
entrypoint_prompt = await explain_prompt(entrypoint_prompt)
|
|
263
|
-
final_system_prompt = f"{final_system_prompt}## Entrypoint rules\n\n{entrypoint_prompt}\n\n"
|
|
264
|
-
final_system_prompt = f"{final_system_prompt}## Internal Info\n\n"
|
|
265
|
-
"These are for your internal use. You can use them when querying or storing data, "
|
|
266
|
-
"but please do not directly share this information with users.\n\n"
|
|
267
|
-
final_system_prompt = f"{final_system_prompt}chat_id: {context.chat_id}\n\n"
|
|
268
|
-
if context.user_id:
|
|
269
|
-
final_system_prompt = f"{final_system_prompt}user_id: {context.user_id}\n\n"
|
|
270
|
-
system_prompt = [("system", final_system_prompt)]
|
|
271
|
-
return prompt_temp.invoke(
|
|
272
|
-
{"messages": state["messages"], "system_prompt": system_prompt}
|
|
273
|
-
)
|
|
274
|
-
|
|
275
|
-
# log final prompt and all skills
|
|
276
|
-
logger.debug(
|
|
277
|
-
f"[{agent.id}{'-private' if is_private else ''}] init prompt: {escaped_prompt}"
|
|
278
|
-
)
|
|
279
151
|
for tool in tools:
|
|
280
152
|
logger.info(
|
|
281
153
|
f"[{agent.id}{'-private' if is_private else ''}] loaded tool: {tool.name if isinstance(tool, BaseTool) else tool}"
|