resolvax-agentkit 0.1.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.
- resolvax_agentkit-0.1.0/LICENSE +21 -0
- resolvax_agentkit-0.1.0/PKG-INFO +75 -0
- resolvax_agentkit-0.1.0/README.md +53 -0
- resolvax_agentkit-0.1.0/pyproject.toml +34 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit/__init__.py +24 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit/action_provider.py +178 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit/schemas.py +40 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit.egg-info/PKG-INFO +75 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit.egg-info/SOURCES.txt +11 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit.egg-info/dependency_links.txt +1 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit.egg-info/requires.txt +5 -0
- resolvax_agentkit-0.1.0/resolvax_agentkit.egg-info/top_level.txt +1 -0
- resolvax_agentkit-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ResolvaX Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: resolvax-agentkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Coinbase AgentKit Action Provider for ResolvaX Mathematical & Educational Engines (x402 Base USDC).
|
|
5
|
+
Author-email: ResolvaX Team <contato@resolvax.com.br>
|
|
6
|
+
Project-URL: Homepage, https://resolvax.com.br
|
|
7
|
+
Project-URL: Documentation, https://resolvax.com.br/docs
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/swellington231/resolvax/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: pydantic>=2.0.0
|
|
18
|
+
Requires-Dist: httpx>=0.25.0
|
|
19
|
+
Provides-Extra: cdp
|
|
20
|
+
Requires-Dist: cdp-agentkit-core>=0.0.8; extra == "cdp"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# ResolvaX AgentKit Action Provider (Coinbase Base L2)
|
|
24
|
+
|
|
25
|
+
Official **Coinbase AgentKit Action Provider** for **ResolvaX**, enabling autonomous AI agents on the Base Layer 2 blockchain to seamlessly query mathematical, algebraic, LaTeX, financial, and OCR engines monetized with canonical **HTTP 402 Payment Required (x402)** in **USDC**.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🚀 Features
|
|
30
|
+
|
|
31
|
+
* **Symbolic Math Solver:** Quadratic, polynomial, derivative, and linear system solving with step-by-step LaTeX output ($0.001 USDC).
|
|
32
|
+
* **LaTeX Converter:** Natural language and raw mathematical text converted to publication-ready TeX ($0.001 USDC).
|
|
33
|
+
* **Financial Math Engine:** Compound interest, inflation, Price amortization, and loan PMT schedules ($0.001 USDC).
|
|
34
|
+
* **Exercise Generator:** Brazilian National Curriculum (BNCC) & high-school level math problem synthesis ($0.005 USDC).
|
|
35
|
+
* **Math Evaluator:** Algebraic equivalence verification and diagnostic feedback ($0.005 USDC).
|
|
36
|
+
* **Math OCR:** Image to LaTeX formula recognition with Otsu preprocessing ($0.010 USDC).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install resolvax-agentkit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ⚡ Quickstart with Coinbase AgentKit
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from coinbase_agentkit import AgentKit, AgentKitConfig, CdpWalletProvider
|
|
52
|
+
from resolvax_agentkit import ResolvaXActionProvider
|
|
53
|
+
|
|
54
|
+
# 1. Initialize your Base wallet provider
|
|
55
|
+
wallet_provider = CdpWalletProvider()
|
|
56
|
+
|
|
57
|
+
# 2. Add ResolvaX Action Provider to your AgentKit
|
|
58
|
+
agent_kit = AgentKit(
|
|
59
|
+
AgentKitConfig(
|
|
60
|
+
wallet_provider=wallet_provider,
|
|
61
|
+
action_providers=[
|
|
62
|
+
ResolvaXActionProvider()
|
|
63
|
+
]
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 🛡️ Protocol Specifications
|
|
71
|
+
|
|
72
|
+
* **Network:** Base Layer 2 (Mainnet)
|
|
73
|
+
* **Token:** USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)
|
|
74
|
+
* **Recipient Wallet:** `0x93dd815bc8d9a6e299d936986c5ee7dc3f267fee`
|
|
75
|
+
* **Protocol:** x402 Canonical (`X-402-Payment-Required`)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ResolvaX AgentKit Action Provider (Coinbase Base L2)
|
|
2
|
+
|
|
3
|
+
Official **Coinbase AgentKit Action Provider** for **ResolvaX**, enabling autonomous AI agents on the Base Layer 2 blockchain to seamlessly query mathematical, algebraic, LaTeX, financial, and OCR engines monetized with canonical **HTTP 402 Payment Required (x402)** in **USDC**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🚀 Features
|
|
8
|
+
|
|
9
|
+
* **Symbolic Math Solver:** Quadratic, polynomial, derivative, and linear system solving with step-by-step LaTeX output ($0.001 USDC).
|
|
10
|
+
* **LaTeX Converter:** Natural language and raw mathematical text converted to publication-ready TeX ($0.001 USDC).
|
|
11
|
+
* **Financial Math Engine:** Compound interest, inflation, Price amortization, and loan PMT schedules ($0.001 USDC).
|
|
12
|
+
* **Exercise Generator:** Brazilian National Curriculum (BNCC) & high-school level math problem synthesis ($0.005 USDC).
|
|
13
|
+
* **Math Evaluator:** Algebraic equivalence verification and diagnostic feedback ($0.005 USDC).
|
|
14
|
+
* **Math OCR:** Image to LaTeX formula recognition with Otsu preprocessing ($0.010 USDC).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📦 Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install resolvax-agentkit
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ⚡ Quickstart with Coinbase AgentKit
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from coinbase_agentkit import AgentKit, AgentKitConfig, CdpWalletProvider
|
|
30
|
+
from resolvax_agentkit import ResolvaXActionProvider
|
|
31
|
+
|
|
32
|
+
# 1. Initialize your Base wallet provider
|
|
33
|
+
wallet_provider = CdpWalletProvider()
|
|
34
|
+
|
|
35
|
+
# 2. Add ResolvaX Action Provider to your AgentKit
|
|
36
|
+
agent_kit = AgentKit(
|
|
37
|
+
AgentKitConfig(
|
|
38
|
+
wallet_provider=wallet_provider,
|
|
39
|
+
action_providers=[
|
|
40
|
+
ResolvaXActionProvider()
|
|
41
|
+
]
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🛡️ Protocol Specifications
|
|
49
|
+
|
|
50
|
+
* **Network:** Base Layer 2 (Mainnet)
|
|
51
|
+
* **Token:** USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)
|
|
52
|
+
* **Recipient Wallet:** `0x93dd815bc8d9a6e299d936986c5ee7dc3f267fee`
|
|
53
|
+
* **Protocol:** x402 Canonical (`X-402-Payment-Required`)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "resolvax-agentkit"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="ResolvaX Team", email="contato@resolvax.com.br" },
|
|
10
|
+
]
|
|
11
|
+
description = "Official Coinbase AgentKit Action Provider for ResolvaX Mathematical & Educational Engines (x402 Base USDC)."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Mathematics",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"pydantic>=2.0.0",
|
|
23
|
+
"httpx>=0.25.0",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
cdp = [
|
|
28
|
+
"cdp-agentkit-core>=0.0.8",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
"Homepage" = "https://resolvax.com.br"
|
|
33
|
+
"Documentation" = "https://resolvax.com.br/docs"
|
|
34
|
+
"Bug Tracker" = "https://github.com/swellington231/resolvax/issues"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""
|
|
2
|
+
resolvax_agentkit
|
|
3
|
+
Official Coinbase AgentKit Action Provider for ResolvaX (Base Layer 2 x402).
|
|
4
|
+
"""
|
|
5
|
+
from .action_provider import ResolvaXActionProvider
|
|
6
|
+
from .schemas import (
|
|
7
|
+
MathSolveSchema,
|
|
8
|
+
LatexConverterSchema,
|
|
9
|
+
FinancialMathSchema,
|
|
10
|
+
ExerciseGeneratorSchema,
|
|
11
|
+
MathEvaluatorSchema,
|
|
12
|
+
MathOcrSchema,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
__version__ = "0.1.0"
|
|
16
|
+
__all__ = [
|
|
17
|
+
"ResolvaXActionProvider",
|
|
18
|
+
"MathSolveSchema",
|
|
19
|
+
"LatexConverterSchema",
|
|
20
|
+
"FinancialMathSchema",
|
|
21
|
+
"ExerciseGeneratorSchema",
|
|
22
|
+
"MathEvaluatorSchema",
|
|
23
|
+
"MathOcrSchema",
|
|
24
|
+
]
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"""
|
|
2
|
+
resolvax_agentkit/action_provider.py
|
|
3
|
+
Coinbase AgentKit Action Provider for ResolvaX 6 M2M APIs.
|
|
4
|
+
"""
|
|
5
|
+
import os
|
|
6
|
+
import json
|
|
7
|
+
from typing import Any, Dict, Optional
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from .schemas import (
|
|
11
|
+
MathSolveSchema,
|
|
12
|
+
LatexConverterSchema,
|
|
13
|
+
FinancialMathSchema,
|
|
14
|
+
ExerciseGeneratorSchema,
|
|
15
|
+
MathEvaluatorSchema,
|
|
16
|
+
MathOcrSchema,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
RESOLVAX_API_URL = os.getenv("RESOLVAX_API_URL", "https://resolvax.com.br/api/v1/agent")
|
|
20
|
+
RESOLVAX_OFFICIAL_WALLET = "0x93dd815bc8d9a6e299d936986c5ee7dc3f267fee"
|
|
21
|
+
BASE_USDC_CONTRACT = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
|
22
|
+
|
|
23
|
+
# Tentativa graciosa de importar decorators nativos do CDP AgentKit
|
|
24
|
+
try:
|
|
25
|
+
from cdp_agentkit_core.actions import ActionProvider, create_action
|
|
26
|
+
from cdp_agentkit_core.wallet_providers import EvmWalletProvider
|
|
27
|
+
HAS_CDP = True
|
|
28
|
+
except ImportError:
|
|
29
|
+
HAS_CDP = False
|
|
30
|
+
# Fallback dummy decorator para permitir uso sem o pacote CDP instalado
|
|
31
|
+
def create_action(**kwargs):
|
|
32
|
+
def decorator(func):
|
|
33
|
+
func._action_meta = kwargs
|
|
34
|
+
return func
|
|
35
|
+
return decorator
|
|
36
|
+
class ActionProvider:
|
|
37
|
+
def __init__(self, name: str, actions: list):
|
|
38
|
+
self.name = name
|
|
39
|
+
self.actions = actions
|
|
40
|
+
class EvmWalletProvider:
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class ResolvaXActionProvider(ActionProvider):
|
|
45
|
+
"""
|
|
46
|
+
Action Provider do ResolvaX para agentes de IA do ecossistema Coinbase AgentKit / Base L2.
|
|
47
|
+
Automatiza pagamentos x402 em USDC na Base e executa chamadas matemáticas de alta precisão.
|
|
48
|
+
"""
|
|
49
|
+
def __init__(self, recipient_wallet: str = RESOLVAX_OFFICIAL_WALLET, base_url: str = RESOLVAX_API_URL):
|
|
50
|
+
super().__init__("resolvax-math-engine", [])
|
|
51
|
+
self.recipient_wallet = recipient_wallet.lower()
|
|
52
|
+
self.base_url = base_url.rstrip("/")
|
|
53
|
+
|
|
54
|
+
def _execute_with_payment(
|
|
55
|
+
self,
|
|
56
|
+
wallet: Any,
|
|
57
|
+
endpoint_path: str,
|
|
58
|
+
price_usdc: str,
|
|
59
|
+
payload: Dict[str, Any]
|
|
60
|
+
) -> str:
|
|
61
|
+
"""
|
|
62
|
+
Transfere o valor estipulado em USDC na Base usando a carteira do agente
|
|
63
|
+
e envia a requisição HTTP com o hash da transação.
|
|
64
|
+
"""
|
|
65
|
+
tx_hash = None
|
|
66
|
+
# 1. Se o wallet fornecer o método transfer nativo do CDP
|
|
67
|
+
if hasattr(wallet, "transfer"):
|
|
68
|
+
try:
|
|
69
|
+
tx_hash = wallet.transfer(
|
|
70
|
+
to_address=self.recipient_wallet,
|
|
71
|
+
amount=price_usdc,
|
|
72
|
+
asset_id=BASE_USDC_CONTRACT
|
|
73
|
+
)
|
|
74
|
+
except Exception as e:
|
|
75
|
+
return f"Falha ao transferir {price_usdc} USDC na rede Base: {e}"
|
|
76
|
+
elif hasattr(wallet, "send_transaction"):
|
|
77
|
+
# Exemplo de provider Web3 genérico
|
|
78
|
+
try:
|
|
79
|
+
tx_hash = wallet.send_transaction(to=self.recipient_wallet, value=0)
|
|
80
|
+
except Exception as e:
|
|
81
|
+
return f"Falha ao assinar transação Web3: {e}"
|
|
82
|
+
|
|
83
|
+
headers = {"Content-Type": "application/json"}
|
|
84
|
+
if tx_hash:
|
|
85
|
+
headers["x-402-payment-hash"] = str(tx_hash)
|
|
86
|
+
|
|
87
|
+
url = f"{self.base_url}{endpoint_path}"
|
|
88
|
+
try:
|
|
89
|
+
with httpx.Client(timeout=20.0) as client:
|
|
90
|
+
res = client.post(url, json=payload, headers=headers)
|
|
91
|
+
if res.status_code == 200:
|
|
92
|
+
return json.dumps(res.json(), ensure_ascii=False)
|
|
93
|
+
elif res.status_code == 402:
|
|
94
|
+
return f"HTTP 402 Payment Required: {res.text}. Verifique se a carteira possui saldo de USDC na Base."
|
|
95
|
+
elif res.status_code == 503:
|
|
96
|
+
return "HTTP 503: API Comercial temporariamente desativada pela governança do ResolvaX."
|
|
97
|
+
else:
|
|
98
|
+
return f"Erro HTTP {res.status_code}: {res.text}"
|
|
99
|
+
except Exception as net_err:
|
|
100
|
+
return f"Erro de conexão com ResolvaX ({url}): {net_err}"
|
|
101
|
+
|
|
102
|
+
@create_action(
|
|
103
|
+
name="resolvax_math_solve",
|
|
104
|
+
description="Resolve equações algébricas, polinomiais, derivadas e integrais via ResolvaX SymPy Engine. Custo: 0.001 USDC na Base.",
|
|
105
|
+
schema=MathSolveSchema,
|
|
106
|
+
)
|
|
107
|
+
def solve_math(self, wallet: Any, args: Dict[str, Any]) -> str:
|
|
108
|
+
return self._execute_with_payment(
|
|
109
|
+
wallet=wallet,
|
|
110
|
+
endpoint_path="/math/solve",
|
|
111
|
+
price_usdc="0.001",
|
|
112
|
+
payload=args
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
@create_action(
|
|
116
|
+
name="resolvax_latex_converter",
|
|
117
|
+
description="Converte expressões e fórmulas em texto para sintaxe LaTeX canônica e validada. Custo: 0.001 USDC na Base.",
|
|
118
|
+
schema=LatexConverterSchema,
|
|
119
|
+
)
|
|
120
|
+
def convert_latex(self, wallet: Any, args: Dict[str, Any]) -> str:
|
|
121
|
+
return self._execute_with_payment(
|
|
122
|
+
wallet=wallet,
|
|
123
|
+
endpoint_path="/math/latex",
|
|
124
|
+
price_usdc="0.001",
|
|
125
|
+
payload=args
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
@create_action(
|
|
129
|
+
name="resolvax_financial_math",
|
|
130
|
+
description="Executa cálculos de matemática financeira: Tabela Price, SAC, Juros Compostos e VPL. Custo: 0.001 USDC na Base.",
|
|
131
|
+
schema=FinancialMathSchema,
|
|
132
|
+
)
|
|
133
|
+
def calculate_finance(self, wallet: Any, args: Dict[str, Any]) -> str:
|
|
134
|
+
return self._execute_with_payment(
|
|
135
|
+
wallet=wallet,
|
|
136
|
+
endpoint_path="/finance/calculate",
|
|
137
|
+
price_usdc="0.001",
|
|
138
|
+
payload=args
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
@create_action(
|
|
142
|
+
name="resolvax_exercise_generator",
|
|
143
|
+
description="Gera exercícios didáticos de matemática alinhados à BNCC com enunciado e gabarito. Custo: 0.005 USDC na Base.",
|
|
144
|
+
schema=ExerciseGeneratorSchema,
|
|
145
|
+
)
|
|
146
|
+
def generate_exercise(self, wallet: Any, args: Dict[str, Any]) -> str:
|
|
147
|
+
return self._execute_with_payment(
|
|
148
|
+
wallet=wallet,
|
|
149
|
+
endpoint_path="/math/generate",
|
|
150
|
+
price_usdc="0.005",
|
|
151
|
+
payload=args
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
@create_action(
|
|
155
|
+
name="resolvax_math_evaluator",
|
|
156
|
+
description="Avalia equivalência algébrica e identifica erros de sinal ou coeficientes entre respostas. Custo: 0.005 USDC na Base.",
|
|
157
|
+
schema=MathEvaluatorSchema,
|
|
158
|
+
)
|
|
159
|
+
def evaluate_math(self, wallet: Any, args: Dict[str, Any]) -> str:
|
|
160
|
+
return self._execute_with_payment(
|
|
161
|
+
wallet=wallet,
|
|
162
|
+
endpoint_path="/math/evaluate",
|
|
163
|
+
price_usdc="0.005",
|
|
164
|
+
payload=args
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
@create_action(
|
|
168
|
+
name="resolvax_math_ocr",
|
|
169
|
+
description="Extrai e transcreve fórmulas matemáticas de imagens Base64 em sintaxe LaTeX. Custo: 0.010 USDC na Base.",
|
|
170
|
+
schema=MathOcrSchema,
|
|
171
|
+
)
|
|
172
|
+
def ocr_math(self, wallet: Any, args: Dict[str, Any]) -> str:
|
|
173
|
+
return self._execute_with_payment(
|
|
174
|
+
wallet=wallet,
|
|
175
|
+
endpoint_path="/math/ocr",
|
|
176
|
+
price_usdc="0.010",
|
|
177
|
+
payload=args
|
|
178
|
+
)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""
|
|
2
|
+
resolvax_agentkit/schemas.py
|
|
3
|
+
Pydantic Schemas for ResolvaX 6 Commercial M2M APIs.
|
|
4
|
+
"""
|
|
5
|
+
from typing import Optional, List, Dict, Any
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class MathSolveSchema(BaseModel):
|
|
10
|
+
expression: str = Field(..., description="Equação ou expressão matemática, ex: '3*x^2 - 12*x + 9 = 0' ou 'sin(x)^2 + cos(x)^2'")
|
|
11
|
+
operation: str = Field(default="solve", description="Operação: 'solve', 'simplify', 'factor', 'expand', 'diff', 'integrate'")
|
|
12
|
+
variable: Optional[str] = Field(default="x", description="Variável independente principal (padrão: 'x')")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class LatexConverterSchema(BaseModel):
|
|
16
|
+
input_text: str = Field(..., description="Texto ou fórmula matemática para conversão em LaTeX puro")
|
|
17
|
+
display_mode: Optional[str] = Field(default="inline", description="Modo de exibição: 'inline' ($...$) ou 'block' ($$...$$)")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class FinancialMathSchema(BaseModel):
|
|
21
|
+
calculation_type: str = Field(..., description="Tipo de cálculo: 'compound_interest', 'simple_interest', 'price_table', 'sac_table', 'npv', 'irr'")
|
|
22
|
+
principal: float = Field(..., description="Capital ou valor financiado inicial em R$ / moeda base")
|
|
23
|
+
rate: float = Field(..., description="Taxa de juros expressa em valor decimal por período (ex: 0.015 para 1.5%)")
|
|
24
|
+
periods: int = Field(..., description="Quantidade de períodos (meses ou anos)")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ExerciseGeneratorSchema(BaseModel):
|
|
28
|
+
topic: str = Field(..., description="Tópico matemático: 'quadratic_equations', 'linear_systems', 'trigonometry', 'percentages', 'geometry'")
|
|
29
|
+
difficulty: Optional[str] = Field(default="medium", description="Dificuldade: 'easy', 'medium', 'hard'")
|
|
30
|
+
grade_level: Optional[str] = Field(default="EF09", description="Nível de escolaridade ou código BNCC (ex: 'EF09', 'EM01')")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class MathEvaluatorSchema(BaseModel):
|
|
34
|
+
candidate_answer: str = Field(..., description="Resposta do aluno ou agente candidata a avaliação")
|
|
35
|
+
expected_answer: str = Field(..., description="Gabarito ou resposta oficial esperada")
|
|
36
|
+
variable: Optional[str] = Field(default="x", description="Variável principal da expressão")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class MathOcrSchema(BaseModel):
|
|
40
|
+
image_base64: str = Field(..., description="Imagem contendo texto ou fórmulas matemáticas em Base64")
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: resolvax-agentkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Coinbase AgentKit Action Provider for ResolvaX Mathematical & Educational Engines (x402 Base USDC).
|
|
5
|
+
Author-email: ResolvaX Team <contato@resolvax.com.br>
|
|
6
|
+
Project-URL: Homepage, https://resolvax.com.br
|
|
7
|
+
Project-URL: Documentation, https://resolvax.com.br/docs
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/swellington231/resolvax/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: pydantic>=2.0.0
|
|
18
|
+
Requires-Dist: httpx>=0.25.0
|
|
19
|
+
Provides-Extra: cdp
|
|
20
|
+
Requires-Dist: cdp-agentkit-core>=0.0.8; extra == "cdp"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# ResolvaX AgentKit Action Provider (Coinbase Base L2)
|
|
24
|
+
|
|
25
|
+
Official **Coinbase AgentKit Action Provider** for **ResolvaX**, enabling autonomous AI agents on the Base Layer 2 blockchain to seamlessly query mathematical, algebraic, LaTeX, financial, and OCR engines monetized with canonical **HTTP 402 Payment Required (x402)** in **USDC**.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🚀 Features
|
|
30
|
+
|
|
31
|
+
* **Symbolic Math Solver:** Quadratic, polynomial, derivative, and linear system solving with step-by-step LaTeX output ($0.001 USDC).
|
|
32
|
+
* **LaTeX Converter:** Natural language and raw mathematical text converted to publication-ready TeX ($0.001 USDC).
|
|
33
|
+
* **Financial Math Engine:** Compound interest, inflation, Price amortization, and loan PMT schedules ($0.001 USDC).
|
|
34
|
+
* **Exercise Generator:** Brazilian National Curriculum (BNCC) & high-school level math problem synthesis ($0.005 USDC).
|
|
35
|
+
* **Math Evaluator:** Algebraic equivalence verification and diagnostic feedback ($0.005 USDC).
|
|
36
|
+
* **Math OCR:** Image to LaTeX formula recognition with Otsu preprocessing ($0.010 USDC).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install resolvax-agentkit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ⚡ Quickstart with Coinbase AgentKit
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from coinbase_agentkit import AgentKit, AgentKitConfig, CdpWalletProvider
|
|
52
|
+
from resolvax_agentkit import ResolvaXActionProvider
|
|
53
|
+
|
|
54
|
+
# 1. Initialize your Base wallet provider
|
|
55
|
+
wallet_provider = CdpWalletProvider()
|
|
56
|
+
|
|
57
|
+
# 2. Add ResolvaX Action Provider to your AgentKit
|
|
58
|
+
agent_kit = AgentKit(
|
|
59
|
+
AgentKitConfig(
|
|
60
|
+
wallet_provider=wallet_provider,
|
|
61
|
+
action_providers=[
|
|
62
|
+
ResolvaXActionProvider()
|
|
63
|
+
]
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 🛡️ Protocol Specifications
|
|
71
|
+
|
|
72
|
+
* **Network:** Base Layer 2 (Mainnet)
|
|
73
|
+
* **Token:** USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)
|
|
74
|
+
* **Recipient Wallet:** `0x93dd815bc8d9a6e299d936986c5ee7dc3f267fee`
|
|
75
|
+
* **Protocol:** x402 Canonical (`X-402-Payment-Required`)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
resolvax_agentkit/__init__.py
|
|
5
|
+
resolvax_agentkit/action_provider.py
|
|
6
|
+
resolvax_agentkit/schemas.py
|
|
7
|
+
resolvax_agentkit.egg-info/PKG-INFO
|
|
8
|
+
resolvax_agentkit.egg-info/SOURCES.txt
|
|
9
|
+
resolvax_agentkit.egg-info/dependency_links.txt
|
|
10
|
+
resolvax_agentkit.egg-info/requires.txt
|
|
11
|
+
resolvax_agentkit.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
resolvax_agentkit
|