Skip to content

Commit 0014102

Browse files
Update: using helper methods to build the path with encoded params on the fly.
1 parent f6a28a1 commit 0014102

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

jigsawstack/prompt_engine.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .async_request import AsyncRequest
55
from typing import List, Union
66
from ._config import ClientConfig
7+
from .helpers import build_path
78

89

910
class PromptEngineResult(TypedDict):
@@ -137,10 +138,10 @@ def list(
137138
if params.get("page") is None:
138139
params["page"] = 0
139140

140-
limit = params.get("limit")
141-
page = params.get("page")
142-
143-
path = f"/prompt_engine?limit={limit}&page={page}"
141+
path = build_path(
142+
base_path="/prompt_engine",
143+
params=params,
144+
)
144145
resp = Request(
145146
config=self.config, path=path, params={}, verb="get"
146147
).perform_with_content()
@@ -253,10 +254,10 @@ async def list(
253254
if params.get("page") is None:
254255
params["page"] = 0
255256

256-
limit = params.get("limit")
257-
page = params.get("page")
258-
259-
path = f"/prompt_engine?limit={limit}&page={page}"
257+
path = build_path(
258+
base_path="/prompt_engine",
259+
params=params,
260+
)
260261
resp = await AsyncRequest(
261262
config=self.config, path=path, params={}, verb="get"
262263
).perform_with_content()

0 commit comments

Comments
 (0)