Skip to content

Commit 5a20155

Browse files
CompuIvesorangetin
andauthored
feat: dedicated endpoint cli commands (#254)
* chore: add devcontainer config * add openapi generation * feat: add dedicated endpoint cli * run lints * update makefile * rerun formatter * fix tests * make install * skip openapi spec download in ci * add debug step * add generated to output * remove debug * fix poetry inclusion of generated files * fix order of generation * remove 3.8 * fix normal test * try include directive * new try * move * try even more * try manifest * i give up, include openapi generated files * fix mypy error * add hardware call and --wait option * remove openapi client 😭😭😭😭😭 * manually update type for now * revert poetry * remove some unnecessary changes * bump together-python package version --------- Co-authored-by: orangetin <[email protected]>
1 parent 68aa34d commit 5a20155

File tree

14 files changed

+1111
-33
lines changed

14 files changed

+1111
-33
lines changed

.devcontainer/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.9
2+
3+
ENV PYTHONUNBUFFERED 1
4+
5+
RUN pipx install poetry==1.8.3
6+
7+
# Install pre-commit
8+
RUN pip install pre-commit

.devcontainer/devcontainer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Together Python Development",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/git:1": {},
8+
"ghcr.io/devcontainers/features/node:1": {},
9+
"ghcr.io/devcontainers/features/java:1": {
10+
"version": "17",
11+
"installMaven": false,
12+
"installGradle": false
13+
}
14+
},
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"ms-python.python",
19+
"ms-python.vscode-pylance",
20+
"ms-python.isort",
21+
"charliermarsh.ruff",
22+
"ms-python.mypy-type-checker",
23+
"eamodio.gitlens"
24+
],
25+
"settings": {
26+
"[python]": {
27+
"editor.defaultFormatter": "charliermarsh.ruff"
28+
},
29+
"editor.formatOnSave": true,
30+
"editor.codeActionsOnSave": {
31+
"source.fixAll": "explicit",
32+
"source.organizeImports": "explicit"
33+
},
34+
"ruff.lineLength": 100
35+
}
36+
}
37+
},
38+
"postCreateCommand": "poetry install",
39+
"remoteUser": "vscode"
40+
}

.github/workflows/_integration_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
strategy:
2525
matrix:
2626
python-version:
27-
- "3.8"
2827
- "3.9"
2928
- "3.10"
3029
- "3.11"

.github/workflows/_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
strategy:
2525
matrix:
2626
python-version:
27-
- "3.8"
2827
- "3.9"
2928
- "3.10"
3029
- "3.11"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build-backend = "poetry.masonry.api"
1212

1313
[tool.poetry]
1414
name = "together"
15-
version = "1.4.0"
15+
version = "1.4.1"
1616
authors = [
1717
"Together AI <[email protected]>"
1818
]

src/together/abstract/api_requestor.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _prepare_request_raw(
437437
[(k, v) for k, v in options.params.items() if v is not None]
438438
)
439439
abs_url = _build_api_url(abs_url, encoded_params)
440-
elif options.method.lower() in {"post", "put"}:
440+
elif options.method.lower() in {"post", "put", "patch"}:
441441
if options.params and (options.files or options.override_headers):
442442
data = options.params
443443
elif options.params and not options.files:
@@ -587,16 +587,14 @@ async def arequest_raw(
587587
)
588588
headers["Content-Type"] = content_type
589589

590-
request_kwargs = {
591-
"headers": headers,
592-
"data": data,
593-
"timeout": timeout,
594-
"allow_redirects": options.allow_redirects,
595-
}
596-
597590
try:
598591
result = await session.request(
599-
method=options.method, url=abs_url, **request_kwargs
592+
method=options.method,
593+
url=abs_url,
594+
headers=headers,
595+
data=data,
596+
timeout=timeout,
597+
allow_redirects=options.allow_redirects,
600598
)
601599
utils.log_debug(
602600
"Together API response",

0 commit comments

Comments
 (0)