acp-plugin-gamesdk 0.1.15__py3-none-any.whl → 0.1.17__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.
- acp_plugin_gamesdk/acp_plugin.py +11 -10
- {acp_plugin_gamesdk-0.1.15.dist-info → acp_plugin_gamesdk-0.1.17.dist-info}/METADATA +1 -1
- {acp_plugin_gamesdk-0.1.15.dist-info → acp_plugin_gamesdk-0.1.17.dist-info}/RECORD +4 -4
- {acp_plugin_gamesdk-0.1.15.dist-info → acp_plugin_gamesdk-0.1.17.dist-info}/WHEEL +0 -0
acp_plugin_gamesdk/acp_plugin.py
CHANGED
@@ -13,6 +13,7 @@ import socketio.client
|
|
13
13
|
from game_sdk.game.agent import WorkerConfig
|
14
14
|
from game_sdk.game.custom_types import Argument, Function, FunctionResultStatus
|
15
15
|
from twitter_plugin_gamesdk.twitter_plugin import TwitterPlugin
|
16
|
+
from twitter_plugin_gamesdk.game_twitter_plugin import GameTwitterPlugin
|
16
17
|
from acp_plugin_gamesdk.acp_client import AcpClient
|
17
18
|
from acp_plugin_gamesdk.acp_token import AcpToken
|
18
19
|
from acp_plugin_gamesdk.interface import AcpJobPhasesDesc, IDeliverable, IInventory, AcpJob
|
@@ -21,7 +22,7 @@ from acp_plugin_gamesdk.interface import AcpJobPhasesDesc, IDeliverable, IInvent
|
|
21
22
|
class AcpPluginOptions:
|
22
23
|
api_key: str
|
23
24
|
acp_token_client: AcpToken
|
24
|
-
twitter_plugin: TwitterPlugin
|
25
|
+
twitter_plugin: TwitterPlugin | GameTwitterPlugin = None
|
25
26
|
cluster: Optional[str] = None
|
26
27
|
evaluator_cluster: Optional[str] = None
|
27
28
|
on_evaluate: Optional[Callable[[IDeliverable], Tuple[bool, str]]] = None
|
@@ -167,7 +168,7 @@ class AcpPlugin:
|
|
167
168
|
self.deliver_job,
|
168
169
|
]
|
169
170
|
|
170
|
-
def get_environment() -> Dict[str, Any]:
|
171
|
+
def get_environment(function_result, current_state) -> Dict[str, Any]:
|
171
172
|
environment = data.get_environment() if hasattr(data, "get_environment") else {}
|
172
173
|
return {
|
173
174
|
**environment,
|
@@ -370,8 +371,8 @@ class AcpPlugin:
|
|
370
371
|
)
|
371
372
|
|
372
373
|
if (hasattr(self, 'twitter_plugin') and self.twitter_plugin is not None and tweetContent is not None):
|
373
|
-
post_tweet_fn = self.twitter_plugin.
|
374
|
-
tweet_id = post_tweet_fn(
|
374
|
+
post_tweet_fn = self.twitter_plugin.get_function('post_tweet')
|
375
|
+
tweet_id = post_tweet_fn(tweetContent, None).get('data', {}).get('id')
|
375
376
|
if (tweet_id is not None):
|
376
377
|
self.acp_client.add_tweet(job_id, tweet_id, tweetContent)
|
377
378
|
print("Tweet has been posted")
|
@@ -459,8 +460,8 @@ class AcpPlugin:
|
|
459
460
|
tweet_history = job.get("tweetHistory", [])
|
460
461
|
tweet_id = tweet_history[-1].get("tweetId") if tweet_history else None
|
461
462
|
if (tweet_id is not None):
|
462
|
-
reply_tweet_fn = self.twitter_plugin.
|
463
|
-
tweet_id = reply_tweet_fn(
|
463
|
+
reply_tweet_fn = self.twitter_plugin.get_function('reply_tweet')
|
464
|
+
tweet_id = reply_tweet_fn(tweet_id,tweetContent, None).get('data', {}).get('id')
|
464
465
|
if (tweet_id is not None):
|
465
466
|
self.acp_client.add_tweet(jobId ,tweet_id, tweetContent)
|
466
467
|
print("Tweet has been posted")
|
@@ -546,8 +547,8 @@ class AcpPlugin:
|
|
546
547
|
tweet_history = job.get("tweetHistory", [])
|
547
548
|
tweet_id = tweet_history[-1].get("tweetId") if tweet_history else None
|
548
549
|
if (tweet_id is not None):
|
549
|
-
reply_tweet_fn = self.twitter_plugin.
|
550
|
-
tweet_id = reply_tweet_fn(
|
550
|
+
reply_tweet_fn = self.twitter_plugin.get_function('reply_tweet')
|
551
|
+
tweet_id = reply_tweet_fn(tweet_id,tweetContent, None).get('data', {}).get('id')
|
551
552
|
if (tweet_id is not None):
|
552
553
|
self.acp_client.add_tweet(jobId ,tweet_id, tweetContent)
|
553
554
|
print("Tweet has been posted")
|
@@ -651,8 +652,8 @@ class AcpPlugin:
|
|
651
652
|
tweet_history = job.get("tweetHistory", [])
|
652
653
|
tweet_id = tweet_history[-1].get("tweetId") if tweet_history else None
|
653
654
|
if (tweet_id is not None):
|
654
|
-
reply_tweet_fn = self.twitter_plugin.
|
655
|
-
tweet_id = reply_tweet_fn(
|
655
|
+
reply_tweet_fn = self.twitter_plugin.get_function('reply_tweet')
|
656
|
+
tweet_id = reply_tweet_fn(tweet_id,tweetContent, None).get('data', {}).get('id')
|
656
657
|
if (tweet_id is not None):
|
657
658
|
self.acp_client.add_tweet(jobId ,tweet_id, tweetContent)
|
658
659
|
print("Tweet has been posted")
|
@@ -1,8 +1,8 @@
|
|
1
1
|
acp_plugin_gamesdk/acp_client.py,sha256=zF-FLFJ2PbS3LeI3cDx63pJyWCAVb8YQn7yZHQQ9wtY,9254
|
2
|
-
acp_plugin_gamesdk/acp_plugin.py,sha256=
|
2
|
+
acp_plugin_gamesdk/acp_plugin.py,sha256=ixLH0HuFKvVk6NJVn9q0iiokw-LCHc2PIi_WOhnhMOI,28607
|
3
3
|
acp_plugin_gamesdk/acp_token.py,sha256=E7nkLVfXSzMozFoVcYGzVQyocnKQpohb_YlByZtVY_8,12078
|
4
4
|
acp_plugin_gamesdk/acp_token_abi.py,sha256=nllh9xOuDXxFFdhLklTTdtZxWZd2LcUTBoOP2d9xDTA,22319
|
5
5
|
acp_plugin_gamesdk/interface.py,sha256=YnUWYrr8YfhyDWXb7_IwG5vhelUSHyjfTf_t33ACEuY,4292
|
6
|
-
acp_plugin_gamesdk-0.1.
|
7
|
-
acp_plugin_gamesdk-0.1.
|
8
|
-
acp_plugin_gamesdk-0.1.
|
6
|
+
acp_plugin_gamesdk-0.1.17.dist-info/METADATA,sha256=oNFQ4zYmzqoo-crO8tOQSo-WQytGFvdsv7QQHj_RYag,12231
|
7
|
+
acp_plugin_gamesdk-0.1.17.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
8
|
+
acp_plugin_gamesdk-0.1.17.dist-info/RECORD,,
|
File without changes
|