Skip to content

Commit 025f6a6

Browse files
committed
merge and move logic to framework abstraction
2 parents 8a51120 + 343712a commit 025f6a6

File tree

142 files changed

+5355
-1574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+5355
-1574
lines changed

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
pip install tox
3232
3333
- name: Run tests with tox
34-
run: tox
34+
run: tox -m quick # quick runs all 3.12 tests and then combines coverage
3535

3636
- name: Upload coverage to Codecov
3737
uses: codecov/codecov-action@v5

.github/workflows/compile-llms-txt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Compile llms.txt
2020
run: |
2121
cd docs
22-
python compile_llms.py
22+
python compile_llms_txt.py
2323
- name: Commit and push changes
2424
run: |
2525
git config --local user.email "action@github.com"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ ex/
175175
**/ex/
176176
cookiecutter.json
177177

178+
tests/tmp
179+
178180
examples/tests/
179181
examples/tests/**/*
180182

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
recursive-include agentstack/templates *
2+
recursive-include agentstack/frameworks/templates *
23
recursive-include agentstack/_tools *
34
include agentstack.json .env .env.example

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ AgentStack scaffolds your _agent stack_ - the tech stack that collectively is yo
3232

3333
### Currently Supported Providers
3434
- **LLMs**: Most all notable LLMs and providers are supported via LiteLLM or LangChain
35-
- **Framework**: Currently supported frameworks include CrewAI and LangGraph
35+
- **Framework**: Currently supported frameworks include CrewAI, LangGraph, OpenAI Swarms and LlamaStack
3636
- Roadmap: Pydantic AI, Eliza, AG2 and Autogen
3737
- **Tools**: Maintaining the largest repository of framework-agnostic tools! All tools listed [here](https://docs.agentstack.sh/tools/community)
3838
- **Observability**: AgentOps baked in by default with first-tier support
@@ -145,6 +145,6 @@ AgentStack is open source software [licensed as MIT](LICENSE).
145145

146146
## How to Contribute
147147

148-
AgentStack is a new project built by passionate AI agent developers! We'd love help making this tool better. Easy first issues are available, create new issues with feature ideas, or chat with us on our [Discord](https://discord.gg/JdWkh9tgTQ).
148+
AgentStack is a new project built by passionate AI agent developers! We'd love help making this tool better. Easy first issues are available, create new issues with feature ideas, or chat with us on our [Discord](https://discord.gg/JdWkh9tgTQ). Make sure you read our contributor documentation to familiarize yourself with the project at [How to Contribute](https://docs.agentstack.sh/contributing/how-to-contribute).
149149

150150
If you are an Agent Tool developer, feel free to create an issue or even a PR to add your tool to AgentStack.

agentstack/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from pathlib import Path
1010
from agentstack import conf
1111
from agentstack.utils import get_framework
12-
from agentstack.agents import get_agent
13-
from agentstack.tasks import get_task
12+
from agentstack.agents import get_agent, get_all_agents, get_all_agent_names
13+
from agentstack.tasks import get_task, get_all_tasks, get_all_task_names
1414
from agentstack.inputs import get_inputs
1515
from agentstack import frameworks
1616

@@ -22,7 +22,11 @@
2222
"get_tags",
2323
"get_framework",
2424
"get_agent",
25+
"get_all_agents",
26+
"get_all_agent_names",
2527
"get_task",
28+
"get_all_tasks",
29+
"get_all_task_names",
2630
"get_inputs",
2731
]
2832

