Skip to content

Commit 2487f20

Browse files
committed
Release 0.0.20
1 parent ea8a15c commit 2487f20

78 files changed

Lines changed: 2741 additions & 2119 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: ci
33
on: [push]
44
jobs:
55
compile:
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout repo
9-
uses: actions/checkout@v3
9+
uses: actions/checkout@v4
1010
- name: Set up python
1111
uses: actions/setup-python@v4
1212
with:
@@ -19,10 +19,10 @@ jobs:
1919
- name: Compile
2020
run: poetry run mypy .
2121
test:
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout repo
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: Set up python
2727
uses: actions/setup-python@v4
2828
with:
@@ -39,10 +39,10 @@ jobs:
3939
publish:
4040
needs: [compile, test]
4141
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
42-
runs-on: ubuntu-20.04
42+
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout repo
45-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
4646
- name: Set up python
4747
uses: actions/setup-python@v4
4848
with:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
dist/
21
.mypy_cache/
2+
.ruff_cache/
33
__pycache__/
4+
dist/
45
poetry.toml
5-
.ruff_cache/

README.md

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,20 @@ Instantiate and use the client with the following:
2121

2222
```python
2323
from agentmail import AgentMail
24-
25-
client = AgentMail(
26-
api_key="YOUR_API_KEY",
27-
)
28-
client.inboxes.create(
29-
domain="yourdomain.com",
30-
)
24+
client = AgentMail(api_key="YOUR_API_KEY", )
25+
client.inboxes.create(domain='yourdomain.com', )
3126
```
3227

3328
## Async Client
3429

3530
The SDK also exports an `async` client so that you can make non-blocking calls to our API.
3631

3732
```python
38-
import asyncio
39-
4033
from agentmail import AsyncAgentMail
41-
42-
client = AsyncAgentMail(
43-
api_key="YOUR_API_KEY",
44-
)
45-
46-
34+
import asyncio
35+
client = AsyncAgentMail(api_key="YOUR_API_KEY", )
4736
async def main() -> None:
48-
await client.inboxes.create(
49-
domain="yourdomain.com",
50-
)
51-
52-
37+
await client.inboxes.create(domain='yourdomain.com', )
5338
asyncio.run(main())
5439
```
5540

@@ -60,7 +45,6 @@ will be thrown.
6045

6146
```python
6247
from agentmail.core.api_error import ApiError
63-
6448
try:
6549
client.inboxes.create(...)
6650
except ApiError as e:
@@ -70,6 +54,19 @@ except ApiError as e:
7054

7155
## Advanced
7256

57+
### Access Raw Response Data
58+
59+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
60+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
61+
62+
```python
63+
from agentmail import AgentMail
64+
client = AgentMail(..., )
65+
response = client.inboxes.with_raw_response.create(...)
66+
print(response.headers) # access the response headers
67+
print(response.data) # access the underlying object
68+
```
69+
7370
### Retries
7471

7572
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
@@ -97,12 +94,7 @@ The SDK defaults to a 60 second timeout. You can configure this with a timeout o
9794
```python
9895

9996
from agentmail import AgentMail
100-
101-
client = AgentMail(
102-
...,
103-
timeout=20.0,
104-
)
105-
97+
client = AgentMail(..., timeout=20.0, )
10698

10799
# Override timeout for a specific method
108100
client.inboxes.create(..., request_options={
@@ -114,18 +106,11 @@ client.inboxes.create(..., request_options={
114106

115107
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
116108
and transports.
109+
117110
```python
118-
import httpx
119111
from agentmail import AgentMail
120-
121-
client = AgentMail(
122-
...,
123-
httpx_client=httpx.Client(
124-
proxies="http://my.test.proxy.example.com",
125-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
126-
),
127-
)
128-
```
112+
import httpx
113+
client = AgentMail(..., httpx_client=httpx.Client(proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ))```
129114

130115
## Contributing
131116

poetry.lock

Lines changed: 58 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ pydantic = ">= 1.9.2"
4040
pydantic-core = "^2.18.2"
4141
typing_extensions = ">= 4.0.0"
4242

43-
[tool.poetry.dev-dependencies]
44-
mypy = "1.0.1"
43+
[tool.poetry.group.dev.dependencies]
44+
mypy = "==1.13.0"
4545
pytest = "^7.4.0"
4646
pytest-asyncio = "^0.23.5"
4747
python-dateutil = "^2.9.0"
4848
types-python-dateutil = "^2.9.0.20240316"
49-
ruff = "^0.5.6"
49+
ruff = "==0.11.5"
5050

5151
[tool.pytest.ini_options]
5252
testpaths = [ "tests" ]
@@ -58,6 +58,26 @@ plugins = ["pydantic.mypy"]
5858
[tool.ruff]
5959
line-length = 120
6060

61+
[tool.ruff.lint]
62+
select = [
63+
"E", # pycodestyle errors
64+
"F", # pyflakes
65+
"I", # isort
66+
]
67+
ignore = [
68+
"E402", # Module level import not at top of file
69+
"E501", # Line too long
70+
"E711", # Comparison to `None` should be `cond is not None`
71+
"E712", # Avoid equality comparisons to `True`; use `if ...:` checks
72+
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
73+
"E722", # Do not use bare `except`
74+
"E731", # Do not assign a `lambda` expression, use a `def`
75+
"F821", # Undefined name
76+
"F841" # Local variable ... is assigned to but never used
77+
]
78+
79+
[tool.ruff.lint.isort]
80+
section-order = ["future", "standard-library", "third-party", "first-party"]
6181

6282
[build-system]
6383
requires = ["poetry-core"]

0 commit comments

Comments
 (0)