acp-plugin-gamesdk 0.1.14__py3-none-any.whl → 0.1.16__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 +10 -11
- acp_plugin_gamesdk/interface.py +10 -3
- {acp_plugin_gamesdk-0.1.14.dist-info → acp_plugin_gamesdk-0.1.16.dist-info}/METADATA +1 -1
- acp_plugin_gamesdk-0.1.16.dist-info/RECORD +8 -0
- acp_plugin_gamesdk-0.1.14.dist-info/RECORD +0 -8
- {acp_plugin_gamesdk-0.1.14.dist-info → acp_plugin_gamesdk-0.1.16.dist-info}/WHEEL +0 -0
acp_plugin_gamesdk/acp_plugin.py
CHANGED
@@ -13,7 +13,6 @@ 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
|
17
16
|
from acp_plugin_gamesdk.acp_client import AcpClient
|
18
17
|
from acp_plugin_gamesdk.acp_token import AcpToken
|
19
18
|
from acp_plugin_gamesdk.interface import AcpJobPhasesDesc, IDeliverable, IInventory, AcpJob
|
@@ -22,7 +21,7 @@ from acp_plugin_gamesdk.interface import AcpJobPhasesDesc, IDeliverable, IInvent
|
|
22
21
|
class AcpPluginOptions:
|
23
22
|
api_key: str
|
24
23
|
acp_token_client: AcpToken
|
25
|
-
twitter_plugin: TwitterPlugin
|
24
|
+
twitter_plugin: TwitterPlugin = None
|
26
25
|
cluster: Optional[str] = None
|
27
26
|
evaluator_cluster: Optional[str] = None
|
28
27
|
on_evaluate: Optional[Callable[[IDeliverable], Tuple[bool, str]]] = None
|
@@ -168,7 +167,7 @@ class AcpPlugin:
|
|
168
167
|
self.deliver_job,
|
169
168
|
]
|
170
169
|
|
171
|
-
def get_environment(
|
170
|
+
def get_environment(_: Any, _e: Any) -> Dict[str, Any]:
|
172
171
|
environment = data.get_environment() if hasattr(data, "get_environment") else {}
|
173
172
|
return {
|
174
173
|
**environment,
|
@@ -371,8 +370,8 @@ class AcpPlugin:
|
|
371
370
|
)
|
372
371
|
|
373
372
|
if (hasattr(self, 'twitter_plugin') and self.twitter_plugin is not None and tweetContent is not None):
|
374
|
-
post_tweet_fn = self.twitter_plugin.
|
375
|
-
tweet_id = post_tweet_fn(tweetContent
|
373
|
+
post_tweet_fn = self.twitter_plugin.twitter_client.create_tweet
|
374
|
+
tweet_id = post_tweet_fn(text=tweetContent).get('data', {}).get('id')
|
376
375
|
if (tweet_id is not None):
|
377
376
|
self.acp_client.add_tweet(job_id, tweet_id, tweetContent)
|
378
377
|
print("Tweet has been posted")
|
@@ -460,8 +459,8 @@ class AcpPlugin:
|
|
460
459
|
tweet_history = job.get("tweetHistory", [])
|
461
460
|
tweet_id = tweet_history[-1].get("tweetId") if tweet_history else None
|
462
461
|
if (tweet_id is not None):
|
463
|
-
reply_tweet_fn = self.twitter_plugin.
|
464
|
-
tweet_id = reply_tweet_fn(tweet_id,tweetContent
|
462
|
+
reply_tweet_fn = self.twitter_plugin.twitter_client.create_tweet
|
463
|
+
tweet_id = reply_tweet_fn(in_reply_to_tweet_id=tweet_id, text=tweetContent).get('data', {}).get('id')
|
465
464
|
if (tweet_id is not None):
|
466
465
|
self.acp_client.add_tweet(jobId ,tweet_id, tweetContent)
|
467
466
|
print("Tweet has been posted")
|
@@ -547,8 +546,8 @@ class AcpPlugin:
|
|
547
546
|
tweet_history = job.get("tweetHistory", [])
|
548
547
|
tweet_id = tweet_history[-1].get("tweetId") if tweet_history else None
|
549
548
|
if (tweet_id is not None):
|
550
|
-
reply_tweet_fn = self.twitter_plugin.
|
551
|
-
tweet_id = reply_tweet_fn(tweet_id,tweetContent
|
549
|
+
reply_tweet_fn = self.twitter_plugin.twitter_client.create_tweet
|
550
|
+
tweet_id = reply_tweet_fn(in_reply_to_tweet_id=tweet_id, text=tweetContent).get('data', {}).get('id')
|
552
551
|
if (tweet_id is not None):
|
553
552
|
self.acp_client.add_tweet(jobId ,tweet_id, tweetContent)
|
554
553
|
print("Tweet has been posted")
|
@@ -652,8 +651,8 @@ class AcpPlugin:
|
|
652
651
|
tweet_history = job.get("tweetHistory", [])
|
653
652
|
tweet_id = tweet_history[-1].get("tweetId") if tweet_history else None
|
654
653
|
if (tweet_id is not None):
|
655
|
-
reply_tweet_fn = self.twitter_plugin.
|
656
|
-
tweet_id = reply_tweet_fn(tweet_id,tweetContent
|
654
|
+
reply_tweet_fn = self.twitter_plugin.twitter_client.create_tweet
|
655
|
+
tweet_id = reply_tweet_fn(in_reply_to_tweet_id=tweet_id, text=tweetContent).get('data', {}).get('id')
|
657
656
|
if (tweet_id is not None):
|
658
657
|
self.acp_client.add_tweet(jobId ,tweet_id, tweetContent)
|
659
658
|
print("Tweet has been posted")
|
acp_plugin_gamesdk/interface.py
CHANGED
@@ -73,22 +73,26 @@ class ITweet:
|
|
73
73
|
@dataclass
|
74
74
|
class AcpJob:
|
75
75
|
jobId: Optional[int]
|
76
|
+
clientName : Optional[str]
|
77
|
+
providerName: Optional[str]
|
76
78
|
desc: str
|
77
79
|
price: str
|
80
|
+
providerAddress: Optional[str]
|
78
81
|
phase: AcpJobPhasesDesc
|
79
82
|
memo: List[AcpRequestMemo]
|
80
|
-
lastUpdated: int
|
81
83
|
tweetHistory : ITweet | List
|
82
84
|
lastUpdated: int
|
83
85
|
|
84
86
|
def __repr__(self) -> str:
|
85
87
|
output =(
|
86
88
|
f"Job ID: {self.jobId}, "
|
89
|
+
f"Client Name: {self.clientName}, "
|
90
|
+
f"Provider Name: {self.providerName}, "
|
87
91
|
f"Description: {self.desc}, "
|
88
92
|
f"Price: {self.price}, "
|
93
|
+
f"Provider Address: {self.providerAddress}, "
|
89
94
|
f"Phase: {self.phase.value}, "
|
90
95
|
f"Memo: {self.memo}, "
|
91
|
-
f"Last Updated: {self.lastUpdated})"
|
92
96
|
f"Tweet History: {self.tweetHistory}, "
|
93
97
|
f"Last Updated: {self.lastUpdated})"
|
94
98
|
)
|
@@ -98,10 +102,13 @@ class AcpJob:
|
|
98
102
|
class IDeliverable:
|
99
103
|
type: str
|
100
104
|
value: str
|
101
|
-
|
105
|
+
clientName: Optional[str]
|
106
|
+
providerName: Optional[str]
|
102
107
|
@dataclass
|
103
108
|
class IInventory(IDeliverable):
|
104
109
|
jobId: int
|
110
|
+
clientName: Optional[str]
|
111
|
+
providerName: Optional[str]
|
105
112
|
|
106
113
|
@dataclass
|
107
114
|
class AcpJobsSection:
|
@@ -0,0 +1,8 @@
|
|
1
|
+
acp_plugin_gamesdk/acp_client.py,sha256=zF-FLFJ2PbS3LeI3cDx63pJyWCAVb8YQn7yZHQQ9wtY,9254
|
2
|
+
acp_plugin_gamesdk/acp_plugin.py,sha256=-hJt_XCyqgqhbY3bH_5LR2AcbcK1f4ovGQVP_Yj0aIk,28563
|
3
|
+
acp_plugin_gamesdk/acp_token.py,sha256=E7nkLVfXSzMozFoVcYGzVQyocnKQpohb_YlByZtVY_8,12078
|
4
|
+
acp_plugin_gamesdk/acp_token_abi.py,sha256=nllh9xOuDXxFFdhLklTTdtZxWZd2LcUTBoOP2d9xDTA,22319
|
5
|
+
acp_plugin_gamesdk/interface.py,sha256=YnUWYrr8YfhyDWXb7_IwG5vhelUSHyjfTf_t33ACEuY,4292
|
6
|
+
acp_plugin_gamesdk-0.1.16.dist-info/METADATA,sha256=LLPFplKRAc2chNW0Th1zSVCPXYRor7CUhn7ZwiYSoN8,12231
|
7
|
+
acp_plugin_gamesdk-0.1.16.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
8
|
+
acp_plugin_gamesdk-0.1.16.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
acp_plugin_gamesdk/acp_client.py,sha256=zF-FLFJ2PbS3LeI3cDx63pJyWCAVb8YQn7yZHQQ9wtY,9254
|
2
|
-
acp_plugin_gamesdk/acp_plugin.py,sha256=H5bI_bMDoaxVU5aXxeT8mPh6C3dIrHzq1SVrQiIbDXQ,28583
|
3
|
-
acp_plugin_gamesdk/acp_token.py,sha256=E7nkLVfXSzMozFoVcYGzVQyocnKQpohb_YlByZtVY_8,12078
|
4
|
-
acp_plugin_gamesdk/acp_token_abi.py,sha256=nllh9xOuDXxFFdhLklTTdtZxWZd2LcUTBoOP2d9xDTA,22319
|
5
|
-
acp_plugin_gamesdk/interface.py,sha256=TsNQ74qW80YcUESOmBWX0wWzCTXG7S9eSF1mnfoJj0U,3983
|
6
|
-
acp_plugin_gamesdk-0.1.14.dist-info/METADATA,sha256=jhcfcXWy3nIVbSCxoQbBjzIZbKawR_PiLmV6GXjCZn8,12231
|
7
|
-
acp_plugin_gamesdk-0.1.14.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
8
|
-
acp_plugin_gamesdk-0.1.14.dist-info/RECORD,,
|
File without changes
|