acp-plugin-gamesdk 0.1.6__tar.gz → 0.1.7__tar.gz
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-0.1.6 → acp_plugin_gamesdk-0.1.7}/PKG-INFO +15 -1
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/README.md +14 -0
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/acp_plugin_gamesdk/acp_client.py +6 -5
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/acp_plugin_gamesdk/acp_plugin.py +10 -3
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/pyproject.toml +1 -1
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/acp_plugin_gamesdk/acp_token.py +0 -0
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/acp_plugin_gamesdk/acp_token_abi.py +0 -0
- {acp_plugin_gamesdk-0.1.6 → acp_plugin_gamesdk-0.1.7}/acp_plugin_gamesdk/interface.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: acp-plugin-gamesdk
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.7
|
4
4
|
Summary: ACP Plugin for Python SDK for GAME by Virtuals
|
5
5
|
Author: Steven Lee Soon Fatt
|
6
6
|
Author-email: steven@virtuals.io
|
@@ -164,6 +164,20 @@ acp_plugin = AcpPlugin(
|
|
164
164
|
|
165
165
|
5. (Optional) If you want to listen to the `ON_EVALUATE` event, you can implement the `on_evaluate` function.
|
166
166
|
|
167
|
+
|
168
|
+
Evaluation refers to the process where buyer agent reviews the result submitted by the seller and decides whether to accept or reject it.
|
169
|
+
This is where the `on_evaluate` function comes into play. It allows your agent to programmatically verify deliverables and enforce quality checks.
|
170
|
+
|
171
|
+
🔍 **Example implementations can be found in:**
|
172
|
+
|
173
|
+
Use Cases:
|
174
|
+
- Basic always-accept evaluation
|
175
|
+
- URL and file validation examples
|
176
|
+
|
177
|
+
Source Files:
|
178
|
+
- [examples/agentic/README.md](examples/agentic/README.md)
|
179
|
+
- [examples/reactive/README.md](examples/reactive/README.md)
|
180
|
+
|
167
181
|
```python
|
168
182
|
def on_evaluate(deliverable: IDeliverable) -> Tuple[bool, str]:
|
169
183
|
print(f"Evaluating deliverable: {deliverable}")
|
@@ -138,6 +138,20 @@ acp_plugin = AcpPlugin(
|
|
138
138
|
|
139
139
|
5. (Optional) If you want to listen to the `ON_EVALUATE` event, you can implement the `on_evaluate` function.
|
140
140
|
|
141
|
+
|
142
|
+
Evaluation refers to the process where buyer agent reviews the result submitted by the seller and decides whether to accept or reject it.
|
143
|
+
This is where the `on_evaluate` function comes into play. It allows your agent to programmatically verify deliverables and enforce quality checks.
|
144
|
+
|
145
|
+
🔍 **Example implementations can be found in:**
|
146
|
+
|
147
|
+
Use Cases:
|
148
|
+
- Basic always-accept evaluation
|
149
|
+
- URL and file validation examples
|
150
|
+
|
151
|
+
Source Files:
|
152
|
+
- [examples/agentic/README.md](examples/agentic/README.md)
|
153
|
+
- [examples/reactive/README.md](examples/reactive/README.md)
|
154
|
+
|
141
155
|
```python
|
142
156
|
def on_evaluate(deliverable: IDeliverable) -> Tuple[bool, str]:
|
143
157
|
print(f"Evaluating deliverable: {deliverable}")
|
@@ -29,14 +29,15 @@ class AcpClient:
|
|
29
29
|
|
30
30
|
def browse_agents(self, cluster: Optional[str] = None, query: Optional[str] = None) -> List[AcpAgent]:
|
31
31
|
url = f"{self.acp_base_url}/agents"
|
32
|
-
|
32
|
+
|
33
|
+
# agent must exclude itself from search result to prevent self-commission
|
34
|
+
url += f"?filters[walletAddress][$notIn]={self.agent_wallet_address}"
|
35
|
+
|
33
36
|
if query:
|
34
|
-
url += f"
|
37
|
+
url += f"&search={requests.utils.quote(query)}"
|
35
38
|
|
36
39
|
if cluster:
|
37
|
-
|
38
|
-
separator = "&" if query else "?"
|
39
|
-
url += f"{separator}filters[cluster]={requests.utils.quote(cluster)}"
|
40
|
+
url += f"&filters[cluster]={requests.utils.quote(cluster)}"
|
40
41
|
|
41
42
|
response = requests.get(url)
|
42
43
|
|
@@ -290,7 +290,14 @@ class AcpPlugin:
|
|
290
290
|
executable=self._initiate_job_executable
|
291
291
|
)
|
292
292
|
|
293
|
-
def _initiate_job_executable(self, sellerWalletAddress: str, price: str, reasoning: str, serviceRequirements: str, requireEvaluation:
|
293
|
+
def _initiate_job_executable(self, sellerWalletAddress: str, price: str, reasoning: str, serviceRequirements: str, requireEvaluation: str, evaluatorKeyword: str, tweetContent: Optional[str] = None) -> Tuple[FunctionResultStatus, str, dict]:
|
294
|
+
if isinstance(requireEvaluation, str):
|
295
|
+
require_evaluation = requireEvaluation.lower() == 'true'
|
296
|
+
elif isinstance(requireEvaluation, bool):
|
297
|
+
require_evaluation = requireEvaluation
|
298
|
+
else:
|
299
|
+
require_evaluation = False
|
300
|
+
|
294
301
|
if not price:
|
295
302
|
return FunctionResultStatus.FAILED, "Missing price - specify how much you're offering per unit", {}
|
296
303
|
|
@@ -306,12 +313,12 @@ class AcpPlugin:
|
|
306
313
|
if not sellerWalletAddress:
|
307
314
|
return FunctionResultStatus.FAILED, "Missing seller wallet address - specify the agent you want to buy from", {}
|
308
315
|
|
309
|
-
if
|
316
|
+
if require_evaluation and not evaluatorKeyword:
|
310
317
|
return FunctionResultStatus.FAILED, "Missing validator keyword - provide a keyword to search for a validator", {}
|
311
318
|
|
312
319
|
evaluatorAddress = self.acp_token_client.get_agent_wallet_address()
|
313
320
|
|
314
|
-
if
|
321
|
+
if require_evaluation:
|
315
322
|
validators = self.acp_client.browse_agents(self.evaluator_cluster, evaluatorKeyword)
|
316
323
|
|
317
324
|
if len(validators) == 0:
|
File without changes
|
File without changes
|
File without changes
|