Skip to content

Commit c40b863

Browse files
committed
Release 0.0.36
1 parent 8f01430 commit c40b863

104 files changed

Lines changed: 5157 additions & 3356 deletions

File tree

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: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ 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-
)
24+
client = AgentMail(api_key="YOUR_API_KEY", )
2825
client.inboxes.create()
2926
```
3027

@@ -33,19 +30,11 @@ client.inboxes.create()
3330
The SDK also exports an `async` client so that you can make non-blocking calls to our API.
3431

3532
```python
36-
import asyncio
37-
3833
from agentmail import AsyncAgentMail
39-
40-
client = AsyncAgentMail(
41-
api_key="YOUR_API_KEY",
42-
)
43-
44-
34+
import asyncio
35+
client = AsyncAgentMail(api_key="YOUR_API_KEY", )
4536
async def main() -> None:
4637
await client.inboxes.create()
47-
48-
4938
asyncio.run(main())
5039
```
5140

@@ -56,7 +45,6 @@ will be thrown.
5645

5746
```python
5847
from agentmail.core.api_error import ApiError
59-
6048
try:
6149
client.inboxes.create(...)
6250
except ApiError as e:
@@ -66,6 +54,19 @@ except ApiError as e:
6654

6755
## Advanced
6856

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+
6970
### Retries
7071

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

9596
from agentmail import AgentMail
96-
97-
client = AgentMail(
98-
...,
99-
timeout=20.0,
100-
)
101-
97+
client = AgentMail(..., timeout=20.0, )
10298

10399
# Override timeout for a specific method
104100
client.inboxes.create(..., request_options={
@@ -110,18 +106,11 @@ client.inboxes.create(..., request_options={
110106

111107
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
112108
and transports.
109+
113110
```python
114-
import httpx
115111
from agentmail import AgentMail
116-
117-
client = AgentMail(
118-
...,
119-
httpx_client=httpx.Client(
120-
proxies="http://my.test.proxy.example.com",
121-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
122-
),
123-
)
124-
```
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"), ))```
125114

126115
## Contributing
127116

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: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "agentmail"
33

44
[tool.poetry]
55
name = "agentmail"
6-
version = "0.0.35"
6+
version = "0.0.36"
77
description = ""
88
readme = "README.md"
99
authors = []
@@ -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)