agentstack/_tools/file_read/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"category": "computer-control",
44
"tools": ["read_file"],
55
"description": "Read contents of files",
6-
"url": "https://github.com/AgentOps-AI/AgentStack/tree/main/agentstack/tools/file_read",
6+
"url": "https://docs.agentstack.sh/tools/tool/file_read",
77
"dependencies": []
88
}
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
import os
2+
from typing import Dict, List, Optional, Union, Literal
3+
from paymanai import Paymanai
4+
5+
# Initialize Payman client
6+
PAYMAN_API_SECRET = os.getenv("PAYMAN_API_SECRET")
7+
PAYMAN_ENVIRONMENT = os.getenv("PAYMAN_ENVIRONMENT", "sandbox")
8+
9+
client = Paymanai(
10+
x_payman_api_secret=PAYMAN_API_SECRET,
11+
environment=PAYMAN_ENVIRONMENT
12+
)
13+
14+
def send_payment(
15+
amount_decimal: float,
16+
payment_destination_id: str,
17+
customer_email: Optional[str] = None,
18+
customer_id: Optional[str] = None,
19+
customer_name: Optional[str] = None,
20+
memo: Optional[str] = None
21+
) -> Dict:
22+
"""
23+
Send USD from the agent's wallet to a pre-created payment destination.
24+
25+
Args:
26+
amount_decimal: Amount to send in USD (e.g. 10.00 for $10.00)
27+
payment_destination_id: ID of the pre-created payment destination
28+
customer_email: Optional email address of the customer
29+
customer_id: Optional ID of the customer
30+
customer_name: Optional name of the customer
31+
memo: Optional note or memo for the payment
32+
33+
Returns:
34+
Dictionary containing payment details
35+
"""
36+
try:
37+
return client.payments.send_payment(
38+
amount_decimal=amount_decimal,
39+
payment_destination_id=payment_destination_id,
40+
customer_email=customer_email,
41+
customer_id=customer_id,
42+
customer_name=customer_name,
43+
memo=memo
44+
)
45+
except Exception as e:
46+
return {"error": f"Failed to send payment: {str(e)}"}
47+
48+
def search_destinations(
49+
name: Optional[str] = None,
50+
customer_id: Optional[str] = None,
51+
contact_email: Optional[str] = None,
52+
) -> List[Dict]:
53+
"""
54+
Search for existing payment destinations by name, customer, or email.
55+
56+
Args:
57+
name: Optional name of the payment destination
58+
customer_id: Optional customer ID who owns the destination
59+
contact_email: Optional contact email to search for
60+
61+
Returns:
62+
List of matching payment destinations with their IDs
63+
"""
64+
try:
65+
return client.payments.search_destinations(
66+
name=name,
67+
customer_id=customer_id,
68+
contact_email=contact_email
69+
)
70+
except Exception as e:
71+
return [{"error": f"Failed to search destinations: {str(e)}"}]
72+
73+
def create_payee(
74+
type: Literal["US_ACH", "PAYMAN_AGENT"],
75+
name: str,
76+
customer_id: Optional[str] = None,
77+
account_holder_name: Optional[str] = None,
78+
account_holder_type: Optional[Literal["individual", "business"]] = None,
79+
account_number: Optional[str] = None,
80+
routing_number: Optional[str] = None,
81+
account_type: Optional[Literal["checking", "savings"]] = None,
82+
payman_agent_id: Optional[str] = None,
83+
contact_details: Optional[Dict] = None
84+
) -> Dict:
85+
"""
86+
Create a new payment destination for future USD payments.
87+
88+
Args:
89+
type: Type of payment destination ("US_ACH" or "PAYMAN_AGENT")
90+
name: Name for the payment destination
91+
customer_id: Customer ID who owns this destination (required for US_ACH)
92+
account_holder_name: Name of the account holder (required for US_ACH)
93+
account_holder_type: Type of account holder ("individual" or "business") (required for US_ACH)
94+
account_number: Bank account number (required for US_ACH)
95+
routing_number: Bank routing number (required for US_ACH)
96+
account_type: Type of bank account ("checking" or "savings") (required for US_ACH)
97+
payman_agent_id: The unique ID of the receiving agent (required for PAYMAN_AGENT)
98+
contact_details: Optional dictionary containing contact information
99+
100+
Returns:
101+
Dictionary containing the created payee details
102+
"""
103+
try:
104+
params = {
105+
"type": type,
106+
"name": name,
107+
"contact_details": contact_details
108+
}
109+
110+
if type == "US_ACH":
111+
params.update({
112+
"customer_id": customer_id,
113+
"account_holder_name": account_holder_name,
114+
"account_holder_type": account_holder_type,
115+
"account_number": account_number,
116+
"routing_number": routing_number,
117+
"account_type": account_type
118+
})
119+
elif type == "PAYMAN_AGENT":
120+
params.update({
121+
"payman_agent_id": payman_agent_id
122+
})
123+
124+
return client.payments.create_payee(params)
125+
except Exception as e:
126+
return {"error": f"Failed to create payee: {str(e)}"}
127+
128+
def initiate_customer_deposit(
129+
amount_decimal: float,
130+
customer_id: str,
131+
customer_email: Optional[str] = None,
132+
customer_name: Optional[str] = None,
133+
fee_mode: Optional[Literal["INCLUDED_IN_AMOUNT", "ADD_TO_AMOUNT"]] = None,
134+
memo: Optional[str] = None,
135+
wallet_id: Optional[str] = None
136+
) -> Dict:
137+
"""
138+
Generate a checkout link for customer USD deposits.
139+
140+
Args:
141+
amount_decimal: Amount to deposit in USD (e.g. 10.00 for $10.00)
142+
customer_id: ID of the customer to deposit funds for
143+
customer_email: Optional email address of the customer
144+
customer_name: Optional name of the customer
145+
fee_mode: How to handle processing fees ("INCLUDED_IN_AMOUNT" or "ADD_TO_AMOUNT")
146+
memo: Optional memo for the transaction
147+
wallet_id: Optional ID of specific wallet to deposit to
148+
149+
Returns:
150+
Dictionary containing the checkout URL
151+
"""
152+
try:
153+
response = client.payments.initiate_customer_deposit(
154+
amount_decimal=amount_decimal,
155+
customer_id=customer_id,
156+
customer_email=customer_email,
157+
customer_name=customer_name,
158+
fee_mode=fee_mode,
159+
memo=memo,
160+
wallet_id=wallet_id
161+
)
162+
return response
163+
except Exception as e:
164+
return {"error": f"Failed to generate deposit link: {str(e)}"}
165+
166+
def get_customer_balance(
167+
customer_id: str,
168+
currency: Literal["USD"] = "USD"
169+
) -> Dict:
170+
"""
171+
Check customer's available USD balance.
172+
173+
Args:
174+
customer_id: ID of the customer to check balance for
175+
currency: Currency code (always USD)
176+
177+
Returns:
178+
Dictionary containing balance information
179+
"""
180+
try:
181+
response = client.balances.get_customer_balance(customer_id, currency)
182+
return {
183+
"spendable_balance": response,
184+
"currency": currency,
185+
"customer_id": customer_id
186+
}
187+
except Exception as e:
188+
return {"error": f"Failed to get customer balance: {str(e)}"}
189+
190+
def get_spendable_balance(
191+
currency: Literal["USD"] = "USD"
192+
) -> Dict:
193+
"""
194+
Check agent's available USD balance.
195+
196+
Args:
197+
currency: Currency code (always USD)
198+
199+
Returns:
200+
Dictionary containing balance information
201+
"""
202+
try:
203+
response = client.balances.get_spendable_balance(currency)
204+
return {
205+
"spendable_balance": response,
206+
"currency": currency
207+
}
208+
except Exception as e:
209+
return {"error": f"Failed to get spendable balance: {str(e)}"}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "payman",
3+
"category": "financial-infra",
4+
"tools": [
5+
"send_payment",
6+
"search_available_payees",
7+
"add_payee",
8+
"ask_for_money",
9+
"get_balance"
10+
],
11+
"url": "https://www.paymanai.com",
12+
"cta": "Setup your Agents Payman account at https://app.paymanai.com",
13+
"env": {
14+
"PAYMAN_API_SECRET": null,
15+
"PAYMAN_ENVIRONMENT": null
16+
},
17+
"dependencies": ["paymanai>=2.1.0"]
18+
}

0 commit comments

Comments
 (0)