Skip to content

Commit

Permalink
feat: DIA-1577: OpenAI usage limits for Trial accounts (#354)
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
robot-ci-heartex and fern-api[bot] authored Nov 14, 2024
1 parent ae9984e commit d6b2cea
Show file tree
Hide file tree
Showing 12 changed files with 369 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2512,6 +2512,7 @@ types:
enum:
- OpenAI
- AzureOpenAI
- Custom
source:
openapi: openapi/openapi.yaml
ModelProviderConnectionScope:
Expand All @@ -2535,6 +2536,15 @@ types:
- map<string, unknown>
source:
openapi: openapi/openapi.yaml
ModelProviderConnectionBudgetResetPeriod:
enum:
- Monthly
- Yearly
- None
docs: Budget reset period for the model provider connection (null if not reset)
default: None
source:
openapi: openapi/openapi.yaml
ModelProviderConnection:
properties:
provider: ModelProviderConnectionProvider
Expand All @@ -2546,6 +2556,32 @@ types:
created_by: optional<ModelProviderConnectionCreatedBy>
created_at: optional<datetime>
updated_at: optional<datetime>
is_internal:
type: optional<boolean>
docs: >-
Whether the model provider connection is internal, not visible to the
user.
default: false
budget_limit:
type: optional<double>
docs: Budget limit for the model provider connection (null if unlimited)
budget_last_reset_date:
type: optional<datetime>
docs: Date and time the budget was last reset
budget_reset_period:
type: optional<ModelProviderConnectionBudgetResetPeriod>
docs: >-
Budget reset period for the model provider connection (null if not
reset)
default: None
budget_total_spent:
type: optional<double>
docs: >-
Tracked total budget spent for the given provider connection within
the current budget period
budget_alert_threshold:
type: optional<double>
docs: Budget alert threshold for the given provider connection
source:
openapi: openapi/openapi.yaml
CommentCreatedBy:
Expand Down
24 changes: 24 additions & 0 deletions .mock/definition/model_providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ service:
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
is_internal: true
budget_limit: 1.1
budget_last_reset_date: '2024-01-15T09:30:00Z'
budget_reset_period: Monthly
budget_total_spent: 1.1
budget_alert_threshold: 1.1
audiences:
- public
create:
Expand Down Expand Up @@ -55,6 +61,12 @@ service:
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
is_internal: true
budget_limit: 1.1
budget_last_reset_date: '2024-01-15T09:30:00Z'
budget_reset_period: Monthly
budget_total_spent: 1.1
budget_alert_threshold: 1.1
audiences:
- public
get:
Expand Down Expand Up @@ -85,6 +97,12 @@ service:
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
is_internal: true
budget_limit: 1.1
budget_last_reset_date: '2024-01-15T09:30:00Z'
budget_reset_period: Monthly
budget_total_spent: 1.1
budget_alert_threshold: 1.1
audiences:
- public
delete:
Expand Down Expand Up @@ -135,6 +153,12 @@ service:
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
is_internal: true
budget_limit: 1.1
budget_last_reset_date: '2024-01-15T09:30:00Z'
budget_reset_period: Monthly
budget_total_spent: 1.1
budget_alert_threshold: 1.1
audiences:
- public
source:
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "label-studio-sdk"
version = "1.0.8.dev"
version = "1.0.8"
description = ""
readme = "README.md"
authors = []
Expand Down
96 changes: 96 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -16061,6 +16061,54 @@ client.model_providers.create(
<dl>
<dd>

**is_internal:** `typing.Optional[bool]` — Whether the model provider connection is internal, not visible to the user.

</dd>
</dl>

<dl>
<dd>

**budget_limit:** `typing.Optional[float]` — Budget limit for the model provider connection (null if unlimited)

</dd>
</dl>

<dl>
<dd>

**budget_last_reset_date:** `typing.Optional[dt.datetime]` — Date and time the budget was last reset

</dd>
</dl>

<dl>
<dd>

**budget_reset_period:** `typing.Optional[ModelProviderConnectionBudgetResetPeriod]` — Budget reset period for the model provider connection (null if not reset)

</dd>
</dl>

<dl>
<dd>

**budget_total_spent:** `typing.Optional[float]` — Tracked total budget spent for the given provider connection within the current budget period

</dd>
</dl>

<dl>
<dd>

**budget_alert_threshold:** `typing.Optional[float]` — Budget alert threshold for the given provider connection

</dd>
</dl>

<dl>
<dd>

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

</dd>
Expand Down Expand Up @@ -16344,6 +16392,54 @@ client.model_providers.update(
<dl>
<dd>

**is_internal:** `typing.Optional[bool]` — Whether the model provider connection is internal, not visible to the user.

</dd>
</dl>

<dl>
<dd>

**budget_limit:** `typing.Optional[float]` — Budget limit for the model provider connection (null if unlimited)

</dd>
</dl>

<dl>
<dd>

**budget_last_reset_date:** `typing.Optional[dt.datetime]` — Date and time the budget was last reset

</dd>
</dl>

<dl>
<dd>

**budget_reset_period:** `typing.Optional[ModelProviderConnectionBudgetResetPeriod]` — Budget reset period for the model provider connection (null if not reset)

</dd>
</dl>

<dl>
<dd>

**budget_total_spent:** `typing.Optional[float]` — Tracked total budget spent for the given provider connection within the current budget period

</dd>
</dl>

<dl>
<dd>

**budget_alert_threshold:** `typing.Optional[float]` — Budget alert threshold for the given provider connection

</dd>
</dl>

<dl>
<dd>

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

</dd>
Expand Down
2 changes: 2 additions & 0 deletions src/label_studio_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
MlBackendAuthMethod,
MlBackendState,
ModelProviderConnection,
ModelProviderConnectionBudgetResetPeriod,
ModelProviderConnectionCreatedBy,
ModelProviderConnectionOrganization,
ModelProviderConnectionProvider,
Expand Down Expand Up @@ -250,6 +251,7 @@
"MlUpdateResponse",
"MlUpdateResponseAuthMethod",
"ModelProviderConnection",
"ModelProviderConnectionBudgetResetPeriod",
"ModelProviderConnectionCreatedBy",
"ModelProviderConnectionOrganization",
"ModelProviderConnectionProvider",
Expand Down
Loading

0 comments on commit d6b2cea

Please sign in to comment.