Skip to content

Commit e439329

Browse files
committed
only add mine
1 parent ccdd9b2 commit e439329

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/together/cli/api/endpoints.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,21 @@ def delete(client: Together, endpoint_id: str) -> None:
337337
type=click.Choice(["dedicated", "serverless"]),
338338
help="Filter by endpoint type",
339339
)
340+
@click.option(
341+
"--mine",
342+
is_flag=True,
343+
help="Show only endpoints owned by me",
344+
)
340345
@click.pass_obj
341346
@handle_api_errors
342347
def list(
343-
client: Together, json: bool, type: Literal["dedicated", "serverless"] | None
348+
client: Together,
349+
json: bool,
350+
type: Literal["dedicated", "serverless"] | None,
351+
mine: bool | None,
344352
) -> None:
345353
"""List all inference endpoints (includes both dedicated and serverless endpoints)."""
346-
endpoints: List[ListEndpoint] = client.endpoints.list(type=type)
354+
endpoints: List[ListEndpoint] = client.endpoints.list(type=type, mine=mine)
347355

348356
if not endpoints:
349357
click.echo("No dedicated endpoints found", err=True)

src/together/resources/endpoints.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ def list(
3333
client=self._client,
3434
)
3535

36-
params: Dict[str, str] = {}
36+
params = {}
3737
if type is not None:
3838
params["type"] = type
39-
if usage_type is not None:
40-
params["usage_type"] = usage_type
4139
if mine is not None:
42-
params["mine"] = str(mine).lower()
40+
params["mine"] = mine
4341

4442
response, _, _ = requestor.request(
4543
options=TogetherRequest(
@@ -292,13 +290,11 @@ async def list(
292290
client=self._client,
293291
)
294292

295-
params: Dict[str, str] = {}
293+
params = {}
296294
if type is not None:
297295
params["type"] = type
298-
if usage_type is not None:
299-
params["usage_type"] = usage_type
300296
if mine is not None:
301-
params["mine"] = str(mine).lower()
297+
params["mine"] = mine
302298

303299
response, _, _ = await requestor.arequest(
304300
options=TogetherRequest(

0 commit comments

Comments
 (0)