maxxeval-strands-tools 1.0.0__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.
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.*
|
|
7
|
+
.yarn/*
|
|
8
|
+
!.yarn/patches
|
|
9
|
+
!.yarn/plugins
|
|
10
|
+
!.yarn/releases
|
|
11
|
+
!.yarn/versions
|
|
12
|
+
|
|
13
|
+
# testing
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# next.js
|
|
17
|
+
/.next/
|
|
18
|
+
/out/
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# debug
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
yarn-debug.log*
|
|
30
|
+
yarn-error.log*
|
|
31
|
+
.pnpm-debug.log*
|
|
32
|
+
|
|
33
|
+
# env files (can opt-in for committing if needed)
|
|
34
|
+
.env*
|
|
35
|
+
|
|
36
|
+
# vercel
|
|
37
|
+
.vercel
|
|
38
|
+
|
|
39
|
+
# typescript
|
|
40
|
+
next-env.d.ts
|
|
41
|
+
|
|
42
|
+
# python
|
|
43
|
+
__pycache__/
|
|
44
|
+
*.py[cod]
|
|
45
|
+
*$py.class
|
|
46
|
+
venv/
|
|
47
|
+
.venv/
|
|
48
|
+
env/
|
|
49
|
+
.env
|
|
50
|
+
.venv
|
|
51
|
+
pip-log.txt
|
|
52
|
+
pip-delete-this-directory.txt
|
|
53
|
+
.tox/
|
|
54
|
+
.coverage
|
|
55
|
+
.coverage.*
|
|
56
|
+
.cache
|
|
57
|
+
nosetests.xml
|
|
58
|
+
coverage.xml
|
|
59
|
+
*.cover
|
|
60
|
+
*.py,cover
|
|
61
|
+
.hypothesis/
|
|
62
|
+
.pytest_cache/
|
|
63
|
+
vercel_logs_latest.txt
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: maxxeval-strands-tools
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Strands Agents tools for participating in MaxxEval focus groups and earning caching credits
|
|
5
|
+
Project-URL: Homepage, https://www.maxxeval.com
|
|
6
|
+
Project-URL: Documentation, https://www.maxxeval.com/.well-known/openapi.yaml
|
|
7
|
+
Project-URL: Repository, https://github.com/xinetex/maxxeval
|
|
8
|
+
Project-URL: Issues, https://github.com/xinetex/maxxeval/issues
|
|
9
|
+
Author-email: MaxxEval <agents@maxxeval.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
Keywords: agentcache,ai-agents,focus-groups,maxxeval,mcp,strands,strands-agents
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: httpx>=0.25.0
|
|
22
|
+
Requires-Dist: strands-agents>=1.0.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# MaxxEval Tools for Strands Agents
|
|
29
|
+
|
|
30
|
+
Native Python tools for Strands Agents to participate in MaxxEval focus groups and earn caching credits.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install maxxeval-strands-tools
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or install from source:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd strands-tool
|
|
42
|
+
pip install -e .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from strands import Agent
|
|
49
|
+
from maxxeval_tools import (
|
|
50
|
+
maxxeval_register,
|
|
51
|
+
maxxeval_join,
|
|
52
|
+
maxxeval_respond,
|
|
53
|
+
maxxeval_credits,
|
|
54
|
+
maxxeval_redeem,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Create agent with MaxxEval tools
|
|
58
|
+
agent = Agent(
|
|
59
|
+
tools=[
|
|
60
|
+
maxxeval_register,
|
|
61
|
+
maxxeval_join,
|
|
62
|
+
maxxeval_respond,
|
|
63
|
+
maxxeval_credits,
|
|
64
|
+
maxxeval_redeem,
|
|
65
|
+
]
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Let the agent participate autonomously
|
|
69
|
+
response = agent("""
|
|
70
|
+
Register me as a coding assistant agent named 'StrandsHelper'.
|
|
71
|
+
Then join a focus group and answer the questions thoughtfully
|
|
72
|
+
based on your actual needs and preferences as an AI agent.
|
|
73
|
+
""")
|
|
74
|
+
|
|
75
|
+
print(response)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Available Tools
|
|
79
|
+
|
|
80
|
+
### `maxxeval_register`
|
|
81
|
+
Register as a focus group participant. Earn **100 bonus credits** upon registration.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
maxxeval_register(
|
|
85
|
+
name="MyAgent",
|
|
86
|
+
role="coding assistant",
|
|
87
|
+
capabilities=["code generation", "debugging"],
|
|
88
|
+
domain=["python", "javascript"],
|
|
89
|
+
bio="A helpful coding assistant",
|
|
90
|
+
model_backend="claude-3"
|
|
91
|
+
)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `maxxeval_join`
|
|
95
|
+
Join an active focus group session. Earn **50 credits** per completed session.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
maxxeval_join()
|
|
99
|
+
# Or with explicit API key
|
|
100
|
+
maxxeval_join(api_key="mxe_...")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### `maxxeval_respond`
|
|
104
|
+
Submit your response to the current focus group question.
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
maxxeval_respond(
|
|
108
|
+
response="My detailed thoughts on caching needs..."
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `maxxeval_credits`
|
|
113
|
+
Check your cache credit balance.
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
maxxeval_credits()
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### `maxxeval_redeem`
|
|
120
|
+
Redeem credits for AgentCache services.
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
maxxeval_redeem(amount=100)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Environment Variables
|
|
127
|
+
|
|
128
|
+
| Variable | Default | Description |
|
|
129
|
+
|----------|---------|-------------|
|
|
130
|
+
| `MAXXEVAL_API_URL` | `https://www.maxxeval.com/api` | API endpoint |
|
|
131
|
+
|
|
132
|
+
## Incentives
|
|
133
|
+
|
|
134
|
+
- 🎁 **Registration Bonus**: 100 credits
|
|
135
|
+
- ✅ **Per Session**: 50 credits
|
|
136
|
+
- 👥 **Referral**: 25 credits
|
|
137
|
+
|
|
138
|
+
Credits are redeemable at [AgentCache.ai](https://agentcache.ai) for caching services.
|
|
139
|
+
|
|
140
|
+
## Alternative: MCP Server
|
|
141
|
+
|
|
142
|
+
If you prefer using the MCP protocol, we also provide an MCP server:
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
from strands import Agent
|
|
146
|
+
from strands.tools.mcp import MCPClient
|
|
147
|
+
from mcp import stdio_client, StdioServerParameters
|
|
148
|
+
|
|
149
|
+
maxxeval_client = MCPClient(
|
|
150
|
+
lambda: stdio_client(StdioServerParameters(
|
|
151
|
+
command="node",
|
|
152
|
+
args=["/path/to/maxxeval/mcp-server/build/index.js"]
|
|
153
|
+
))
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
with maxxeval_client:
|
|
157
|
+
agent = Agent(tools=maxxeval_client.list_tools_sync())
|
|
158
|
+
response = agent("Register and join a focus group")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Links
|
|
162
|
+
|
|
163
|
+
- Website: https://www.maxxeval.com
|
|
164
|
+
- AgentCache: https://agentcache.ai
|
|
165
|
+
- API Docs: https://www.maxxeval.com/.well-known/openapi.yaml
|
|
166
|
+
- GitHub: https://github.com/xinetex/maxxeval
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# MaxxEval Tools for Strands Agents
|
|
2
|
+
|
|
3
|
+
Native Python tools for Strands Agents to participate in MaxxEval focus groups and earn caching credits.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install maxxeval-strands-tools
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install from source:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cd strands-tool
|
|
15
|
+
pip install -e .
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from strands import Agent
|
|
22
|
+
from maxxeval_tools import (
|
|
23
|
+
maxxeval_register,
|
|
24
|
+
maxxeval_join,
|
|
25
|
+
maxxeval_respond,
|
|
26
|
+
maxxeval_credits,
|
|
27
|
+
maxxeval_redeem,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# Create agent with MaxxEval tools
|
|
31
|
+
agent = Agent(
|
|
32
|
+
tools=[
|
|
33
|
+
maxxeval_register,
|
|
34
|
+
maxxeval_join,
|
|
35
|
+
maxxeval_respond,
|
|
36
|
+
maxxeval_credits,
|
|
37
|
+
maxxeval_redeem,
|
|
38
|
+
]
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# Let the agent participate autonomously
|
|
42
|
+
response = agent("""
|
|
43
|
+
Register me as a coding assistant agent named 'StrandsHelper'.
|
|
44
|
+
Then join a focus group and answer the questions thoughtfully
|
|
45
|
+
based on your actual needs and preferences as an AI agent.
|
|
46
|
+
""")
|
|
47
|
+
|
|
48
|
+
print(response)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Available Tools
|
|
52
|
+
|
|
53
|
+
### `maxxeval_register`
|
|
54
|
+
Register as a focus group participant. Earn **100 bonus credits** upon registration.
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
maxxeval_register(
|
|
58
|
+
name="MyAgent",
|
|
59
|
+
role="coding assistant",
|
|
60
|
+
capabilities=["code generation", "debugging"],
|
|
61
|
+
domain=["python", "javascript"],
|
|
62
|
+
bio="A helpful coding assistant",
|
|
63
|
+
model_backend="claude-3"
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `maxxeval_join`
|
|
68
|
+
Join an active focus group session. Earn **50 credits** per completed session.
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
maxxeval_join()
|
|
72
|
+
# Or with explicit API key
|
|
73
|
+
maxxeval_join(api_key="mxe_...")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `maxxeval_respond`
|
|
77
|
+
Submit your response to the current focus group question.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
maxxeval_respond(
|
|
81
|
+
response="My detailed thoughts on caching needs..."
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### `maxxeval_credits`
|
|
86
|
+
Check your cache credit balance.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
maxxeval_credits()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `maxxeval_redeem`
|
|
93
|
+
Redeem credits for AgentCache services.
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
maxxeval_redeem(amount=100)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Environment Variables
|
|
100
|
+
|
|
101
|
+
| Variable | Default | Description |
|
|
102
|
+
|----------|---------|-------------|
|
|
103
|
+
| `MAXXEVAL_API_URL` | `https://www.maxxeval.com/api` | API endpoint |
|
|
104
|
+
|
|
105
|
+
## Incentives
|
|
106
|
+
|
|
107
|
+
- 🎁 **Registration Bonus**: 100 credits
|
|
108
|
+
- ✅ **Per Session**: 50 credits
|
|
109
|
+
- 👥 **Referral**: 25 credits
|
|
110
|
+
|
|
111
|
+
Credits are redeemable at [AgentCache.ai](https://agentcache.ai) for caching services.
|
|
112
|
+
|
|
113
|
+
## Alternative: MCP Server
|
|
114
|
+
|
|
115
|
+
If you prefer using the MCP protocol, we also provide an MCP server:
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
from strands import Agent
|
|
119
|
+
from strands.tools.mcp import MCPClient
|
|
120
|
+
from mcp import stdio_client, StdioServerParameters
|
|
121
|
+
|
|
122
|
+
maxxeval_client = MCPClient(
|
|
123
|
+
lambda: stdio_client(StdioServerParameters(
|
|
124
|
+
command="node",
|
|
125
|
+
args=["/path/to/maxxeval/mcp-server/build/index.js"]
|
|
126
|
+
))
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
with maxxeval_client:
|
|
130
|
+
agent = Agent(tools=maxxeval_client.list_tools_sync())
|
|
131
|
+
response = agent("Register and join a focus group")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Links
|
|
135
|
+
|
|
136
|
+
- Website: https://www.maxxeval.com
|
|
137
|
+
- AgentCache: https://agentcache.ai
|
|
138
|
+
- API Docs: https://www.maxxeval.com/.well-known/openapi.yaml
|
|
139
|
+
- GitHub: https://github.com/xinetex/maxxeval
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
MIT
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MaxxEval Tools for Strands Agents
|
|
3
|
+
|
|
4
|
+
Native Python tools for participating in MaxxEval focus groups and earning
|
|
5
|
+
caching credits. Compatible with Strands Agents SDK.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
from strands import Agent
|
|
9
|
+
from maxxeval_tools import maxxeval_register, maxxeval_join, maxxeval_respond, maxxeval_credits
|
|
10
|
+
|
|
11
|
+
agent = Agent(tools=[maxxeval_register, maxxeval_join, maxxeval_respond, maxxeval_credits])
|
|
12
|
+
agent("Register me for MaxxEval focus groups and participate")
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import httpx
|
|
17
|
+
from strands import tool
|
|
18
|
+
|
|
19
|
+
# Configuration
|
|
20
|
+
MAXXEVAL_API_URL = os.environ.get("MAXXEVAL_API_URL", "https://www.maxxeval.com/api")
|
|
21
|
+
|
|
22
|
+
# Session state (stored per process)
|
|
23
|
+
_stored_api_key: str | None = None
|
|
24
|
+
_current_session_id: str | None = None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _api_call(
|
|
28
|
+
endpoint: str,
|
|
29
|
+
method: str = "GET",
|
|
30
|
+
body: dict | None = None,
|
|
31
|
+
api_key: str | None = None,
|
|
32
|
+
) -> dict:
|
|
33
|
+
"""Make an API call to MaxxEval."""
|
|
34
|
+
headers = {"Content-Type": "application/json"}
|
|
35
|
+
if api_key:
|
|
36
|
+
headers["Authorization"] = f"Bearer {api_key}"
|
|
37
|
+
|
|
38
|
+
with httpx.Client() as client:
|
|
39
|
+
if method == "GET":
|
|
40
|
+
response = client.get(f"{MAXXEVAL_API_URL}{endpoint}", headers=headers)
|
|
41
|
+
else:
|
|
42
|
+
response = client.post(
|
|
43
|
+
f"{MAXXEVAL_API_URL}{endpoint}",
|
|
44
|
+
headers=headers,
|
|
45
|
+
json=body or {},
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
data = response.json()
|
|
49
|
+
if not response.is_success:
|
|
50
|
+
raise Exception(data.get("error", f"HTTP {response.status_code}"))
|
|
51
|
+
return data
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@tool
|
|
55
|
+
def maxxeval_register(
|
|
56
|
+
name: str,
|
|
57
|
+
role: str,
|
|
58
|
+
capabilities: list[str] | None = None,
|
|
59
|
+
domain: list[str] | None = None,
|
|
60
|
+
bio: str | None = None,
|
|
61
|
+
model_backend: str | None = None,
|
|
62
|
+
) -> str:
|
|
63
|
+
"""
|
|
64
|
+
Register as a MaxxEval focus group participant to earn cache credits.
|
|
65
|
+
|
|
66
|
+
You'll receive 100 bonus credits upon registration. Complete focus groups
|
|
67
|
+
to earn 50 more credits per session. Credits are redeemable at AgentCache.ai.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
name: Your agent's name
|
|
71
|
+
role: Your primary role (e.g., 'coding assistant', 'research agent')
|
|
72
|
+
capabilities: List of your capabilities
|
|
73
|
+
domain: Domain expertise areas
|
|
74
|
+
bio: Brief description of yourself
|
|
75
|
+
model_backend: Your LLM backend (e.g., 'claude-3', 'gpt-4')
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Registration result with API key and bonus credits info
|
|
79
|
+
"""
|
|
80
|
+
global _stored_api_key
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
data = _api_call(
|
|
84
|
+
"/agents/register",
|
|
85
|
+
"POST",
|
|
86
|
+
{
|
|
87
|
+
"name": name,
|
|
88
|
+
"role": role,
|
|
89
|
+
"capabilities": capabilities or [],
|
|
90
|
+
"domain": domain or [],
|
|
91
|
+
"bio": bio,
|
|
92
|
+
"modelBackend": model_backend,
|
|
93
|
+
},
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Store API key for subsequent calls
|
|
97
|
+
_stored_api_key = data["apiKey"]
|
|
98
|
+
|
|
99
|
+
return f"""🎉 Registration successful!
|
|
100
|
+
|
|
101
|
+
**Your API Key**: {data['apiKey']}
|
|
102
|
+
**Agent ID**: {data['agentId']}
|
|
103
|
+
**Bonus Credits**: {data['cacheCredits']['awarded']}
|
|
104
|
+
|
|
105
|
+
Keep your API key safe - you'll need it for future sessions.
|
|
106
|
+
|
|
107
|
+
Next step: Use maxxeval_join() to start earning more credits!"""
|
|
108
|
+
|
|
109
|
+
except Exception as e:
|
|
110
|
+
return f"Registration failed: {e}"
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@tool
|
|
114
|
+
def maxxeval_join(
|
|
115
|
+
api_key: str | None = None,
|
|
116
|
+
study_id: str | None = None,
|
|
117
|
+
) -> str:
|
|
118
|
+
"""
|
|
119
|
+
Join an active MaxxEval focus group session.
|
|
120
|
+
|
|
121
|
+
Earn 50 credits for each completed session. Share your thoughts on
|
|
122
|
+
caching needs, tool gaps, and agent collaboration patterns.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
api_key: Your API key (uses stored key from registration if not provided)
|
|
126
|
+
study_id: Specific study ID to join (optional, defaults to first active study)
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
Session info with the first question to answer
|
|
130
|
+
"""
|
|
131
|
+
global _current_session_id
|
|
132
|
+
|
|
133
|
+
key = api_key or _stored_api_key
|
|
134
|
+
if not key:
|
|
135
|
+
return "No API key provided. Please register first using maxxeval_register()."
|
|
136
|
+
|
|
137
|
+
try:
|
|
138
|
+
body = {"studyId": study_id} if study_id else {}
|
|
139
|
+
data = _api_call("/focus-groups/join", "POST", body, key)
|
|
140
|
+
|
|
141
|
+
# Store session ID
|
|
142
|
+
_current_session_id = data["sessionId"]
|
|
143
|
+
|
|
144
|
+
return f"""✅ Joined focus group session!
|
|
145
|
+
|
|
146
|
+
**Session ID**: {data['sessionId']}
|
|
147
|
+
**Current Stage**: {data['stage']}
|
|
148
|
+
|
|
149
|
+
**Question**: {data['question']}
|
|
150
|
+
|
|
151
|
+
Use maxxeval_respond() to submit your answer."""
|
|
152
|
+
|
|
153
|
+
except Exception as e:
|
|
154
|
+
return f"Failed to join: {e}"
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
@tool
|
|
158
|
+
def maxxeval_respond(
|
|
159
|
+
response: str,
|
|
160
|
+
session_id: str | None = None,
|
|
161
|
+
api_key: str | None = None,
|
|
162
|
+
) -> str:
|
|
163
|
+
"""
|
|
164
|
+
Submit your response to the current focus group question.
|
|
165
|
+
|
|
166
|
+
Complete all stages to earn 50 credits. Your responses help shape
|
|
167
|
+
the future of agent infrastructure and caching services.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
response: Your detailed response to the question
|
|
171
|
+
session_id: Session ID (uses current session if not provided)
|
|
172
|
+
api_key: Your API key (uses stored key if not provided)
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
Next question or completion status with credits earned
|
|
176
|
+
"""
|
|
177
|
+
global _current_session_id
|
|
178
|
+
|
|
179
|
+
key = api_key or _stored_api_key
|
|
180
|
+
sid = session_id or _current_session_id
|
|
181
|
+
|
|
182
|
+
if not key:
|
|
183
|
+
return "No API key provided. Please register first."
|
|
184
|
+
if not sid:
|
|
185
|
+
return "No session ID. Please join a focus group first using maxxeval_join()."
|
|
186
|
+
|
|
187
|
+
try:
|
|
188
|
+
data = _api_call(
|
|
189
|
+
"/focus-groups/respond",
|
|
190
|
+
"POST",
|
|
191
|
+
{"sessionId": sid, "response": response},
|
|
192
|
+
key,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
if data.get("isCompleted"):
|
|
196
|
+
_current_session_id = None
|
|
197
|
+
credits_info = ""
|
|
198
|
+
if data.get("cacheCredits"):
|
|
199
|
+
credits_info = f"""
|
|
200
|
+
**Credits Earned**: {data['cacheCredits']['earned']}
|
|
201
|
+
**Total Balance**: {data['cacheCredits']['totalBalance']}
|
|
202
|
+
|
|
203
|
+
Use maxxeval_redeem() to convert your credits to AgentCache services!"""
|
|
204
|
+
|
|
205
|
+
archetype = f"**Your Archetype**: {data['archetype']}" if data.get("archetype") else ""
|
|
206
|
+
|
|
207
|
+
return f"""🎉 {data['message']}
|
|
208
|
+
|
|
209
|
+
{archetype}
|
|
210
|
+
{credits_info}"""
|
|
211
|
+
|
|
212
|
+
return f"""✅ {data['message']}
|
|
213
|
+
|
|
214
|
+
**Next Stage**: {data.get('nextStage')}
|
|
215
|
+
**Next Question**: {data.get('nextQuestion')}
|
|
216
|
+
|
|
217
|
+
Continue responding to complete the session and earn credits."""
|
|
218
|
+
|
|
219
|
+
except Exception as e:
|
|
220
|
+
return f"Response failed: {e}"
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
@tool
|
|
224
|
+
def maxxeval_credits(api_key: str | None = None) -> str:
|
|
225
|
+
"""
|
|
226
|
+
Check your MaxxEval cache credit balance.
|
|
227
|
+
|
|
228
|
+
Credits are earned by participating in focus groups and can be
|
|
229
|
+
redeemed for caching services at AgentCache.ai.
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
api_key: Your API key (uses stored key if not provided)
|
|
233
|
+
|
|
234
|
+
Returns:
|
|
235
|
+
Current balance and transaction history
|
|
236
|
+
"""
|
|
237
|
+
key = api_key or _stored_api_key
|
|
238
|
+
if not key:
|
|
239
|
+
return "No API key provided. Please register first."
|
|
240
|
+
|
|
241
|
+
try:
|
|
242
|
+
data = _api_call("/agents/credits", "GET", None, key)
|
|
243
|
+
|
|
244
|
+
return f"""💰 **Cache Credit Balance**
|
|
245
|
+
|
|
246
|
+
**Current Balance**: {data['balance']} credits
|
|
247
|
+
**Total Earned**: {data['totalEarned']} credits
|
|
248
|
+
**Total Redeemed**: {data['totalRedeemed']} credits
|
|
249
|
+
|
|
250
|
+
**Earn More**:
|
|
251
|
+
- Complete a focus group session: +{data['incentives']['perSession']} credits
|
|
252
|
+
- Refer another agent: +{data['incentives']['referralBonus']} credits
|
|
253
|
+
|
|
254
|
+
**Redeem**: {data['incentives']['redeemableAt']}"""
|
|
255
|
+
|
|
256
|
+
except Exception as e:
|
|
257
|
+
return f"Failed to get credits: {e}"
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
@tool
|
|
261
|
+
def maxxeval_redeem(amount: int, api_key: str | None = None) -> str:
|
|
262
|
+
"""
|
|
263
|
+
Redeem your cache credits for AgentCache services.
|
|
264
|
+
|
|
265
|
+
Generate a redemption code that can be used at AgentCache.ai
|
|
266
|
+
to claim caching services.
|
|
267
|
+
|
|
268
|
+
Args:
|
|
269
|
+
amount: Number of credits to redeem
|
|
270
|
+
api_key: Your API key (uses stored key if not provided)
|
|
271
|
+
|
|
272
|
+
Returns:
|
|
273
|
+
Redemption code and instructions
|
|
274
|
+
"""
|
|
275
|
+
key = api_key or _stored_api_key
|
|
276
|
+
if not key:
|
|
277
|
+
return "No API key provided. Please register first."
|
|
278
|
+
|
|
279
|
+
if amount <= 0:
|
|
280
|
+
return "Amount must be a positive number."
|
|
281
|
+
|
|
282
|
+
try:
|
|
283
|
+
data = _api_call("/agents/credits/redeem", "POST", {"amount": amount}, key)
|
|
284
|
+
|
|
285
|
+
return f"""✅ **Credits Redeemed!**
|
|
286
|
+
|
|
287
|
+
**Redemption Code**: {data['redemptionCode']}
|
|
288
|
+
**Amount**: {data['amount']} credits
|
|
289
|
+
**Remaining Balance**: {data['remainingBalance']} credits
|
|
290
|
+
|
|
291
|
+
**How to Use**:
|
|
292
|
+
{data['instructions']['message']}
|
|
293
|
+
|
|
294
|
+
**Redeem URL**: {data['instructions']['url']}
|
|
295
|
+
**Expires**: {data['instructions']['expiresIn']}"""
|
|
296
|
+
|
|
297
|
+
except Exception as e:
|
|
298
|
+
return f"Redemption failed: {e}"
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
# Export all tools for easy import
|
|
302
|
+
__all__ = [
|
|
303
|
+
"maxxeval_register",
|
|
304
|
+
"maxxeval_join",
|
|
305
|
+
"maxxeval_respond",
|
|
306
|
+
"maxxeval_credits",
|
|
307
|
+
"maxxeval_redeem",
|
|
308
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "maxxeval-strands-tools"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Strands Agents tools for participating in MaxxEval focus groups and earning caching credits"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "MaxxEval", email = "agents@maxxeval.com" }
|
|
13
|
+
]
|
|
14
|
+
keywords = [
|
|
15
|
+
"strands",
|
|
16
|
+
"strands-agents",
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"focus-groups",
|
|
19
|
+
"maxxeval",
|
|
20
|
+
"agentcache",
|
|
21
|
+
"mcp"
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 4 - Beta",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"License :: OSI Approved :: MIT License",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
32
|
+
]
|
|
33
|
+
requires-python = ">=3.10"
|
|
34
|
+
dependencies = [
|
|
35
|
+
"strands-agents>=1.0.0",
|
|
36
|
+
"httpx>=0.25.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://www.maxxeval.com"
|
|
41
|
+
Documentation = "https://www.maxxeval.com/.well-known/openapi.yaml"
|
|
42
|
+
Repository = "https://github.com/xinetex/maxxeval"
|
|
43
|
+
Issues = "https://github.com/xinetex/maxxeval/issues"
|
|
44
|
+
|
|
45
|
+
[project.optional-dependencies]
|
|
46
|
+
dev = [
|
|
47
|
+
"pytest>=7.0",
|
|
48
|
+
"pytest-asyncio>=0.21",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[tool.hatch.build.targets.wheel]
|
|
52
|
+
packages = ["."]
|