Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Oct 7, 2024
1 parent e6fabdf commit 34909d6
Show file tree
Hide file tree
Showing 9 changed files with 405 additions and 31 deletions.
30 changes: 30 additions & 0 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,36 @@ types:
docs: Total cost of the inference (in USD)
source:
openapi: openapi/openapi.yaml
RefinedPromptResponseRefinementStatus:
enum:
- Pending
- InProgress
- Completed
- Failed
docs: Status of the refinement job
default: Pending
source:
openapi: openapi/openapi.yaml
RefinedPromptResponse:
properties:
title:
type: optional<string>
docs: Title of the refined prompt
reasoning:
type: optional<string>
docs: Reasoning behind the refinement
prompt:
type: string
docs: The refined prompt text
refinement_job_id:
type: optional<string>
docs: Unique identifier for the refinement job
refinement_status:
type: optional<RefinedPromptResponseRefinementStatus>
docs: Status of the refinement job
default: Pending
source:
openapi: openapi/openapi.yaml
InferenceRunOrganization:
discriminated: false
union:
Expand Down
57 changes: 48 additions & 9 deletions .mock/definition/prompts/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,46 @@ service:
total_cost_usd: 1.1
audiences:
- public
get_refined_prompt:
path: /api/prompts/{prompt_id}/versions/{version_id}/refine
method: GET
auth: true
docs: |
Get the refined prompt based on the `refinement_job_id`.
path-parameters:
prompt_id:
type: integer
docs: Prompt ID
version_id:
type: integer
docs: Prompt Version ID
display-name: Get refined prompt
request:
name: VersionsGetRefinedPromptRequest
query-parameters:
refinement_job_id:
type: string
docs: >-
Refinement Job ID acquired from the `POST
/api/prompts/{prompt_id}/versions/{version_id}/refine` endpoint
response:
docs: ''
type: root.RefinedPromptResponse
examples:
- path-parameters:
prompt_id: 1
version_id: 1
query-parameters:
refinement_job_id: refinement_job_id
response:
body:
title: title
reasoning: reasoning
prompt: prompt
refinement_job_id: refinement_job_id
refinement_status: Pending
audiences:
- public
refine_prompt:
path: /api/prompts/{prompt_id}/versions/{version_id}/refine
method: POST
Expand All @@ -224,6 +264,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 All @@ -237,7 +281,7 @@ service:
docs: Project ID to target the refined prompt for
response:
docs: ''
type: root.PromptVersion
type: root.RefinedPromptResponse
examples:
- path-parameters:
prompt_id: 1
Expand All @@ -246,15 +290,10 @@ service:
response:
body:
title: title
parent_model: 1
model_provider_connection: 1
reasoning: reasoning
prompt: prompt
provider: OpenAI
provider_model_id: provider_model_id
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
organization: 1
refinement_job_id: refinement_job_id
refinement_status: Pending
audiences:
- public
source:
Expand Down
96 changes: 96 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -15258,6 +15258,94 @@ client.prompts.versions.cost_estimate(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.prompts.versions.<a href="src/label_studio_sdk/prompts/versions/client.py">get_refined_prompt</a>(...)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Get the refined prompt based on the `refinement_job_id`.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from label_studio_sdk.client import LabelStudio

client = LabelStudio(
api_key="YOUR_API_KEY",
)
client.prompts.versions.get_refined_prompt(
prompt_id=1,
version_id=1,
refinement_job_id="refinement_job_id",
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**prompt_id:** `int` — Prompt ID

</dd>
</dl>

<dl>
<dd>

**version_id:** `int` — Prompt Version ID

</dd>
</dl>

<dl>
<dd>

**refinement_job_id:** `str` — Refinement Job ID acquired from the `POST /api/prompts/{prompt_id}/versions/{version_id}/refine` endpoint

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -15329,6 +15417,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
4 changes: 4 additions & 0 deletions src/label_studio_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
RedisExportStorageStatus,
RedisImportStorage,
RedisImportStorageStatus,
RefinedPromptResponse,
RefinedPromptResponseRefinementStatus,
S3ExportStorage,
S3ExportStorageStatus,
S3ImportStorage,
Expand Down Expand Up @@ -277,6 +279,8 @@
"RedisExportStorageStatus",
"RedisImportStorage",
"RedisImportStorageStatus",
"RefinedPromptResponse",
"RefinedPromptResponseRefinementStatus",
"S3ExportStorage",
"S3ExportStorageStatus",
"S3ImportStorage",
Expand Down
Loading

0 comments on commit 34909d6

Please sign in to comment.