intentkit 0.8.17.dev1__py3-none-any.whl → 0.8.17.dev2__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/abstracts/agent.py +4 -5
- intentkit/abstracts/engine.py +5 -5
- intentkit/abstracts/graph.py +6 -5
- intentkit/abstracts/skill.py +5 -5
- intentkit/abstracts/twitter.py +4 -5
- intentkit/clients/cdp.py +19 -77
- intentkit/clients/twitter.py +26 -34
- intentkit/clients/web3.py +1 -3
- intentkit/config/config.py +4 -0
- intentkit/core/agent.py +15 -15
- intentkit/core/asset.py +1 -2
- intentkit/core/client.py +1 -1
- intentkit/core/credit.py +19 -20
- intentkit/core/engine.py +2 -4
- intentkit/core/node.py +2 -1
- intentkit/core/prompt.py +3 -4
- intentkit/core/scheduler.py +1 -1
- intentkit/core/statistics.py +6 -7
- intentkit/models/agent.py +125 -92
- intentkit/models/agent_data.py +62 -36
- intentkit/models/app_setting.py +6 -6
- intentkit/models/chat.py +27 -24
- intentkit/models/conversation.py +8 -8
- intentkit/models/credit.py +62 -64
- intentkit/models/db.py +8 -7
- intentkit/models/db_mig.py +2 -2
- intentkit/models/llm.py +12 -14
- intentkit/models/redis.py +2 -3
- intentkit/models/skill.py +25 -27
- intentkit/models/user.py +21 -22
- intentkit/skills/acolyt/ask.py +3 -4
- intentkit/skills/acolyt/base.py +1 -3
- intentkit/skills/aixbt/base.py +1 -3
- intentkit/skills/aixbt/projects.py +13 -13
- intentkit/skills/allora/base.py +1 -3
- intentkit/skills/allora/price.py +2 -3
- intentkit/skills/base.py +15 -22
- intentkit/skills/basename/__init__.py +3 -5
- intentkit/skills/carv/__init__.py +7 -8
- intentkit/skills/carv/base.py +6 -6
- intentkit/skills/carv/fetch_news.py +3 -3
- intentkit/skills/carv/onchain_query.py +4 -4
- intentkit/skills/carv/token_info_and_price.py +5 -5
- intentkit/skills/casino/base.py +1 -3
- intentkit/skills/casino/deck_draw.py +1 -2
- intentkit/skills/casino/deck_shuffle.py +1 -2
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +3 -5
- intentkit/skills/cdp/base.py +1 -3
- intentkit/skills/chainlist/base.py +1 -3
- intentkit/skills/chainlist/chain_lookup.py +18 -18
- intentkit/skills/common/base.py +1 -3
- intentkit/skills/common/current_time.py +1 -2
- intentkit/skills/cookiefun/base.py +1 -2
- intentkit/skills/cookiefun/get_account_details.py +7 -7
- intentkit/skills/cookiefun/get_account_feed.py +19 -19
- intentkit/skills/cookiefun/get_account_smart_followers.py +7 -7
- intentkit/skills/cookiefun/get_sectors.py +3 -3
- intentkit/skills/cookiefun/search_accounts.py +9 -9
- intentkit/skills/cryptocompare/api.py +2 -3
- intentkit/skills/cryptocompare/base.py +6 -6
- intentkit/skills/cryptocompare/fetch_news.py +3 -4
- intentkit/skills/cryptocompare/fetch_price.py +5 -6
- intentkit/skills/cryptocompare/fetch_top_exchanges.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_market_cap.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_volume.py +3 -4
- intentkit/skills/cryptocompare/fetch_trading_signals.py +4 -5
- intentkit/skills/cryptopanic/__init__.py +4 -4
- intentkit/skills/cryptopanic/base.py +1 -3
- intentkit/skills/cryptopanic/fetch_crypto_news.py +3 -5
- intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +3 -3
- intentkit/skills/dapplooker/base.py +1 -3
- intentkit/skills/dapplooker/dapplooker_token_data.py +7 -7
- intentkit/skills/defillama/api.py +6 -9
- intentkit/skills/defillama/base.py +5 -6
- intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +6 -8
- intentkit/skills/defillama/coins/fetch_block.py +4 -6
- intentkit/skills/defillama/coins/fetch_current_prices.py +6 -8
- intentkit/skills/defillama/coins/fetch_first_price.py +5 -7
- intentkit/skills/defillama/coins/fetch_historical_prices.py +7 -9
- intentkit/skills/defillama/coins/fetch_price_chart.py +7 -9
- intentkit/skills/defillama/coins/fetch_price_percentage.py +5 -7
- intentkit/skills/defillama/config/chains.py +1 -3
- intentkit/skills/defillama/fees/fetch_fees_overview.py +22 -24
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +14 -16
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +6 -8
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +3 -5
- intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +5 -7
- intentkit/skills/defillama/tests/api_integration.test.py +1 -1
- intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -4
- intentkit/skills/defillama/tvl/fetch_chains.py +7 -9
- intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -4
- intentkit/skills/defillama/tvl/fetch_protocol.py +30 -36
- intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +1 -3
- intentkit/skills/defillama/tvl/fetch_protocols.py +35 -43
- intentkit/skills/defillama/volumes/fetch_dex_overview.py +40 -46
- intentkit/skills/defillama/volumes/fetch_dex_summary.py +33 -35
- intentkit/skills/defillama/volumes/fetch_options_overview.py +22 -26
- intentkit/skills/defillama/yields/fetch_pool_chart.py +8 -10
- intentkit/skills/defillama/yields/fetch_pools.py +24 -28
- intentkit/skills/dexscreener/__init__.py +2 -2
- intentkit/skills/dexscreener/base.py +3 -3
- intentkit/skills/dexscreener/get_pair_info.py +2 -2
- intentkit/skills/dexscreener/get_token_pairs.py +2 -2
- intentkit/skills/dexscreener/get_tokens_info.py +5 -5
- intentkit/skills/dexscreener/model/search_token_response.py +80 -82
- intentkit/skills/dexscreener/search_token.py +182 -182
- intentkit/skills/dexscreener/utils.py +15 -14
- intentkit/skills/dune_analytics/__init__.py +4 -4
- intentkit/skills/dune_analytics/base.py +1 -3
- intentkit/skills/dune_analytics/fetch_kol_buys.py +4 -4
- intentkit/skills/dune_analytics/fetch_nation_metrics.py +5 -5
- intentkit/skills/elfa/base.py +1 -3
- intentkit/skills/elfa/mention.py +19 -21
- intentkit/skills/elfa/stats.py +4 -4
- intentkit/skills/elfa/tokens.py +12 -12
- intentkit/skills/elfa/utils.py +25 -27
- intentkit/skills/enso/__init__.py +2 -2
- intentkit/skills/enso/base.py +5 -8
- intentkit/skills/enso/best_yield.py +4 -6
- intentkit/skills/enso/networks.py +1 -2
- intentkit/skills/enso/prices.py +1 -3
- intentkit/skills/enso/route.py +1 -3
- intentkit/skills/enso/tokens.py +1 -3
- intentkit/skills/enso/wallet.py +5 -5
- intentkit/skills/erc20/__init__.py +4 -6
- intentkit/skills/erc721/__init__.py +4 -6
- intentkit/skills/firecrawl/base.py +1 -3
- intentkit/skills/firecrawl/clear.py +1 -2
- intentkit/skills/firecrawl/crawl.py +9 -10
- intentkit/skills/firecrawl/query.py +1 -2
- intentkit/skills/firecrawl/scrape.py +7 -8
- intentkit/skills/firecrawl/utils.py +13 -13
- intentkit/skills/github/base.py +1 -3
- intentkit/skills/github/github_search.py +1 -2
- intentkit/skills/heurist/base.py +1 -3
- intentkit/skills/heurist/image_generation_animagine_xl.py +7 -8
- intentkit/skills/heurist/image_generation_arthemy_comics.py +7 -8
- intentkit/skills/heurist/image_generation_arthemy_real.py +7 -8
- intentkit/skills/heurist/image_generation_braindance.py +7 -8
- intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +7 -8
- intentkit/skills/heurist/image_generation_flux_1_dev.py +7 -8
- intentkit/skills/heurist/image_generation_sdxl.py +7 -8
- intentkit/skills/http/base.py +1 -3
- intentkit/skills/http/get.py +7 -7
- intentkit/skills/http/post.py +9 -9
- intentkit/skills/http/put.py +9 -9
- intentkit/skills/lifi/__init__.py +4 -4
- intentkit/skills/lifi/base.py +1 -3
- intentkit/skills/lifi/token_execute.py +13 -13
- intentkit/skills/lifi/token_quote.py +6 -6
- intentkit/skills/lifi/utils.py +16 -16
- intentkit/skills/moralis/__init__.py +3 -3
- intentkit/skills/moralis/api.py +6 -7
- intentkit/skills/moralis/base.py +2 -4
- intentkit/skills/moralis/fetch_chain_portfolio.py +10 -11
- intentkit/skills/moralis/fetch_nft_portfolio.py +22 -22
- intentkit/skills/moralis/fetch_solana_portfolio.py +11 -12
- intentkit/skills/moralis/fetch_wallet_portfolio.py +8 -9
- intentkit/skills/morpho/__init__.py +4 -6
- intentkit/skills/nation/__init__.py +2 -2
- intentkit/skills/nation/base.py +1 -3
- intentkit/skills/nation/nft_check.py +3 -4
- intentkit/skills/onchain.py +2 -6
- intentkit/skills/openai/base.py +1 -3
- intentkit/skills/openai/dalle_image_generation.py +1 -3
- intentkit/skills/openai/gpt_image_generation.py +2 -3
- intentkit/skills/openai/gpt_image_to_image.py +2 -3
- intentkit/skills/openai/image_to_text.py +1 -2
- intentkit/skills/portfolio/base.py +6 -6
- intentkit/skills/portfolio/token_balances.py +21 -21
- intentkit/skills/portfolio/wallet_approvals.py +7 -7
- intentkit/skills/portfolio/wallet_defi_positions.py +3 -3
- intentkit/skills/portfolio/wallet_history.py +21 -21
- intentkit/skills/portfolio/wallet_net_worth.py +13 -13
- intentkit/skills/portfolio/wallet_nfts.py +19 -19
- intentkit/skills/portfolio/wallet_profitability.py +7 -7
- intentkit/skills/portfolio/wallet_profitability_summary.py +5 -5
- intentkit/skills/portfolio/wallet_stats.py +3 -3
- intentkit/skills/portfolio/wallet_swaps.py +19 -19
- intentkit/skills/pyth/__init__.py +3 -5
- intentkit/skills/slack/base.py +2 -4
- intentkit/skills/slack/get_channel.py +8 -8
- intentkit/skills/slack/get_message.py +9 -9
- intentkit/skills/slack/schedule_message.py +5 -5
- intentkit/skills/slack/send_message.py +3 -5
- intentkit/skills/supabase/base.py +1 -3
- intentkit/skills/supabase/delete_data.py +4 -4
- intentkit/skills/supabase/fetch_data.py +12 -12
- intentkit/skills/supabase/insert_data.py +4 -4
- intentkit/skills/supabase/invoke_function.py +6 -6
- intentkit/skills/supabase/update_data.py +6 -6
- intentkit/skills/supabase/upsert_data.py +4 -4
- intentkit/skills/superfluid/__init__.py +4 -6
- intentkit/skills/system/add_autonomous_task.py +8 -10
- intentkit/skills/system/edit_autonomous_task.py +12 -14
- intentkit/skills/system/list_autonomous_tasks.py +1 -3
- intentkit/skills/tavily/base.py +1 -3
- intentkit/skills/tavily/tavily_extract.py +1 -2
- intentkit/skills/tavily/tavily_search.py +1 -3
- intentkit/skills/token/base.py +5 -5
- intentkit/skills/token/erc20_transfers.py +19 -19
- intentkit/skills/token/token_analytics.py +3 -3
- intentkit/skills/token/token_price.py +13 -13
- intentkit/skills/token/token_search.py +9 -9
- intentkit/skills/twitter/base.py +3 -4
- intentkit/skills/twitter/follow_user.py +1 -2
- intentkit/skills/twitter/get_mentions.py +3 -4
- intentkit/skills/twitter/get_timeline.py +1 -2
- intentkit/skills/twitter/get_user_by_username.py +1 -2
- intentkit/skills/twitter/get_user_tweets.py +2 -3
- intentkit/skills/twitter/like_tweet.py +1 -2
- intentkit/skills/twitter/post_tweet.py +3 -4
- intentkit/skills/twitter/reply_tweet.py +3 -4
- intentkit/skills/twitter/retweet.py +1 -2
- intentkit/skills/twitter/search_tweets.py +1 -2
- intentkit/skills/unrealspeech/base.py +1 -3
- intentkit/skills/unrealspeech/text_to_speech.py +8 -8
- intentkit/skills/venice_audio/__init__.py +8 -9
- intentkit/skills/venice_audio/base.py +3 -4
- intentkit/skills/venice_audio/input.py +41 -41
- intentkit/skills/venice_audio/venice_audio.py +6 -6
- intentkit/skills/venice_image/__init__.py +5 -5
- intentkit/skills/venice_image/api.py +138 -138
- intentkit/skills/venice_image/base.py +3 -3
- intentkit/skills/venice_image/config.py +33 -35
- intentkit/skills/venice_image/image_enhance/image_enhance.py +2 -3
- intentkit/skills/venice_image/image_enhance/image_enhance_base.py +21 -23
- intentkit/skills/venice_image/image_enhance/image_enhance_input.py +38 -40
- intentkit/skills/venice_image/image_generation/image_generation_base.py +9 -9
- intentkit/skills/venice_image/image_generation/image_generation_fluently_xl.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_flux_dev.py +27 -27
- intentkit/skills/venice_image/image_generation/image_generation_flux_dev_uncensored.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_input.py +158 -158
- intentkit/skills/venice_image/image_generation/image_generation_lustify_sdxl.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_pony_realism.py +26 -26
- intentkit/skills/venice_image/image_generation/image_generation_stable_diffusion_3_5.py +28 -28
- intentkit/skills/venice_image/image_generation/image_generation_venice_sd35.py +28 -28
- intentkit/skills/venice_image/image_upscale/image_upscale.py +3 -3
- intentkit/skills/venice_image/image_upscale/image_upscale_base.py +21 -23
- intentkit/skills/venice_image/image_upscale/image_upscale_input.py +22 -22
- intentkit/skills/venice_image/image_vision/image_vision.py +2 -2
- intentkit/skills/venice_image/image_vision/image_vision_base.py +17 -17
- intentkit/skills/venice_image/image_vision/image_vision_input.py +9 -9
- intentkit/skills/venice_image/utils.py +77 -78
- intentkit/skills/web_scraper/base.py +1 -3
- intentkit/skills/web_scraper/document_indexer.py +1 -2
- intentkit/skills/web_scraper/scrape_and_index.py +4 -5
- intentkit/skills/web_scraper/utils.py +25 -26
- intentkit/skills/web_scraper/website_indexer.py +10 -11
- intentkit/skills/weth/__init__.py +4 -6
- intentkit/skills/wow/__init__.py +4 -6
- intentkit/skills/x402/__init__.py +2 -2
- intentkit/skills/x402/ask_agent.py +7 -7
- intentkit/skills/x402/base.py +2 -1
- intentkit/skills/x402/http_request.py +10 -10
- intentkit/skills/xmtp/base.py +3 -3
- intentkit/skills/xmtp/price.py +2 -2
- intentkit/skills/xmtp/swap.py +2 -4
- intentkit/skills/xmtp/transfer.py +4 -6
- intentkit/utils/error.py +2 -2
- intentkit/utils/logging.py +2 -4
- intentkit/utils/s3.py +8 -9
- intentkit/utils/schema.py +5 -5
- intentkit/utils/slack_alert.py +7 -8
- {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/METADATA +3 -4
- intentkit-0.8.17.dev2.dist-info/RECORD +464 -0
- intentkit/models/generator.py +0 -347
- intentkit-0.8.17.dev1.dist-info/RECORD +0 -465
- {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/WHEEL +0 -0
- {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/licenses/LICENSE +0 -0
intentkit/models/agent.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import hashlib
|
|
2
4
|
import json
|
|
3
5
|
import logging
|
|
4
6
|
import re
|
|
5
7
|
import textwrap
|
|
6
|
-
from datetime import
|
|
8
|
+
from datetime import UTC, datetime
|
|
7
9
|
from decimal import Decimal
|
|
8
10
|
from pathlib import Path
|
|
9
|
-
from typing import Annotated, Any,
|
|
11
|
+
from typing import Annotated, Any, Literal
|
|
10
12
|
|
|
11
13
|
import jsonref
|
|
12
14
|
import yaml
|
|
@@ -57,7 +59,7 @@ class AgentAutonomous(BaseModel):
|
|
|
57
59
|
),
|
|
58
60
|
]
|
|
59
61
|
name: Annotated[
|
|
60
|
-
|
|
62
|
+
str | None,
|
|
61
63
|
PydanticField(
|
|
62
64
|
default=None,
|
|
63
65
|
description="Display name of the autonomous configuration",
|
|
@@ -68,7 +70,7 @@ class AgentAutonomous(BaseModel):
|
|
|
68
70
|
),
|
|
69
71
|
]
|
|
70
72
|
description: Annotated[
|
|
71
|
-
|
|
73
|
+
str | None,
|
|
72
74
|
PydanticField(
|
|
73
75
|
default=None,
|
|
74
76
|
description="Description of the autonomous configuration",
|
|
@@ -79,7 +81,7 @@ class AgentAutonomous(BaseModel):
|
|
|
79
81
|
),
|
|
80
82
|
]
|
|
81
83
|
minutes: Annotated[
|
|
82
|
-
|
|
84
|
+
int | None,
|
|
83
85
|
PydanticField(
|
|
84
86
|
default=None,
|
|
85
87
|
description="Interval in minutes between operations, mutually exclusive with cron",
|
|
@@ -89,7 +91,7 @@ class AgentAutonomous(BaseModel):
|
|
|
89
91
|
),
|
|
90
92
|
]
|
|
91
93
|
cron: Annotated[
|
|
92
|
-
|
|
94
|
+
str | None,
|
|
93
95
|
PydanticField(
|
|
94
96
|
default=None,
|
|
95
97
|
description="Cron expression for scheduling operations, mutually exclusive with minutes",
|
|
@@ -109,7 +111,7 @@ class AgentAutonomous(BaseModel):
|
|
|
109
111
|
),
|
|
110
112
|
]
|
|
111
113
|
enabled: Annotated[
|
|
112
|
-
|
|
114
|
+
bool | None,
|
|
113
115
|
PydanticField(
|
|
114
116
|
default=False,
|
|
115
117
|
description="Whether the autonomous configuration is enabled",
|
|
@@ -289,6 +291,17 @@ class AgentUserInputColumns:
|
|
|
289
291
|
nullable=True,
|
|
290
292
|
comment="Telegram integration configuration settings",
|
|
291
293
|
)
|
|
294
|
+
discord_entrypoint_enabled = Column(
|
|
295
|
+
Boolean,
|
|
296
|
+
nullable=True,
|
|
297
|
+
default=False,
|
|
298
|
+
comment="Whether the agent can receive events from Discord",
|
|
299
|
+
)
|
|
300
|
+
discord_config = Column(
|
|
301
|
+
JSON().with_variant(JSONB(), "postgresql"),
|
|
302
|
+
nullable=True,
|
|
303
|
+
comment="Discord integration configuration settings",
|
|
304
|
+
)
|
|
292
305
|
xmtp_entrypoint_prompt = Column(
|
|
293
306
|
String,
|
|
294
307
|
nullable=True,
|
|
@@ -421,7 +434,7 @@ class AgentTable(Base, AgentUserInputColumns):
|
|
|
421
434
|
DateTime(timezone=True),
|
|
422
435
|
nullable=False,
|
|
423
436
|
server_default=func.now(),
|
|
424
|
-
onupdate=lambda: datetime.now(
|
|
437
|
+
onupdate=lambda: datetime.now(UTC),
|
|
425
438
|
comment="Timestamp when the agent was last updated",
|
|
426
439
|
)
|
|
427
440
|
|
|
@@ -430,7 +443,7 @@ class AgentCore(BaseModel):
|
|
|
430
443
|
"""Agent core model."""
|
|
431
444
|
|
|
432
445
|
name: Annotated[
|
|
433
|
-
|
|
446
|
+
str | None,
|
|
434
447
|
PydanticField(
|
|
435
448
|
default=None,
|
|
436
449
|
title="Name",
|
|
@@ -439,14 +452,14 @@ class AgentCore(BaseModel):
|
|
|
439
452
|
),
|
|
440
453
|
]
|
|
441
454
|
picture: Annotated[
|
|
442
|
-
|
|
455
|
+
str | None,
|
|
443
456
|
PydanticField(
|
|
444
457
|
default=None,
|
|
445
458
|
description="Avatar of the agent",
|
|
446
459
|
),
|
|
447
460
|
]
|
|
448
461
|
purpose: Annotated[
|
|
449
|
-
|
|
462
|
+
str | None,
|
|
450
463
|
PydanticField(
|
|
451
464
|
default=None,
|
|
452
465
|
description="Purpose or role of the agent",
|
|
@@ -454,7 +467,7 @@ class AgentCore(BaseModel):
|
|
|
454
467
|
),
|
|
455
468
|
]
|
|
456
469
|
personality: Annotated[
|
|
457
|
-
|
|
470
|
+
str | None,
|
|
458
471
|
PydanticField(
|
|
459
472
|
default=None,
|
|
460
473
|
description="Personality traits of the agent",
|
|
@@ -462,7 +475,7 @@ class AgentCore(BaseModel):
|
|
|
462
475
|
),
|
|
463
476
|
]
|
|
464
477
|
principles: Annotated[
|
|
465
|
-
|
|
478
|
+
str | None,
|
|
466
479
|
PydanticField(
|
|
467
480
|
default=None,
|
|
468
481
|
description="Principles or values of the agent",
|
|
@@ -478,7 +491,7 @@ class AgentCore(BaseModel):
|
|
|
478
491
|
),
|
|
479
492
|
]
|
|
480
493
|
prompt: Annotated[
|
|
481
|
-
|
|
494
|
+
str | None,
|
|
482
495
|
PydanticField(
|
|
483
496
|
default=None,
|
|
484
497
|
description="Base system prompt that defines the agent's behavior and capabilities",
|
|
@@ -486,7 +499,7 @@ class AgentCore(BaseModel):
|
|
|
486
499
|
),
|
|
487
500
|
]
|
|
488
501
|
prompt_append: Annotated[
|
|
489
|
-
|
|
502
|
+
str | None,
|
|
490
503
|
PydanticField(
|
|
491
504
|
default=None,
|
|
492
505
|
description="Additional system prompt that has higher priority than the base prompt",
|
|
@@ -494,7 +507,7 @@ class AgentCore(BaseModel):
|
|
|
494
507
|
),
|
|
495
508
|
]
|
|
496
509
|
temperature: Annotated[
|
|
497
|
-
|
|
510
|
+
float | None,
|
|
498
511
|
PydanticField(
|
|
499
512
|
default=0.7,
|
|
500
513
|
description="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. (0.0~2.0)",
|
|
@@ -503,7 +516,7 @@ class AgentCore(BaseModel):
|
|
|
503
516
|
),
|
|
504
517
|
]
|
|
505
518
|
frequency_penalty: Annotated[
|
|
506
|
-
|
|
519
|
+
float | None,
|
|
507
520
|
PydanticField(
|
|
508
521
|
default=0.0,
|
|
509
522
|
description="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. (-2.0~2.0)",
|
|
@@ -512,7 +525,7 @@ class AgentCore(BaseModel):
|
|
|
512
525
|
),
|
|
513
526
|
]
|
|
514
527
|
presence_penalty: Annotated[
|
|
515
|
-
|
|
528
|
+
float | None,
|
|
516
529
|
PydanticField(
|
|
517
530
|
default=0.0,
|
|
518
531
|
description="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. (-2.0~2.0)",
|
|
@@ -521,37 +534,36 @@ class AgentCore(BaseModel):
|
|
|
521
534
|
),
|
|
522
535
|
]
|
|
523
536
|
wallet_provider: Annotated[
|
|
524
|
-
|
|
537
|
+
Literal["cdp", "readonly", "none"] | None,
|
|
525
538
|
PydanticField(
|
|
526
539
|
default=None,
|
|
527
540
|
description="Provider of the agent's wallet",
|
|
528
541
|
),
|
|
529
542
|
]
|
|
530
543
|
readonly_wallet_address: Annotated[
|
|
531
|
-
|
|
544
|
+
str | None,
|
|
532
545
|
PydanticField(
|
|
533
546
|
default=None,
|
|
534
547
|
description="Address of the agent's wallet, only used when wallet_provider is readonly. Agent will not be able to sign transactions.",
|
|
535
548
|
),
|
|
536
549
|
]
|
|
537
550
|
network_id: Annotated[
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
],
|
|
551
|
+
Literal[
|
|
552
|
+
"base-mainnet",
|
|
553
|
+
"ethereum-mainnet",
|
|
554
|
+
"polygon-mainnet",
|
|
555
|
+
"arbitrum-mainnet",
|
|
556
|
+
"optimism-mainnet",
|
|
557
|
+
"solana",
|
|
558
|
+
]
|
|
559
|
+
| None,
|
|
548
560
|
PydanticField(
|
|
549
561
|
default="base-mainnet",
|
|
550
562
|
description="Network identifier",
|
|
551
563
|
),
|
|
552
564
|
]
|
|
553
565
|
skills: Annotated[
|
|
554
|
-
|
|
566
|
+
dict[str, Any] | None,
|
|
555
567
|
PydanticField(
|
|
556
568
|
default=None,
|
|
557
569
|
description="Dict of skills and their corresponding configurations",
|
|
@@ -597,7 +609,7 @@ class AgentUserInput(AgentCore):
|
|
|
597
609
|
)
|
|
598
610
|
|
|
599
611
|
short_term_memory_strategy: Annotated[
|
|
600
|
-
|
|
612
|
+
Literal["trim", "summarize"] | None,
|
|
601
613
|
PydanticField(
|
|
602
614
|
default="trim",
|
|
603
615
|
description="Strategy for managing short-term memory when context limit is reached. 'trim' removes oldest messages, 'summarize' creates summaries.",
|
|
@@ -605,7 +617,7 @@ class AgentUserInput(AgentCore):
|
|
|
605
617
|
]
|
|
606
618
|
# autonomous mode
|
|
607
619
|
autonomous: Annotated[
|
|
608
|
-
|
|
620
|
+
list[AgentAutonomous] | None,
|
|
609
621
|
PydanticField(
|
|
610
622
|
default=None,
|
|
611
623
|
description=(
|
|
@@ -626,14 +638,14 @@ class AgentUserInput(AgentCore):
|
|
|
626
638
|
]
|
|
627
639
|
# if telegram_entrypoint_enabled, the telegram_entrypoint_enabled will be enabled, telegram_config will be checked
|
|
628
640
|
telegram_entrypoint_enabled: Annotated[
|
|
629
|
-
|
|
641
|
+
bool | None,
|
|
630
642
|
PydanticField(
|
|
631
643
|
default=False,
|
|
632
644
|
description="Whether the agent can play telegram bot",
|
|
633
645
|
),
|
|
634
646
|
]
|
|
635
647
|
telegram_entrypoint_prompt: Annotated[
|
|
636
|
-
|
|
648
|
+
str | None,
|
|
637
649
|
PydanticField(
|
|
638
650
|
default=None,
|
|
639
651
|
description="Extra prompt for telegram entrypoint",
|
|
@@ -641,14 +653,34 @@ class AgentUserInput(AgentCore):
|
|
|
641
653
|
),
|
|
642
654
|
]
|
|
643
655
|
telegram_config: Annotated[
|
|
644
|
-
|
|
656
|
+
dict | None,
|
|
645
657
|
PydanticField(
|
|
646
658
|
default=None,
|
|
647
659
|
description="Telegram integration configuration settings",
|
|
648
660
|
),
|
|
649
661
|
]
|
|
662
|
+
discord_entrypoint_enabled: Annotated[
|
|
663
|
+
bool | None,
|
|
664
|
+
PydanticField(
|
|
665
|
+
default=False,
|
|
666
|
+
description="Whether the agent can play discord bot",
|
|
667
|
+
json_schema_extra={
|
|
668
|
+
"x-group": "entrypoint",
|
|
669
|
+
},
|
|
670
|
+
),
|
|
671
|
+
]
|
|
672
|
+
discord_config: Annotated[
|
|
673
|
+
dict | None,
|
|
674
|
+
PydanticField(
|
|
675
|
+
default=None,
|
|
676
|
+
description="Discord integration configuration settings including token, whitelists, and behavior settings",
|
|
677
|
+
json_schema_extra={
|
|
678
|
+
"x-group": "entrypoint",
|
|
679
|
+
},
|
|
680
|
+
),
|
|
681
|
+
]
|
|
650
682
|
xmtp_entrypoint_prompt: Annotated[
|
|
651
|
-
|
|
683
|
+
str | None,
|
|
652
684
|
PydanticField(
|
|
653
685
|
default=None,
|
|
654
686
|
description="Extra prompt for xmtp entrypoint, xmtp support is in beta",
|
|
@@ -669,7 +701,7 @@ class AgentUpdate(AgentUserInput):
|
|
|
669
701
|
)
|
|
670
702
|
|
|
671
703
|
upstream_id: Annotated[
|
|
672
|
-
|
|
704
|
+
str | None,
|
|
673
705
|
PydanticField(
|
|
674
706
|
default=None,
|
|
675
707
|
description="External reference ID for idempotent operations",
|
|
@@ -677,7 +709,7 @@ class AgentUpdate(AgentUserInput):
|
|
|
677
709
|
),
|
|
678
710
|
]
|
|
679
711
|
upstream_extra: Annotated[
|
|
680
|
-
|
|
712
|
+
dict[str, Any] | None,
|
|
681
713
|
PydanticField(
|
|
682
714
|
default=None,
|
|
683
715
|
description="Additional data store for upstream use",
|
|
@@ -689,7 +721,7 @@ class AgentUpdate(AgentUserInput):
|
|
|
689
721
|
|
|
690
722
|
@field_validator("purpose", "personality", "principles", "prompt", "prompt_append")
|
|
691
723
|
@classmethod
|
|
692
|
-
def validate_no_level1_level2_headings(cls, v:
|
|
724
|
+
def validate_no_level1_level2_headings(cls, v: str | None) -> str | None:
|
|
693
725
|
"""Validate that the text doesn't contain level 1 or level 2 headings."""
|
|
694
726
|
if v is None:
|
|
695
727
|
return v
|
|
@@ -848,7 +880,7 @@ class AgentCreate(AgentUpdate):
|
|
|
848
880
|
),
|
|
849
881
|
]
|
|
850
882
|
owner: Annotated[
|
|
851
|
-
|
|
883
|
+
str | None,
|
|
852
884
|
PydanticField(
|
|
853
885
|
default=None,
|
|
854
886
|
description="Owner identifier of the agent, used for access control",
|
|
@@ -870,7 +902,7 @@ class AgentCreate(AgentUpdate):
|
|
|
870
902
|
message="Upstream id already in use",
|
|
871
903
|
)
|
|
872
904
|
|
|
873
|
-
async def get_by_upstream_id(self) ->
|
|
905
|
+
async def get_by_upstream_id(self) -> Agent | None:
|
|
874
906
|
if not self.upstream_id:
|
|
875
907
|
return None
|
|
876
908
|
async with get_session() as db:
|
|
@@ -913,7 +945,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
913
945
|
)
|
|
914
946
|
|
|
915
947
|
description: Annotated[
|
|
916
|
-
|
|
948
|
+
str | None,
|
|
917
949
|
PydanticField(
|
|
918
950
|
default=None,
|
|
919
951
|
description="Description of the agent, for public view, not contained in prompt",
|
|
@@ -923,7 +955,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
923
955
|
),
|
|
924
956
|
]
|
|
925
957
|
external_website: Annotated[
|
|
926
|
-
|
|
958
|
+
str | None,
|
|
927
959
|
PydanticField(
|
|
928
960
|
default=None,
|
|
929
961
|
description="Link of external website of the agent, if you have one",
|
|
@@ -934,7 +966,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
934
966
|
),
|
|
935
967
|
]
|
|
936
968
|
ticker: Annotated[
|
|
937
|
-
|
|
969
|
+
str | None,
|
|
938
970
|
PydanticField(
|
|
939
971
|
default=None,
|
|
940
972
|
description="Ticker symbol of the agent",
|
|
@@ -946,7 +978,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
946
978
|
),
|
|
947
979
|
]
|
|
948
980
|
token_address: Annotated[
|
|
949
|
-
|
|
981
|
+
str | None,
|
|
950
982
|
PydanticField(
|
|
951
983
|
default=None,
|
|
952
984
|
description="Token address of the agent",
|
|
@@ -957,7 +989,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
957
989
|
),
|
|
958
990
|
]
|
|
959
991
|
token_pool: Annotated[
|
|
960
|
-
|
|
992
|
+
str | None,
|
|
961
993
|
PydanticField(
|
|
962
994
|
default=None,
|
|
963
995
|
description="Pool of the agent token",
|
|
@@ -968,7 +1000,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
968
1000
|
),
|
|
969
1001
|
]
|
|
970
1002
|
fee_percentage: Annotated[
|
|
971
|
-
|
|
1003
|
+
Decimal | None,
|
|
972
1004
|
PydanticField(
|
|
973
1005
|
default=None,
|
|
974
1006
|
description="Fee percentage of the agent",
|
|
@@ -979,7 +1011,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
979
1011
|
),
|
|
980
1012
|
]
|
|
981
1013
|
example_intro: Annotated[
|
|
982
|
-
|
|
1014
|
+
str | None,
|
|
983
1015
|
PydanticField(
|
|
984
1016
|
default=None,
|
|
985
1017
|
description="Introduction of the example",
|
|
@@ -990,7 +1022,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
990
1022
|
),
|
|
991
1023
|
]
|
|
992
1024
|
examples: Annotated[
|
|
993
|
-
|
|
1025
|
+
list[AgentExample] | None,
|
|
994
1026
|
PydanticField(
|
|
995
1027
|
default=None,
|
|
996
1028
|
description="List of example prompts for the agent",
|
|
@@ -1001,7 +1033,7 @@ class AgentPublicInfo(BaseModel):
|
|
|
1001
1033
|
),
|
|
1002
1034
|
]
|
|
1003
1035
|
public_extra: Annotated[
|
|
1004
|
-
|
|
1036
|
+
dict[str, Any] | None,
|
|
1005
1037
|
PydanticField(
|
|
1006
1038
|
default=None,
|
|
1007
1039
|
description="Public extra data of the agent",
|
|
@@ -1049,7 +1081,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1049
1081
|
model_config = ConfigDict(from_attributes=True)
|
|
1050
1082
|
|
|
1051
1083
|
slug: Annotated[
|
|
1052
|
-
|
|
1084
|
+
str | None,
|
|
1053
1085
|
PydanticField(
|
|
1054
1086
|
default=None,
|
|
1055
1087
|
description="Slug of the agent, used for URL generation",
|
|
@@ -1058,49 +1090,49 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1058
1090
|
),
|
|
1059
1091
|
]
|
|
1060
1092
|
version: Annotated[
|
|
1061
|
-
|
|
1093
|
+
str | None,
|
|
1062
1094
|
PydanticField(
|
|
1063
1095
|
default=None,
|
|
1064
1096
|
description="Version hash of the agent",
|
|
1065
1097
|
),
|
|
1066
1098
|
]
|
|
1067
1099
|
statistics: Annotated[
|
|
1068
|
-
|
|
1100
|
+
dict[str, Any] | None,
|
|
1069
1101
|
PydanticField(
|
|
1070
1102
|
default=None,
|
|
1071
1103
|
description="Statistics of the agent, update every 1 hour for query",
|
|
1072
1104
|
),
|
|
1073
1105
|
]
|
|
1074
1106
|
assets: Annotated[
|
|
1075
|
-
|
|
1107
|
+
dict[str, Any] | None,
|
|
1076
1108
|
PydanticField(
|
|
1077
1109
|
default=None,
|
|
1078
1110
|
description="Assets of the agent, update every 1 hour for query",
|
|
1079
1111
|
),
|
|
1080
1112
|
]
|
|
1081
1113
|
account_snapshot: Annotated[
|
|
1082
|
-
|
|
1114
|
+
CreditAccount | None,
|
|
1083
1115
|
PydanticField(
|
|
1084
1116
|
default=None,
|
|
1085
1117
|
description="Account snapshot of the agent, update every 1 hour for query",
|
|
1086
1118
|
),
|
|
1087
1119
|
]
|
|
1088
1120
|
extra: Annotated[
|
|
1089
|
-
|
|
1121
|
+
dict[str, Any] | None,
|
|
1090
1122
|
PydanticField(
|
|
1091
1123
|
default=None,
|
|
1092
1124
|
description="Other helper data fields for query, come from agent and agent data",
|
|
1093
1125
|
),
|
|
1094
1126
|
]
|
|
1095
1127
|
deployed_at: Annotated[
|
|
1096
|
-
|
|
1128
|
+
datetime | None,
|
|
1097
1129
|
PydanticField(
|
|
1098
1130
|
default=None,
|
|
1099
1131
|
description="Timestamp when the agent was deployed",
|
|
1100
1132
|
),
|
|
1101
1133
|
]
|
|
1102
1134
|
public_info_updated_at: Annotated[
|
|
1103
|
-
|
|
1135
|
+
datetime | None,
|
|
1104
1136
|
PydanticField(
|
|
1105
1137
|
default=None,
|
|
1106
1138
|
description="Timestamp when the agent public info was last updated",
|
|
@@ -1238,7 +1270,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1238
1270
|
)
|
|
1239
1271
|
yaml_lines.append(yaml_value.rstrip())
|
|
1240
1272
|
elif isinstance(value, list) and value and hasattr(value[0], "model_dump"):
|
|
1241
|
-
# Handle list of Pydantic models (e.g.,
|
|
1273
|
+
# Handle list of Pydantic models (e.g., list[AgentAutonomous])
|
|
1242
1274
|
yaml_lines.append(f"{field_name}:")
|
|
1243
1275
|
# Convert each Pydantic model to dict
|
|
1244
1276
|
model_dicts = [item.model_dump(exclude_none=True) for item in value]
|
|
@@ -1284,7 +1316,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1284
1316
|
return await db.scalar(select(func.count(AgentTable.id)))
|
|
1285
1317
|
|
|
1286
1318
|
@classmethod
|
|
1287
|
-
async def get(cls, agent_id: str) ->
|
|
1319
|
+
async def get(cls, agent_id: str) -> "Agent" | None:
|
|
1288
1320
|
async with get_session() as db:
|
|
1289
1321
|
item = await db.scalar(select(AgentTable).where(AgentTable.id == agent_id))
|
|
1290
1322
|
if item is None:
|
|
@@ -1292,7 +1324,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1292
1324
|
return cls.model_validate(item)
|
|
1293
1325
|
|
|
1294
1326
|
@classmethod
|
|
1295
|
-
async def get_by_id_or_slug(cls, agent_id: str) ->
|
|
1327
|
+
async def get_by_id_or_slug(cls, agent_id: str) -> "Agent" | None:
|
|
1296
1328
|
"""Get agent by ID or slug.
|
|
1297
1329
|
|
|
1298
1330
|
First tries to get by ID if agent_id length <= 20,
|
|
@@ -1322,12 +1354,12 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1322
1354
|
|
|
1323
1355
|
@staticmethod
|
|
1324
1356
|
def _deserialize_autonomous(
|
|
1325
|
-
autonomous_data:
|
|
1326
|
-
) ->
|
|
1357
|
+
autonomous_data: list[Any] | None,
|
|
1358
|
+
) -> list[AgentAutonomous]:
|
|
1327
1359
|
if not autonomous_data:
|
|
1328
1360
|
return []
|
|
1329
1361
|
|
|
1330
|
-
deserialized:
|
|
1362
|
+
deserialized: list[AgentAutonomous] = []
|
|
1331
1363
|
for entry in autonomous_data:
|
|
1332
1364
|
if isinstance(entry, AgentAutonomous):
|
|
1333
1365
|
deserialized.append(entry)
|
|
@@ -1336,7 +1368,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1336
1368
|
return deserialized
|
|
1337
1369
|
|
|
1338
1370
|
@staticmethod
|
|
1339
|
-
def _serialize_autonomous(tasks:
|
|
1371
|
+
def _serialize_autonomous(tasks: list[AgentAutonomous]) -> list[dict[str, Any]]:
|
|
1340
1372
|
return [task.model_dump() for task in tasks]
|
|
1341
1373
|
|
|
1342
1374
|
@staticmethod
|
|
@@ -1347,7 +1379,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1347
1379
|
"Only deployed agents can call this feature.",
|
|
1348
1380
|
)
|
|
1349
1381
|
|
|
1350
|
-
async def list_autonomous_tasks(self) ->
|
|
1382
|
+
async def list_autonomous_tasks(self) -> list[AgentAutonomous]:
|
|
1351
1383
|
persisted = await Agent.get(self.id)
|
|
1352
1384
|
if persisted is None:
|
|
1353
1385
|
raise self._autonomous_not_allowed_error()
|
|
@@ -1403,8 +1435,8 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1403
1435
|
|
|
1404
1436
|
current_tasks = self._deserialize_autonomous(db_agent.autonomous)
|
|
1405
1437
|
|
|
1406
|
-
updated_task:
|
|
1407
|
-
rewritten_tasks:
|
|
1438
|
+
updated_task: AgentAutonomous | None = None
|
|
1439
|
+
rewritten_tasks: list[AgentAutonomous] = []
|
|
1408
1440
|
for task in current_tasks:
|
|
1409
1441
|
if task.id == task_id:
|
|
1410
1442
|
task_dict = task.model_dump()
|
|
@@ -1427,11 +1459,11 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1427
1459
|
self.autonomous = rewritten_tasks
|
|
1428
1460
|
return updated_task
|
|
1429
1461
|
|
|
1430
|
-
def skill_config(self, category: str) ->
|
|
1462
|
+
def skill_config(self, category: str) -> dict[str, Any]:
|
|
1431
1463
|
return self.skills.get(category, {}) if self.skills else {}
|
|
1432
1464
|
|
|
1433
1465
|
@staticmethod
|
|
1434
|
-
def _is_agent_owner_only_skill(skill_schema:
|
|
1466
|
+
def _is_agent_owner_only_skill(skill_schema: dict[str, Any]) -> bool:
|
|
1435
1467
|
"""Check if a skill requires agent owner API keys only based on its resolved schema."""
|
|
1436
1468
|
if (
|
|
1437
1469
|
skill_schema
|
|
@@ -1450,7 +1482,7 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1450
1482
|
cls,
|
|
1451
1483
|
db: AsyncSession = None,
|
|
1452
1484
|
filter_owner_api_skills: bool = False,
|
|
1453
|
-
) ->
|
|
1485
|
+
) -> dict:
|
|
1454
1486
|
"""Get the JSON schema for Agent model with all $ref references resolved.
|
|
1455
1487
|
|
|
1456
1488
|
This is the shared function that handles admin configuration filtering
|
|
@@ -1638,34 +1670,35 @@ class AgentResponse(Agent):
|
|
|
1638
1670
|
)
|
|
1639
1671
|
|
|
1640
1672
|
# Override privacy fields to exclude them from JSON schema
|
|
1641
|
-
purpose: SkipJsonSchema[
|
|
1642
|
-
personality: SkipJsonSchema[
|
|
1643
|
-
principles: SkipJsonSchema[
|
|
1644
|
-
prompt: SkipJsonSchema[
|
|
1645
|
-
prompt_append: SkipJsonSchema[
|
|
1646
|
-
temperature: SkipJsonSchema[
|
|
1647
|
-
frequency_penalty: SkipJsonSchema[
|
|
1648
|
-
telegram_entrypoint_prompt: SkipJsonSchema[
|
|
1649
|
-
telegram_config: SkipJsonSchema[
|
|
1650
|
-
|
|
1673
|
+
purpose: SkipJsonSchema[str | None] = None
|
|
1674
|
+
personality: SkipJsonSchema[str | None] = None
|
|
1675
|
+
principles: SkipJsonSchema[str | None] = None
|
|
1676
|
+
prompt: SkipJsonSchema[str | None] = None
|
|
1677
|
+
prompt_append: SkipJsonSchema[str | None] = None
|
|
1678
|
+
temperature: SkipJsonSchema[float | None] = None
|
|
1679
|
+
frequency_penalty: SkipJsonSchema[float | None] = None
|
|
1680
|
+
telegram_entrypoint_prompt: SkipJsonSchema[str | None] = None
|
|
1681
|
+
telegram_config: SkipJsonSchema[dict | None] = None
|
|
1682
|
+
discord_config: SkipJsonSchema[dict | None] = None
|
|
1683
|
+
xmtp_entrypoint_prompt: SkipJsonSchema[str | None] = None
|
|
1651
1684
|
|
|
1652
1685
|
# Additional fields specific to AgentResponse
|
|
1653
1686
|
cdp_wallet_address: Annotated[
|
|
1654
|
-
|
|
1687
|
+
str | None,
|
|
1655
1688
|
PydanticField(
|
|
1656
1689
|
default=None,
|
|
1657
1690
|
description="CDP wallet address of the agent",
|
|
1658
1691
|
),
|
|
1659
1692
|
]
|
|
1660
1693
|
evm_wallet_address: Annotated[
|
|
1661
|
-
|
|
1694
|
+
str | None,
|
|
1662
1695
|
PydanticField(
|
|
1663
1696
|
default=None,
|
|
1664
1697
|
description="EVM wallet address of the agent",
|
|
1665
1698
|
),
|
|
1666
1699
|
]
|
|
1667
1700
|
solana_wallet_address: Annotated[
|
|
1668
|
-
|
|
1701
|
+
str | None,
|
|
1669
1702
|
PydanticField(
|
|
1670
1703
|
default=None,
|
|
1671
1704
|
description="Solana wallet address of the agent",
|
|
@@ -1679,14 +1712,14 @@ class AgentResponse(Agent):
|
|
|
1679
1712
|
),
|
|
1680
1713
|
]
|
|
1681
1714
|
linked_twitter_username: Annotated[
|
|
1682
|
-
|
|
1715
|
+
str | None,
|
|
1683
1716
|
PydanticField(
|
|
1684
1717
|
default=None,
|
|
1685
1718
|
description="Linked Twitter username",
|
|
1686
1719
|
),
|
|
1687
1720
|
]
|
|
1688
1721
|
linked_twitter_name: Annotated[
|
|
1689
|
-
|
|
1722
|
+
str | None,
|
|
1690
1723
|
PydanticField(
|
|
1691
1724
|
default=None,
|
|
1692
1725
|
description="Linked Twitter display name",
|
|
@@ -1707,14 +1740,14 @@ class AgentResponse(Agent):
|
|
|
1707
1740
|
),
|
|
1708
1741
|
]
|
|
1709
1742
|
linked_telegram_username: Annotated[
|
|
1710
|
-
|
|
1743
|
+
str | None,
|
|
1711
1744
|
PydanticField(
|
|
1712
1745
|
default=None,
|
|
1713
1746
|
description="Linked Telegram username",
|
|
1714
1747
|
),
|
|
1715
1748
|
]
|
|
1716
1749
|
linked_telegram_name: Annotated[
|
|
1717
|
-
|
|
1750
|
+
str | None,
|
|
1718
1751
|
PydanticField(
|
|
1719
1752
|
default=None,
|
|
1720
1753
|
description="Linked Telegram display name",
|
|
@@ -1753,7 +1786,7 @@ class AgentResponse(Agent):
|
|
|
1753
1786
|
|
|
1754
1787
|
@classmethod
|
|
1755
1788
|
async def from_agent(
|
|
1756
|
-
cls, agent: Agent, agent_data:
|
|
1789
|
+
cls, agent: Agent, agent_data: AgentData | None = None
|
|
1757
1790
|
) -> "AgentResponse":
|
|
1758
1791
|
"""Create an AgentResponse from an Agent instance.
|
|
1759
1792
|
|
|
@@ -1778,8 +1811,7 @@ class AgentResponse(Agent):
|
|
|
1778
1811
|
linked_twitter_name = agent_data.twitter_name
|
|
1779
1812
|
if agent_data.twitter_access_token_expires_at:
|
|
1780
1813
|
has_twitter_linked = (
|
|
1781
|
-
agent_data.twitter_access_token_expires_at
|
|
1782
|
-
> datetime.now(timezone.utc)
|
|
1814
|
+
agent_data.twitter_access_token_expires_at > datetime.now(UTC)
|
|
1783
1815
|
)
|
|
1784
1816
|
else:
|
|
1785
1817
|
has_twitter_linked = True
|
|
@@ -1870,6 +1902,7 @@ class AgentResponse(Agent):
|
|
|
1870
1902
|
"frequency_penalty",
|
|
1871
1903
|
"telegram_entrypoint_prompt",
|
|
1872
1904
|
"telegram_config",
|
|
1905
|
+
"discord_config",
|
|
1873
1906
|
"xmtp_entrypoint_prompt",
|
|
1874
1907
|
}
|
|
1875
1908
|
for field in privacy_fields:
|