Skip to content

Commit

Permalink
fix: DIA-1402: Add ?async=true/false parameter to /refine (#335)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and nik committed Oct 15, 2024
1 parent 633ff89 commit 5f872ae
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .mock/definition/prompts/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ service:
display-name: Refine a prompt version
request:
name: VersionsRefinePromptRequest
query-parameters:
async:
type: optional<boolean>
docs: Run the refinement job asynchronously
body:
properties:
teacher_model_provider_connection_id:
Expand Down
8 changes: 8 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -15320,6 +15320,14 @@ client.prompts.versions.refine_prompt(
<dl>
<dd>

**async_:** `typing.Optional[bool]` — Run the refinement job asynchronously

</dd>
</dl>

<dl>
<dd>

**teacher_model_provider_connection_id:** `typing.Optional[int]` — Model Provider Connection ID to use to refine the prompt

</dd>
Expand Down
10 changes: 10 additions & 0 deletions src/label_studio_sdk/prompts/versions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def refine_prompt(
prompt_id: int,
version_id: int,
*,
async_: typing.Optional[bool] = None,
teacher_model_provider_connection_id: typing.Optional[int] = OMIT,
teacher_model_name: typing.Optional[str] = OMIT,
project_id: typing.Optional[int] = OMIT,
Expand All @@ -414,6 +415,9 @@ def refine_prompt(
version_id : int
Base Prompt Version ID
async_ : typing.Optional[bool]
Run the refinement job asynchronously
teacher_model_provider_connection_id : typing.Optional[int]
Model Provider Connection ID to use to refine the prompt
Expand Down Expand Up @@ -446,6 +450,7 @@ def refine_prompt(
_response = self._client_wrapper.httpx_client.request(
f"api/prompts/{jsonable_encoder(prompt_id)}/versions/{jsonable_encoder(version_id)}/refine",
method="POST",
params={"async": async_},
json={
"teacher_model_provider_connection_id": teacher_model_provider_connection_id,
"teacher_model_name": teacher_model_name,
Expand Down Expand Up @@ -846,6 +851,7 @@ async def refine_prompt(
prompt_id: int,
version_id: int,
*,
async_: typing.Optional[bool] = None,
teacher_model_provider_connection_id: typing.Optional[int] = OMIT,
teacher_model_name: typing.Optional[str] = OMIT,
project_id: typing.Optional[int] = OMIT,
Expand All @@ -862,6 +868,9 @@ async def refine_prompt(
version_id : int
Base Prompt Version ID
async_ : typing.Optional[bool]
Run the refinement job asynchronously
teacher_model_provider_connection_id : typing.Optional[int]
Model Provider Connection ID to use to refine the prompt
Expand Down Expand Up @@ -894,6 +903,7 @@ async def refine_prompt(
_response = await self._client_wrapper.httpx_client.request(
f"api/prompts/{jsonable_encoder(prompt_id)}/versions/{jsonable_encoder(version_id)}/refine",
method="POST",
params={"async": async_},
json={
"teacher_model_provider_connection_id": teacher_model_provider_connection_id,
"teacher_model_name": teacher_model_name,
Expand Down

0 comments on commit 5f872ae

Please sign in to comment.