diff --git a/README.md b/README.md index 9f02c8ee..af18e0e4 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ Instantiate and use the client with the following: ```python from truefoundry_sdk import TrueFoundry +from truefoundry_sdk.applications import ( + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, +) client = TrueFoundry( api_key="YOUR_API_KEY", @@ -35,6 +39,21 @@ client = TrueFoundry( response = client.applications.list( limit=10, offset=0, + application_id="applicationId", + workspace_id="workspaceId", + application_name="applicationName", + fqn="fqn", + workspace_fqn="workspaceFqn", + application_type="applicationType", + name_search_query="nameSearchQuery", + environment_id="environmentId", + cluster_id="clusterId", + application_set_id="applicationSetId", + paused=True, + device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU, + last_deployed_by_subjects="lastDeployedBySubjects", + lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE, + is_recommendation_present_and_visible=True, ) for item in response: yield item @@ -45,12 +64,16 @@ for page in response.iter_pages(): ## Async Client -The SDK also exports an `async` client so that you can make non-blocking calls to our API. +The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client). ```python import asyncio from truefoundry_sdk import AsyncTrueFoundry +from truefoundry_sdk.applications import ( + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, +) client = AsyncTrueFoundry( api_key="YOUR_API_KEY", @@ -62,6 +85,21 @@ async def main() -> None: response = await client.applications.list( limit=10, offset=0, + application_id="applicationId", + workspace_id="workspaceId", + application_name="applicationName", + fqn="fqn", + workspace_fqn="workspaceFqn", + application_type="applicationType", + name_search_query="nameSearchQuery", + environment_id="environmentId", + cluster_id="clusterId", + application_set_id="applicationSetId", + paused=True, + device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU, + last_deployed_by_subjects="lastDeployedBySubjects", + lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE, + is_recommendation_present_and_visible=True, ) async for item in response: yield item @@ -103,6 +141,9 @@ client = TrueFoundry( response = client.users.list( limit=10, offset=0, + query="query", + show_invalid_users=True, + include_virtual_accounts="includeVirtualAccounts", ) for item in response: yield item @@ -189,7 +230,7 @@ from truefoundry_sdk import TrueFoundry client = TrueFoundry( ..., httpx_client=httpx.Client( - proxies="http://my.test.proxy.example.com", + proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) diff --git a/generate_docs.py b/generate_docs.py index 3c66b0ee..cfd37241 100644 --- a/generate_docs.py +++ b/generate_docs.py @@ -1,3 +1,4 @@ +# mypy: ignore-errors import ast import re import shutil diff --git a/reference.md b/reference.md index 5597ae6c..d66978cd 100644 --- a/reference.md +++ b/reference.md @@ -285,6 +285,9 @@ client = TrueFoundry( response = client.users.list( limit=10, offset=0, + query="query", + show_invalid_users=True, + include_virtual_accounts="includeVirtualAccounts", ) for item in response: yield item @@ -1165,6 +1168,7 @@ Retrieve all teams associated with the authenticated user. If the user is a tena ```python from truefoundry_sdk import TrueFoundry +from truefoundry_sdk.teams import TeamsListRequestType client = TrueFoundry( api_key="YOUR_API_KEY", @@ -1173,6 +1177,7 @@ client = TrueFoundry( response = client.teams.list( limit=10, offset=0, + type=TeamsListRequestType.TEAM, ) for item in response: yield item @@ -2148,736 +2153,7 @@ client.virtual_accounts.delete( -## LlmGateway -
client.llm_gateway.svc_metrics_get_llm_playground_tables(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_metrics_get_llm_playground_tables() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_ts:** `typing.Optional[str]` — Start Timestamp in milliseconds - -
-
- -
-
- -**end_ts:** `typing.Optional[str]` — End Timestamp in milliseconds - -
-
- -
-
- -**model_names:** `typing.Optional[typing.Sequence[str]]` — Model Names - -
-
- -
-
- -**usernames:** `typing.Optional[typing.Sequence[str]]` — Usernames - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Sequence[MetadataItem]]` - -
-
- -
-
- -**utc_offset_seconds:** `typing.Optional[str]` — UTC Offset in seconds - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_inference_request_get_filter_type_and_label_values() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_inference_request_get_filter_type_and_label_values() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves available MCP metrics charts. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry -from truefoundry_sdk.llm_gateway import ( - SvcMcpMetricsGetMcpMetricsChartsRequestPage, -) - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts( - page=SvcMcpMetricsGetMcpMetricsChartsRequestPage.MCPSERVER, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**page:** `SvcMcpMetricsGetMcpMetricsChartsRequestPage` — Page type. Possible values: "mcpserver" or "tool" - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_filters(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves available MCP metrics filters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry -from truefoundry_sdk.llm_gateway import ( - SvcMcpMetricsGetMcpMetricsFiltersRequestPage, -) - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_filters( - start_time=1710201609, - end_time=1710202200, - page=SvcMcpMetricsGetMcpMetricsFiltersRequestPage.MCPSERVER, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_time:** `int` — Start time in epoch seconds (e.g., 1710201609) - -
-
- -
-
- -**end_time:** `int` — End time in epoch seconds (e.g., 1710202200) - -
-
- -
-
- -**page:** `SvcMcpMetricsGetMcpMetricsFiltersRequestPage` — Page type. Possible values: "mcpserver" or "tool" - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_mcp_metrics_get_mcp_meters(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves aggregated MCP metrics data. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry -from truefoundry_sdk.llm_gateway import McpMetersRequestDtoPage - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_mcp_metrics_get_mcp_meters( - page=McpMetersRequestDtoPage.MCPSERVER, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**page:** `McpMetersRequestDtoPage` — Page type. Possible values: "mcpserver" or "tool" - -
-
- -
-
- -**start_time:** `typing.Optional[int]` — Start time in epoch seconds (e.g., 1710201609) - -
-
- -
-
- -**end_time:** `typing.Optional[int]` — End time in epoch seconds (e.g., 1710202200) - -
-
- -
-
- -**filters:** `typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]]` — Map of filterName → filter object - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts_data(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves available MCP metrics charts. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry -from truefoundry_sdk.llm_gateway import McpMetricsChartsDataRequestDtoChartName - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts_data( - start_time=1710201609, - end_time=1710202200, - chart_name=McpMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_MCP_SERVER, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_time:** `int` — Start time in epoch seconds (e.g., 1710201609) - -
-
- -
-
- -**end_time:** `int` — End time in epoch seconds (e.g., 1710202200) - -
-
- -
-
- -**chart_name:** `McpMetricsChartsDataRequestDtoChartName` — Chart name - -
-
- -
-
- -**filters:** `typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]]` — Map of filterName → filter object - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves available Guardrail metrics charts. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_filters(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves available Guardrail metrics filters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_filters( - start_time=1710201609, - end_time=1710202200, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_time:** `int` — Start time in epoch seconds (e.g., 1710201609) - -
-
- -
-
- -**end_time:** `int` — End time in epoch seconds (e.g., 1710202200) - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_guardrail_metrics_get_guardrail_meters(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves aggregated Guardrail metrics data. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.llm_gateway.svc_guardrail_metrics_get_guardrail_meters() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_time:** `typing.Optional[int]` — Start time in epoch seconds (e.g., 1710201609) - -
-
- -
-
- -**end_time:** `typing.Optional[int]` — End time in epoch seconds (e.g., 1710202200) - -
-
- -
-
- -**filters:** `typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]]` — Map of filterName → filter object - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts_data(...) +
client.virtual_accounts.get_token(...)
@@ -2889,7 +2165,7 @@ client.llm_gateway.svc_guardrail_metrics_get_guardrail_meters()
-Retrieves Guardrail metrics charts data. +Get token for a virtual account by id
@@ -2905,18 +2181,13 @@ Retrieves Guardrail metrics charts data. ```python from truefoundry_sdk import TrueFoundry -from truefoundry_sdk.llm_gateway import ( - GuardrailMetricsChartsDataRequestDtoChartName, -) client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts_data( - start_time=1710201609, - end_time=1710202200, - chart_name=GuardrailMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_GUARDRAIL, +client.virtual_accounts.get_token( + id="id", ) ``` @@ -2933,33 +2204,7 @@ client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts_data(
-**start_time:** `int` — Start time in epoch seconds (e.g., 1710201609) - -
-
- -
-
- -**end_time:** `int` — End time in epoch seconds (e.g., 1710202200) - -
-
- -
-
- -**chart_name:** `GuardrailMetricsChartsDataRequestDtoChartName` — Chart name - -
-
- -
-
- -**filters:** `typing.Optional[ - typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue] -]` — Map of filterName → filter object +**id:** `str` — serviceaccount id
@@ -3265,6 +2510,8 @@ client = TrueFoundry( response = client.secret_groups.list( limit=10, offset=0, + fqn="fqn", + search="search", ) for item in response: yield item @@ -4478,6 +3725,10 @@ Retrieves a list of all latest applications. Supports filtering by application I ```python from truefoundry_sdk import TrueFoundry +from truefoundry_sdk.applications import ( + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, +) client = TrueFoundry( api_key="YOUR_API_KEY", @@ -4486,6 +3737,21 @@ client = TrueFoundry( response = client.applications.list( limit=10, offset=0, + application_id="applicationId", + workspace_id="workspaceId", + application_name="applicationName", + fqn="fqn", + workspace_fqn="workspaceFqn", + application_type="applicationType", + name_search_query="nameSearchQuery", + environment_id="environmentId", + cluster_id="clusterId", + application_set_id="applicationSetId", + paused=True, + device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU, + last_deployed_by_subjects="lastDeployedBySubjects", + lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE, + is_recommendation_present_and_visible=True, ) for item in response: yield item @@ -5367,7 +4633,7 @@ List Job Runs for provided Job Id. Filter the data based on parameters passed in
```python -from truefoundry_sdk import TrueFoundry +from truefoundry_sdk import JobRunsSortBy, SortDirection, TrueFoundry client = TrueFoundry( api_key="YOUR_API_KEY", @@ -5377,6 +4643,9 @@ response = client.jobs.list_runs( job_id="jobId", limit=10, offset=0, + search_prefix="searchPrefix", + sort_by=JobRunsSortBy.START_TIME, + order=SortDirection.ASC, ) for item in response: yield item @@ -5438,7 +4707,7 @@ for page in response.iter_pages():
-**order:** `typing.Optional[JobRunsSortDirection]` — Sorting order +**order:** `typing.Optional[SortDirection]` — Sorting order
@@ -5852,6 +5121,9 @@ client = TrueFoundry( response = client.workspaces.list( limit=10, offset=0, + cluster_id="clusterId", + name="name", + fqn="fqn", ) for item in response: yield item @@ -6117,233 +5389,21 @@ client.workspaces.delete( id="id", ) -``` -
-
- - - -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — Workspace id of the space - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - - - -
- -## Events -
client.events.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get Events for Pod, Job Run, Application. The events are sourced from Kubernetes as well as events captured by truefoundry. Optional query parameters include startTs, endTs for filtering. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.events.get() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_ts:** `typing.Optional[str]` — Start timestamp (ISO format) for querying events - -
-
- -
-
- -**end_ts:** `typing.Optional[str]` — End timestamp (ISO format) for querying events - -
-
- -
-
- -**application_id:** `typing.Optional[str]` — Application ID - -
-
- -
-
- -**application_fqn:** `typing.Optional[str]` — Application FQN - -
-
- -
-
- -**pod_names:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Name of the pods - -
-
- -
-
- -**job_run_name:** `typing.Optional[str]` — Job run name - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Alerts -
client.alerts.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get alerts for a given application or cluster filtered by start and end timestamp -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from truefoundry_sdk import TrueFoundry - -client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", -) -client.alerts.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_ts:** `typing.Optional[str]` — Start timestamp (ISO format) for querying events - -
-
- -
-
- -**end_ts:** `typing.Optional[str]` — End timestamp (ISO format) for querying events - -
-
- -
-
- -**cluster_id:** `typing.Optional[str]` — Cluster id - +``` +
+
+#### ⚙️ Parameters +
-**application_id:** `typing.Optional[str]` — Application id - -
-
-
-**alert_status:** `typing.Optional[AlertStatus]` — Alert status +**id:** `str` — Workspace id of the space
@@ -6391,13 +5451,35 @@ Fetch logs for various workload components, including Services, Jobs, Workflows,
```python -from truefoundry_sdk import TrueFoundry +from truefoundry_sdk import ( + LogsSearchFilterType, + LogsSearchOperatorType, + LogsSortingDirection, + TrueFoundry, +) client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -client.logs.get() +client.logs.get( + start_ts=1000000, + end_ts=1000000, + limit=1, + direction=LogsSortingDirection.ASC, + num_logs_to_ignore=1, + application_id="applicationId", + application_fqn="applicationFqn", + deployment_id="deploymentId", + job_run_name="jobRunName", + pod_name="podName", + container_name="containerName", + pod_names_regex="podNamesRegex", + search_filters="searchFilters", + search_string="searchString", + search_type=LogsSearchFilterType.REGEX, + search_operator=LogsSearchOperatorType.EQUAL, +) ```
@@ -6835,7 +5917,11 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.ml_repos.list() +response = client.ml_repos.list( + name="name", + limit=1, + offset=1, +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -6888,6 +5974,158 @@ for page in response.iter_pages():
+ + +
+ +## Traces +
client.traces.query_spans(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from truefoundry_sdk import TrueFoundry + +client = TrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", +) +response = client.traces.query_spans( + start_time="startTime", + tracing_project_fqn="tracingProjectFqn", +) +for item in response: + yield item +# alternatively, you can paginate page-by-page +for page in response.iter_pages(): + yield page + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**start_time:** `str` — Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z) + +
+
+ +
+
+ +**tracing_project_fqn:** `str` — Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default) + +
+
+ +
+
+ +**end_time:** `typing.Optional[str]` — End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided. + +
+
+ +
+
+ +**trace_ids:** `typing.Optional[typing.Sequence[str]]` — Array of trace IDs to filter by + +
+
+ +
+
+ +**span_ids:** `typing.Optional[typing.Sequence[str]]` — Array of span IDs to filter by + +
+
+ +
+
+ +**parent_span_ids:** `typing.Optional[typing.Sequence[str]]` — Array of parent span IDs to filter by + +
+
+ +
+
+ +**created_by_subject_types:** `typing.Optional[typing.Sequence[TracesSubjectType]]` — Array of subject types to filter by + +
+
+ +
+
+ +**created_by_subject_slugs:** `typing.Optional[typing.Sequence[str]]` — Array of subject slugs to filter by + +
+
+ +
+
+ +**application_names:** `typing.Optional[typing.Sequence[str]]` — Array of application names to filter by + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — The maximum number of spans to return per page. Defaults to 200 if not provided. + +
+
+ +
+
+ +**sort_direction:** `typing.Optional[SortDirection]` — Sort direction for results. Defaults to desc. + +
+
+ +
+
+ +**page_token:** `typing.Optional[str]` — Base64 encoded page token for pagination + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -7026,7 +6264,14 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.artifacts.list() +response = client.artifacts.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + run_id="run_id", +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -7307,7 +6552,13 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.prompts.list() +response = client.prompts.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -7580,7 +6831,14 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.models.list() +response = client.models.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + run_id="run_id", +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -7973,7 +7231,17 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.artifact_versions.list() +response = client.artifact_versions.list( + tag="tag", + fqn="fqn", + artifact_id="artifact_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -8699,7 +7967,17 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.model_versions.list() +response = client.model_versions.list( + tag="tag", + fqn="fqn", + model_id="model_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -9070,7 +8348,16 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.prompt_versions.list() +response = client.prompt_versions.list( + tag="tag", + fqn="fqn", + prompt_id="prompt_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -9289,6 +8576,7 @@ client = TrueFoundry( ) client.data_directories.delete( id="id", + delete_contents=True, ) ``` @@ -9377,7 +8665,13 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.data_directories.list() +response = client.data_directories.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + limit=1, + offset=1, +) for item in response: yield item # alternatively, you can paginate page-by-page @@ -10389,6 +9683,9 @@ client.internal.deployments.get_suggested_endpoint( application_type=ApplicationType.ASYNC_SERVICE, application_name="applicationName", workspace_id="workspaceId", + base_domain="baseDomain", + port="port", + prefer_wildcard=True, ) ``` @@ -10466,6 +9763,86 @@ client.internal.deployments.get_suggested_endpoint(
## Internal Applications +
client.internal.applications.promote_rollout(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Promote an application rollout for canary and blue-green. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from truefoundry_sdk import TrueFoundry + +client = TrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", +) +client.internal.applications.promote_rollout( + id="id", + full=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — Id of the application + +
+
+ +
+
+ +**full:** `typing.Optional[bool]` — Whether to promote a rollout to full + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+
client.internal.applications.get_pod_template_hash_to_deployment_version(...)
@@ -10501,6 +9878,7 @@ client = TrueFoundry( ) client.internal.applications.get_pod_template_hash_to_deployment_version( id="id", + pod_template_hashes="podTemplateHashes", ) ``` @@ -10583,7 +9961,10 @@ client = TrueFoundry( client.internal.metrics.get_charts( workspace_id="workspaceId", application_id="applicationId", + start_ts="startTs", + end_ts="endTs", filter_entity=MetricsGetChartsRequestFilterEntity.APPLICATION, + filter_query="filterQuery", ) ``` @@ -10906,7 +10287,10 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -client.internal.docker_registries.get_credentials() +client.internal.docker_registries.get_credentials( + fqn="fqn", + cluster_id="clusterId", +) ```
@@ -11072,7 +10456,18 @@ client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) -response = client.internal.artifact_versions.list() +response = client.internal.artifact_versions.list( + tag="tag", + fqn="fqn", + artifact_id="artifact_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + include_model_versions=True, +) for item in response: yield item # alternatively, you can paginate page-by-page diff --git a/src/truefoundry_sdk/__init__.py b/src/truefoundry_sdk/__init__.py index f212af0e..7c8752c8 100644 --- a/src/truefoundry_sdk/__init__.py +++ b/src/truefoundry_sdk/__init__.py @@ -2,836 +2,1622 @@ # isort: skip_file -from .types import ( - ActivateUserResponse, - AddOnComponentSource, - AddonComponent, - AddonComponentName, - AddonComponentStatus, - Ai21Integrations, - Ai21KeyAuth, - Ai21Model, - Ai21ProviderAccount, - AiFeaturesSettings, - Alert, - AlertConfig, - AlertConfigResource, - AlertConfigResourceType, - AlertSeverity, - AlertStatus, - AmqpInputConfig, - AmqpMetricConfig, - AmqpOutputConfig, - AnthropicIntegrations, - AnthropicKeyAuth, - AnthropicModel, - AnthropicProviderAccount, - Application, - ApplicationDebugInfo, - ApplicationLifecycleStage, - ApplicationMetadata, - ApplicationProblem, - ApplicationSet, - ApplicationSetComponentsItem, - ApplicationType, - ApplyMlEntityResponse, - ApplyMlEntityResponseData, - Artifact, - ArtifactManifest, - ArtifactManifestSource, - ArtifactPath, - ArtifactType, - ArtifactVersion, - ArtifactsCacheVolume, - ArtifactsDownload, - ArtifactsDownloadArtifactsItem, - AssistantMessage, - AssistantMessageContent, - AssistantMessageContentItem, - AsyncProcessorSidecar, - AsyncService, - AsyncServiceAutoscaling, - AsyncServiceAutoscalingMetrics, - AsyncServiceReplicas, - AutoRotate, - Autoshutdown, - AwsAccessKeyAuth, - AwsAccessKeyBasedAuth, - AwsAssumedRoleBasedAuth, - AwsBedrockGuardrailConfig, - AwsBedrockGuardrailConfigAuthData, - AwsBedrockGuardrailConfigOperation, - AwsBedrockProviderAccount, - AwsBedrockProviderAccountAuthData, - AwsEcr, - AwsEcrAuthData, - AwsEksIntegration, - AwsEksIntegrationAuthData, - AwsInferentia, - AwsIntegrations, - AwsParameterStore, - AwsParameterStoreAuthData, - AwsProviderAccount, - AwsProviderAccountAuthData, - AwsRegion, - AwsS3, - AwsS3AuthData, - AwsSagemakerProviderAccount, - AwsSagemakerProviderAccountAuthData, - AwsSecretsManager, - AwsSecretsManagerAuthData, - AzureAiInferenceModel, - AzureAiInferenceModelDeploymentDetails, - AzureAiManagedDeployment, - AzureAiServerlessDeployment, - AzureAksIntegration, - AzureBasicAuth, - AzureBlobStorage, - AzureConnectionStringAuth, - AzureContainerRegistry, - AzureContentSafetyCategory, - AzureContentSafetyGuardrailConfig, - AzureFoundryModel, - AzureFoundryModelV2, - AzureFoundryProviderAccount, - AzureIntegrations, - AzureKeyAuth, - AzureOAuth, - AzureOpenAiModel, - AzureOpenAiModelV2, - AzureOpenAiProviderAccount, - AzurePiiCategory, - AzurePiiGuardrailConfig, - AzurePiiGuardrailConfigDomain, - AzureProviderAccount, - AzureReposIntegration, - AzureVault, - BaseArtifactVersion, - BaseArtifactVersionManifest, - BaseAutoscaling, - BaseOAuth2Login, - BaseOAuth2LoginJwtSource, - BaseService, - BaseServiceImage, - BaseServiceMountsItem, - BaseWorkbenchInput, - BaseWorkbenchInputMountsItem, - BasicAuthCreds, - BedrockKeyAuth, - BedrockModel, - BedrockModelAuthData, - BedrockModelV2, - BitbucketIntegration, - BitbucketProviderAccount, - BlobStorageReference, - BlueGreen, - BudgetConfig, - BudgetLimitUnit, - BudgetRule, - BudgetWhen, - Build, - BuildBuildSource, - BuildBuildSpec, - BuildInfo, - BuildStatus, - Canary, - CanaryStep, - CerebrasIntegrations, - CerebrasKeyAuth, - CerebrasModel, - CerebrasProviderAccount, - ChangePasswordResponse, - ChatPromptManifest, - ChatPromptManifestMcpServersItem, - ChatPromptManifestMessagesItem, - ChatPromptManifestResponseFormat, - ChatPromptManifestRoutingConfig, - Cluster, - ClusterGateway, - ClusterManifest, - ClusterManifestClusterType, - ClusterManifestMonitoring, - ClusterManifestNodeLabelKeys, - ClusterManifestWorkbenchConfig, - ClusterType, - Codeserver, - CohereIntegrations, - CohereKeyAuth, - CohereModel, - CohereProviderAccount, - Collaborator, - CommonToolsSettings, - Config, - ContainerTaskConfig, - ContainerTaskConfigImage, - ContainerTaskConfigMountsItem, - CoreNatsOutputConfig, - CpuUtilizationMetric, - CreateMultiPartUploadRequest, - CreatePersonalAccessTokenResponse, - CronMetric, - CustomBasicAuth, - CustomBearerAuth, - CustomBlobStorage, - CustomGuardrailConfig, - CustomGuardrailConfigAuthData, - CustomGuardrailConfigOperation, - CustomGuardrailConfigTarget, - CustomHelmRepo, - CustomIntegrations, - CustomJwtAuthIntegration, - CustomModel, - CustomModelAuthData, - CustomModelModelServer, - CustomProviderAccount, - CustomTlsSettings, - CustomUsernamePasswordArtifactsRegistry, - DataDirectory, - DataDirectoryManifest, - DataDirectoryManifestSource, - DatabricksApiKeyAuth, - DatabricksIntegrations, - DatabricksModel, - DatabricksProviderAccount, - DatabricksProviderAccountAuthData, - DatabricksServicePrincipalAuth, - DeactivateUserResponse, - DeepinfraIntegrations, - DeepinfraKeyAuth, - DeepinfraModel, - DeepinfraProviderAccount, - DeleteApplicationResponse, - DeleteJobRunResponse, - DeletePersonalAccessTokenResponse, - DeleteSecretGroupResponse, - DeleteTeamResponse, - DeleteUserResponse, - DeleteVirtualAccountResponse, - Deployment, - DeploymentBuild, - DeploymentManifest, - DeploymentStatus, - DeploymentStatusValue, - DeploymentTransition, - DeveloperMessage, - DeveloperMessageContent, - DockerFileBuild, - DockerFileBuildCommand, - DockerhubBasicAuth, - DockerhubIntegrations, - DockerhubProviderAccount, - DockerhubRegistry, - DurationFilter, - DurationFilterOperation, - DurationFilterValue, - DynamicVolumeConfig, - Email, - EmailNotificationChannel, - EmptyResponse, - Endpoint, - EnkryptAiGuardrailConfig, - EnkryptAiGuardrailConfigOperation, - EnkryptAiKeyAuth, - Environment, - EnvironmentColor, - EnvironmentManifest, - EnvironmentOptimizeFor, - Event, - EventChart, - EventChartCategory, - EventInvolvedObject, - ExternalBlobStorageSource, - FallbackConfig, - FallbackModel, - FallbackRule, - FallbackWhen, - FastAiFramework, - FiddlerGuardType, - FiddlerGuardrailConfig, - FiddlerKeyAuth, - FileInfo, - Filter, - FlyteLaunchPlan, - FlyteLaunchPlanId, - FlyteLaunchPlanSpec, - FlyteTask, - FlyteTaskCustom, - FlyteTaskCustomTruefoundry, - FlyteTaskId, - FlyteTaskTemplate, - FlyteWorkflow, - FlyteWorkflowId, - FlyteWorkflowTemplate, - ForwardAction, - Function, - FunctionSchema, - GatewayConfig, - GatewayConfiguration, - GcpApiKeyAuth, - GcpGcr, - GcpGcs, - GcpGkeIntegration, - GcpGsm, - GcpIntegrations, - GcpKeyFileAuth, - GcpProviderAccount, - GcpProviderAccountAuthData, - GcpRegion, - GcpTpu, - GeminiModelV2, - GetAlertsResponse, - GetApplicationDeploymentResponse, - GetApplicationResponse, - GetArtifactResponse, - GetArtifactVersionResponse, - GetAuthenticatedVcsurlResponse, - GetAutoProvisioningStateResponse, - GetChartsResponse, - GetClusterResponse, - GetDataDirectoryResponse, - GetEnvironmentResponse, - GetEventsResponse, - GetJobRunResponse, - GetLogsResponse, - GetMlRepoResponse, - GetModelResponse, - GetModelVersionResponse, - GetOrCreatePersonalAccessTokenResponse, - GetPromptResponse, - GetPromptVersionResponse, - GetSecretGroupResponse, - GetSecretResponse, - GetSignedUrLsRequest, - GetSignedUrLsResponse, - GetSuggestedDeploymentEndpointResponse, - GetTeamResponse, - GetUserResourcesResponse, - GetUserResponse, - GetUserTeamsResponse, - GetVirtualAccountResponse, - GetWorkspaceResponse, - GitHelmRepo, - GitRepositoryExistsResponse, - GitSource, - GithubIntegration, - GithubProviderAccount, - GitlabIntegration, - GitlabProviderAccount, - GluonFramework, - GoogleGeminiProviderAccount, - GoogleModel, - GoogleVertexProviderAccount, - Graph, - GraphChartType, - GroqIntegrations, - GroqKeyAuth, - GroqModel, - GroqProviderAccount, - GuardrailConfigGroup, - GuardrailConfigIntegrations, - GuardrailMetersResponseDto, - GuardrailMetricChart, - GuardrailMetricsChartsResponseDto, - GuardrailMetricsFiltersResponseDto, - Guardrails, - GuardrailsConfig, - GuardrailsRule, - GuardrailsWhen, - H2OFramework, - HeaderLatencyBasedLoadBalancingRule, - HeaderMatch, - HeaderPriorityBasedLoadBalancingRule, - HeaderWeightBasedLoadBalancingRule, - HealthProbe, - Helm, - HelmRepo, - HelmSource, - HttpError, - HttpErrorCode, - HttpProbe, - HttpStatusCodeFilter, - HttpStatusCodeFilterOperation, - HttpStatusCodeFilterValue, - HttpValidationError, - HuggingfaceArtifactSource, - IChange, - IChangeOperation, - Image, - ImageCommand, - ImageContentPart, - ImageUrl, - ImageUrlUrl, - InFilter, - InFilterOperation, - InferMethodName, - InfraProviderAccount, - IngressControllerConfig, - InputOutputBasedCostMetricValue, - Intercept, - InterceptRulesItem, - InterceptRulesItemAction, - InternalArtifactVersion, - InternalListArtifactVersionsResponse, - InternalListArtifactVersionsResponseDataItem, - InternalModelVersion, - InviteUserResponse, - IsClusterConnectedResponse, - JFrogIntegrations, - JfrogArtifactsRegistry, - JfrogBasicAuth, - JfrogProviderAccount, - Job, - JobAlert, - JobImage, - JobMountsItem, - JobRun, - JobRunStatus, - JobRunsSortBy, - JobRunsSortDirection, - JobTrigger, - JobTriggerInput, - JobTriggerInputCommand, - JsonObjectResponseFormat, - JsonSchema, - JsonSchemaResponseFormat, - JwtAuthConfig, - JwtAuthConfigClaimsItem, - KafkaInputConfig, - KafkaMetricConfig, - KafkaOutputConfig, - KafkaSaslAuth, - KerasFramework, - Kustomize, - LatencyBasedLoadBalanceTarget, - LatencyBasedLoadBalancingRule, - LibraryName, - LightGbmFramework, - LikeFilter, - ListApplicationDeploymentsResponse, - ListApplicationsResponse, - ListArtifactVersionsResponse, - ListArtifactsResponse, - ListClusterAddonsResponse, - ListClustersResponse, - ListDataDirectoriesResponse, - ListEnvironmentsResponse, - ListFilesRequest, - ListFilesResponse, - ListJobRunResponse, - ListMlReposResponse, - ListModelVersionsResponse, - ListModelsResponse, - ListPersonalAccessTokenResponse, - ListPromptVersionsResponse, - ListPromptsResponse, - ListSecretGroupResponse, - ListSecretsResponse, - ListTeamsResponse, - ListUsersResponse, - ListVirtualAccountResponse, - ListWorkspacesResponse, - LoadBalanceTarget, - LoadBalancingConfig, - LoadBalancingRule, - LoadBalancingWhen, - LocalArtifactSource, - LocalModelSource, - LocalSource, - Log, - LogsSearchFilterType, - LogsSearchOperatorType, - LogsSortingDirection, - Manual, - McpMetersResponseDto, - McpMetricChart, - McpMetricsChartsResponseDto, - McpMetricsFiltersResponseDto, - McpServerAuth, - McpServerHeaderAuth, - McpServerHeaderOverrideAuth, - McpServerIntegration, - McpServerIntegrations, - McpServerOAuth2, - McpServerOAuth2Dcr, - McpServerOAuth2JwtSource, - McpServerPassthrough, - McpServerProviderAccount, - McpServerToolDetails, - McpServerWithFqn, - McpServerWithUrl, - McpTool, - Metadata, - MetadataItem, - Metric, - MimeType, - MirrorAction, - MistralAiIntegrations, - MistralAiKeyAuth, - MistralAiModel, - MistralAiProviderAccount, - MlRepo, - MlRepoManifest, - Model, - ModelConfiguration, - ModelCostMetric, - ModelManifest, - ModelManifestFramework, - ModelManifestSource, - ModelProviderAccount, - ModelType, - ModelVersion, - ModelVersionEnvironment, - MultiPartUpload, - MultiPartUploadResponse, - MultiPartUploadStorageProvider, - NatsInputConfig, - NatsMetricConfig, - NatsOutputConfig, - NatsUserPasswordAuth, - NodeSelector, - NodeSelectorCapacityType, - Nodepool, - NodepoolSelector, - NomicIntegrations, - NomicKeyAuth, - NomicModel, - NomicProviderAccount, - Notebook, - NotebookConfig, - NotificationTarget, - NotificationTargetForAlertRule, - NvidiaGpu, - NvidiaMiggpu, - NvidiaMiggpuProfile, - NvidiaTimeslicingGpu, - OAuth2LoginProvider, - OciRepo, - OllamaIntegrations, - OllamaKeyAuth, - OllamaModel, - OllamaProviderAccount, - OnnxFramework, - OpenAiIntegrations, - OpenAiModel, - OpenAiModerationsGuardrailConfig, - OpenAiModerationsGuardrailConfigCategoryThresholdsValue, - OpenAiModerationsGuardrailConfigCategoryThresholdsValueHarassment, - OpenRouterApiKeyAuth, - OpenRouterIntegrations, - OpenRouterModel, - OpenRouterProviderAccount, - OpenaiApiKeyAuth, - OpenaiProviderAccount, - Operation, - PaddleFramework, - PagerDuty, - PagerDutyIntegration, - PagerDutyIntegrationKeyAuth, - PagerDutyIntegrations, - PagerDutyProviderAccount, - Pagination, - PalmIntegrations, - PalmKeyAuth, - PalmModel, - PalmProviderAccount, - PaloAltoPrismaAirsGuardrailConfig, - PaloAltoPrismaAirsKeyAuth, - PangeaGuardType, - PangeaGuardrailConfig, - PangeaKeyAuth, - Param, - ParamParamType, - Parameters, - ParametersStop, - PatronusAnswerRelevanceCriteria, - PatronusAnswerRelevanceEvaluator, - PatronusEvaluator, - PatronusGliderCriteria, - PatronusGliderEvaluator, - PatronusGuardrailConfig, - PatronusGuardrailConfigTarget, - PatronusJudgeCriteria, - PatronusJudgeEvaluator, - PatronusKeyAuth, - PatronusPhiCriteria, - PatronusPhiEvaluator, - PatronusPiiCriteria, - PatronusPiiEvaluator, - PatronusToxicityCriteria, - PatronusToxicityEvaluator, - PerThousandEmbeddingTokensCostMetric, - PerThousandTokensCostMetric, - Permissions, - PerplexityAiKeyAuth, - PerplexityAiModel, - PerplexityAiProviderAccount, - PerplexityIntegrations, - PersonalAccessTokenManifest, - Pip, - Poetry, - PolicyActions, - PolicyEntityTypes, - PolicyFilters, - PolicyManifest, - PolicyManifestMode, - PolicyManifestOperation, - PolicyMutationOperation, - PolicyValidationOperation, - Port, - PortAppProtocol, - PortAuth, - PortProtocol, - PresignedUrlObject, - PriorityBasedLoadBalanceTarget, - PriorityBasedLoadBalancingRule, - PrometheusAlertRule, - Prompt, - PromptFooGuardType, - PromptFooGuardrailConfig, - PromptVersion, - ProviderAccounts, - PublicCostMetric, - PySparkTaskConfig, - PyTorchFramework, - PythonBuild, - PythonBuildCommand, - PythonBuildPythonDependencies, - PythonTaskConfig, - PythonTaskConfigImage, - PythonTaskConfigMountsItem, - QuayArtifactsRegistry, - QuayBasicAuth, - QuayIntegrations, - QuayProviderAccount, - RStudio, - RateLimitConfig, - RateLimitRule, - RateLimitUnit, - RateLimitWhen, - Recommendation, - RefusalContentPart, - RegisterUsersResponse, - RemoteSource, - Resources, - ResourcesDevicesItem, - ResourcesNode, - RetryConfig, - RevokeAllPersonalAccessTokenResponse, - Rolling, - RpsMetric, - SagemakerModel, - SambaNovaIntegrations, - SambaNovaKeyAuth, - SambaNovaModel, - SambaNovaProviderAccount, - Schedule, - ScheduleConcurrencyPolicy, - Secret, - SecretGroup, - SecretInput, - SecretMount, - SecretVersion, - SelfHostedModel, - SelfHostedModelAuthData, - SelfHostedModelIntegrations, - SelfHostedModelModelServer, - SelfHostedModelProviderAccount, - Service, - ServiceAutoscaling, - ServiceAutoscalingMetrics, - ServiceReplicas, - ServiceRolloutStrategy, - Session, - SignedUrl, - SklearnFramework, - SklearnModelSchema, - SklearnSerializationFormat, - SlackBot, - SlackBotAuth, - SlackBotIntegration, - SlackIntegrations, - SlackProviderAccount, - SlackWebhook, - SlackWebhookAuth, - SlackWebhookIntegration, - SmtpCredentials, - SpaCyFramework, - SparkBuild, - SparkConfig, - SparkDriverConfig, - SparkExecutorConfig, - SparkExecutorConfigInstances, - SparkExecutorDynamicScaling, - SparkExecutorFixedInstances, - SparkImage, - SparkImageBuild, - SparkImageBuildBuildSource, - SparkJob, - SparkJobEntrypoint, - SparkJobImage, - SparkJobJavaEntrypoint, - SparkJobPythonEntrypoint, - SparkJobPythonNotebookEntrypoint, - SparkJobScalaEntrypoint, - SparkJobScalaNotebookEntrypoint, - SparkJobTriggerInput, - SqsInputConfig, - SqsOutputConfig, - SqsQueueMetricConfig, - SshServer, - SshServerConfig, - SsoTeamManifest, - StageArtifactResponse, - StaticVolumeConfig, - StatsModelsFramework, - StringDataMount, - Subject, - SubjectType, - SystemMessage, - SystemMessageContent, - TaskDockerFileBuild, - TaskPySparkBuild, - TaskPythonBuild, - Team, - TeamManifest, - TensorFlowFramework, - TerminateJobResponse, - TextContentPart, - TextContentPartText, - TogetherAiIntegrations, - TogetherAiKeyAuth, - TogetherAiModel, - TogetherAiProviderAccount, - TokenPagination, - ToolCall, - ToolMessage, - ToolMessageContent, - ToolSchema, - TracingProject, - TracingProjectManifest, - TransformersFramework, - TriggerJobRunResponse, - TrueFoundryApplyRequestManifest, - TrueFoundryApplyResponse, - TrueFoundryApplyResponseAction, - TrueFoundryApplyResponseExistingManifest, - TrueFoundryArtifactSource, - TrueFoundryDbssm, - TrueFoundryDeleteRequestManifest, - TrueFoundryIntegrations, - TrueFoundryInteractiveLogin, - TrueFoundryManagedSource, - TrueFoundryProviderAccount, - TtlIntegrations, - TtlProviderAccount, - TtlRegistry, - UpdateSecretInput, - UpdateUserRolesResponse, - UpgradeData, - UsageCodeSnippet, - User, - UserMessage, - UserMessageContent, - UserMessageContentItem, - UserMetadata, - UserMetadataTenantRoleManagedBy, - UserResource, - Uv, - ValidationError, - ValidationErrorLocItem, - VertexModel, - VertexModelV2, - VirtualAccount, - VirtualAccountManifest, - VirtualMcpServerIntegration, - VirtualMcpServerSource, - Volume, - VolumeBrowser, - VolumeConfig, - VolumeMount, - WebhookBasicAuth, - WebhookBearerAuth, - WebhookIntegration, - WebhookIntegrationAuthData, - WebhookIntegrations, - WebhookProviderAccount, - WeightBasedLoadBalancingRule, - WorkbenchImage, - WorkerConfig, - WorkerConfigInputConfig, - WorkerConfigOutputConfig, - Workflow, - WorkflowAlert, - WorkflowFlyteEntitiesItem, - WorkflowSource, - Workspace, - WorkspaceManifest, - XgBoostFramework, - XgBoostModelSchema, - XgBoostSerializationFormat, -) -from .errors import ( - BadRequestError, - ConflictError, - ExpectationFailedError, - FailedDependencyError, - ForbiddenError, - MethodNotAllowedError, - NotFoundError, - NotImplementedError, - UnauthorizedError, - UnprocessableEntityError, -) -from . import ( - alerts, - application_versions, - applications, - artifact_versions, - artifacts, - clusters, - data_directories, - environments, - events, - internal, - jobs, - llm_gateway, - logs, - ml_repos, - model_versions, - models, - personal_access_tokens, - prompt_versions, - prompts, - secret_groups, - secrets, - teams, - users, - virtual_accounts, - workspaces, -) -from .applications import ( - ApplicationsCancelDeploymentResponse, - ApplicationsListRequestDeviceTypeFilter, - ApplicationsListRequestLifecycleStage, -) -from .artifact_versions import StageArtifactRequestManifest -from .client import AsyncTrueFoundry, TrueFoundry -from .clusters import ClustersDeleteResponse -from .jobs import TriggerJobRequestInput -from .llm_gateway import ( - GuardrailMetersRequestDtoFiltersValue, - GuardrailMetricsChartsDataRequestDtoChartName, - GuardrailMetricsChartsDataRequestDtoFiltersValue, - McpMetersRequestDtoFiltersValue, - McpMetersRequestDtoPage, - McpMetricsChartsDataRequestDtoChartName, - McpMetricsChartsDataRequestDtoFiltersValue, - SvcMcpMetricsGetMcpMetricsChartsRequestPage, - SvcMcpMetricsGetMcpMetricsFiltersRequestPage, -) -from .teams import ApplyTeamRequestManifest, TeamsListRequestType -from .version import __version__ -from .workspaces import WorkspacesDeleteResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + ActivateUserResponse, + AddOnComponentSource, + AddonComponent, + AddonComponentName, + AddonComponentStatus, + Ai21Integrations, + Ai21KeyAuth, + Ai21Model, + Ai21ProviderAccount, + AiFeaturesSettings, + Alert, + AlertConfig, + AlertConfigResource, + AlertConfigResourceType, + AlertSeverity, + AmqpInputConfig, + AmqpMetricConfig, + AmqpOutputConfig, + AnthropicIntegrations, + AnthropicKeyAuth, + AnthropicModel, + AnthropicProviderAccount, + Application, + ApplicationDebugInfo, + ApplicationLifecycleStage, + ApplicationMetadata, + ApplicationProblem, + ApplicationSet, + ApplicationSetComponentsItem, + ApplicationType, + ApplyMlEntityResponse, + ApplyMlEntityResponseData, + Artifact, + ArtifactManifest, + ArtifactManifestSource, + ArtifactPath, + ArtifactType, + ArtifactVersion, + ArtifactsCacheVolume, + ArtifactsDownload, + ArtifactsDownloadArtifactsItem, + AssistantMessage, + AssistantMessageContent, + AssistantMessageContentItem, + AsyncProcessorSidecar, + AsyncService, + AsyncServiceAutoscaling, + AsyncServiceAutoscalingMetrics, + AsyncServiceReplicas, + AutoRotate, + Autoshutdown, + AwsAccessKeyAuth, + AwsAccessKeyBasedAuth, + AwsAssumedRoleBasedAuth, + AwsBedrockGuardrailConfig, + AwsBedrockGuardrailConfigAuthData, + AwsBedrockGuardrailConfigOperation, + AwsBedrockProviderAccount, + AwsBedrockProviderAccountAuthData, + AwsEcr, + AwsEcrAuthData, + AwsEksIntegration, + AwsEksIntegrationAuthData, + AwsInferentia, + AwsIntegrations, + AwsParameterStore, + AwsParameterStoreAuthData, + AwsProviderAccount, + AwsProviderAccountAuthData, + AwsRegion, + AwsS3, + AwsS3AuthData, + AwsSagemakerProviderAccount, + AwsSagemakerProviderAccountAuthData, + AwsSecretsManager, + AwsSecretsManagerAuthData, + AzureAiInferenceModel, + AzureAiInferenceModelDeploymentDetails, + AzureAiManagedDeployment, + AzureAiServerlessDeployment, + AzureAksIntegration, + AzureBasicAuth, + AzureBlobStorage, + AzureConnectionStringAuth, + AzureContainerRegistry, + AzureContentSafetyCategory, + AzureContentSafetyGuardrailConfig, + AzureFoundryModel, + AzureFoundryModelV2, + AzureFoundryProviderAccount, + AzureIntegrations, + AzureKeyAuth, + AzureOAuth, + AzureOpenAiModel, + AzureOpenAiModelV2, + AzureOpenAiProviderAccount, + AzurePiiCategory, + AzurePiiGuardrailConfig, + AzurePiiGuardrailConfigDomain, + AzureProviderAccount, + AzureReposIntegration, + AzureVault, + BaseArtifactVersion, + BaseArtifactVersionManifest, + BaseAutoscaling, + BaseOAuth2Login, + BaseOAuth2LoginJwtSource, + BaseService, + BaseServiceImage, + BaseServiceMountsItem, + BaseWorkbenchInput, + BaseWorkbenchInputMountsItem, + BasicAuthCreds, + BedrockKeyAuth, + BedrockModel, + BedrockModelAuthData, + BedrockModelV2, + BitbucketIntegration, + BitbucketProviderAccount, + BlobStorageReference, + BlueGreen, + BudgetConfig, + BudgetLimitUnit, + BudgetRule, + BudgetWhen, + Build, + BuildBuildSource, + BuildBuildSpec, + BuildInfo, + BuildStatus, + Canary, + CanaryStep, + CerebrasIntegrations, + CerebrasKeyAuth, + CerebrasModel, + CerebrasProviderAccount, + ChangePasswordResponse, + ChatPromptManifest, + ChatPromptManifestMcpServersItem, + ChatPromptManifestMessagesItem, + ChatPromptManifestResponseFormat, + ChatPromptManifestRoutingConfig, + Cluster, + ClusterGateway, + ClusterManifest, + ClusterManifestClusterType, + ClusterManifestMonitoring, + ClusterManifestNodeLabelKeys, + ClusterManifestWorkbenchConfig, + ClusterType, + Codeserver, + CohereIntegrations, + CohereKeyAuth, + CohereModel, + CohereProviderAccount, + Collaborator, + CommonToolsSettings, + Config, + ContainerTaskConfig, + ContainerTaskConfigImage, + ContainerTaskConfigMountsItem, + CoreNatsOutputConfig, + CpuUtilizationMetric, + CreateMultiPartUploadRequest, + CreatePersonalAccessTokenResponse, + CronMetric, + CustomBasicAuth, + CustomBearerAuth, + CustomBlobStorage, + CustomGuardrailConfig, + CustomGuardrailConfigAuthData, + CustomGuardrailConfigOperation, + CustomGuardrailConfigTarget, + CustomHelmRepo, + CustomIntegrations, + CustomJwtAuthIntegration, + CustomModel, + CustomModelAuthData, + CustomModelModelServer, + CustomProviderAccount, + CustomTlsSettings, + CustomUsernamePasswordArtifactsRegistry, + DataDirectory, + DataDirectoryManifest, + DataDirectoryManifestSource, + DatabricksApiKeyAuth, + DatabricksIntegrations, + DatabricksModel, + DatabricksProviderAccount, + DatabricksProviderAccountAuthData, + DatabricksServicePrincipalAuth, + DeactivateUserResponse, + DeepinfraIntegrations, + DeepinfraKeyAuth, + DeepinfraModel, + DeepinfraProviderAccount, + DeleteApplicationResponse, + DeleteJobRunResponse, + DeletePersonalAccessTokenResponse, + DeleteSecretGroupResponse, + DeleteTeamResponse, + DeleteUserResponse, + DeleteVirtualAccountResponse, + Deployment, + DeploymentBuild, + DeploymentManifest, + DeploymentStatus, + DeploymentStatusValue, + DeploymentTransition, + DeveloperMessage, + DeveloperMessageContent, + DockerFileBuild, + DockerFileBuildCommand, + DockerhubBasicAuth, + DockerhubIntegrations, + DockerhubProviderAccount, + DockerhubRegistry, + DynamicVolumeConfig, + Email, + EmailNotificationChannel, + EmptyResponse, + Endpoint, + EnkryptAiGuardrailConfig, + EnkryptAiGuardrailConfigOperation, + EnkryptAiKeyAuth, + Environment, + EnvironmentColor, + EnvironmentManifest, + EnvironmentOptimizeFor, + ExternalBlobStorageSource, + FallbackConfig, + FallbackModel, + FallbackRule, + FallbackWhen, + FastAiFramework, + FiddlerGuardType, + FiddlerGuardrailConfig, + FiddlerKeyAuth, + FileInfo, + FlyteLaunchPlan, + FlyteLaunchPlanId, + FlyteLaunchPlanSpec, + FlyteTask, + FlyteTaskCustom, + FlyteTaskCustomTruefoundry, + FlyteTaskId, + FlyteTaskTemplate, + FlyteWorkflow, + FlyteWorkflowId, + FlyteWorkflowTemplate, + ForwardAction, + Function, + FunctionSchema, + GatewayConfig, + GatewayConfiguration, + GcpApiKeyAuth, + GcpGcr, + GcpGcs, + GcpGkeIntegration, + GcpGsm, + GcpIntegrations, + GcpKeyFileAuth, + GcpProviderAccount, + GcpProviderAccountAuthData, + GcpRegion, + GcpTpu, + GeminiModelV2, + GetApplicationDeploymentResponse, + GetApplicationResponse, + GetArtifactResponse, + GetArtifactVersionResponse, + GetAuthenticatedVcsurlResponse, + GetAutoProvisioningStateResponse, + GetChartsResponse, + GetClusterResponse, + GetDataDirectoryResponse, + GetEnvironmentResponse, + GetJobRunResponse, + GetLogsResponse, + GetMlRepoResponse, + GetModelResponse, + GetModelVersionResponse, + GetOrCreatePersonalAccessTokenResponse, + GetPromptResponse, + GetPromptVersionResponse, + GetSecretGroupResponse, + GetSecretResponse, + GetSignedUrLsRequest, + GetSignedUrLsResponse, + GetSuggestedDeploymentEndpointResponse, + GetTeamResponse, + GetTokenForVirtualAccountResponse, + GetUserResourcesResponse, + GetUserResponse, + GetUserTeamsResponse, + GetVirtualAccountResponse, + GetWorkspaceResponse, + GitHelmRepo, + GitRepositoryExistsResponse, + GitSource, + GithubIntegration, + GithubProviderAccount, + GitlabIntegration, + GitlabProviderAccount, + GluonFramework, + GoogleGeminiProviderAccount, + GoogleModel, + GoogleVertexProviderAccount, + Graph, + GraphChartType, + GroqIntegrations, + GroqKeyAuth, + GroqModel, + GroqProviderAccount, + GuardrailConfigGroup, + GuardrailConfigIntegrations, + Guardrails, + GuardrailsConfig, + GuardrailsRule, + GuardrailsWhen, + H2OFramework, + HeaderMatch, + HealthProbe, + Helm, + HelmRepo, + HelmSource, + HttpError, + HttpErrorCode, + HttpProbe, + HttpValidationError, + HuggingfaceArtifactSource, + IChange, + IChangeOperation, + Image, + ImageCommand, + ImageContentPart, + ImageUrl, + ImageUrlUrl, + InferMethodName, + InfraProviderAccount, + IngressControllerConfig, + InputOutputBasedCostMetricValue, + Intercept, + InterceptRulesItem, + InterceptRulesItemAction, + InternalArtifactVersion, + InternalListArtifactVersionsResponse, + InternalListArtifactVersionsResponseDataItem, + InternalModelVersion, + InviteUserResponse, + IsClusterConnectedResponse, + JFrogIntegrations, + JfrogArtifactsRegistry, + JfrogBasicAuth, + JfrogProviderAccount, + Job, + JobAlert, + JobImage, + JobMountsItem, + JobRun, + JobRunStatus, + JobRunsSortBy, + JobTrigger, + JobTriggerInput, + JobTriggerInputCommand, + JsonObjectResponseFormat, + JsonSchema, + JsonSchemaResponseFormat, + Jwt, + JwtAuthConfig, + JwtAuthConfigClaimsItem, + KafkaInputConfig, + KafkaMetricConfig, + KafkaOutputConfig, + KafkaSaslAuth, + KerasFramework, + Kustomize, + LatencyBasedLoadBalanceTarget, + LatencyBasedLoadBalancing, + LatencyBasedLoadBalancingRule, + LibraryName, + LightGbmFramework, + ListApplicationDeploymentsResponse, + ListApplicationsResponse, + ListArtifactVersionsResponse, + ListArtifactsResponse, + ListClusterAddonsResponse, + ListClustersResponse, + ListDataDirectoriesResponse, + ListEnvironmentsResponse, + ListFilesRequest, + ListFilesResponse, + ListJobRunResponse, + ListMlReposResponse, + ListModelVersionsResponse, + ListModelsResponse, + ListPersonalAccessTokenResponse, + ListPromptVersionsResponse, + ListPromptsResponse, + ListSecretGroupResponse, + ListSecretsResponse, + ListTeamsResponse, + ListUsersResponse, + ListVirtualAccountResponse, + ListWorkspacesResponse, + LoadBalanceTarget, + LoadBalancingConfig, + LoadBalancingRule, + LoadBalancingWhen, + LocalArtifactSource, + LocalModelSource, + LocalSource, + Log, + LogsSearchFilterType, + LogsSearchOperatorType, + LogsSortingDirection, + Manual, + McpServerAuth, + McpServerHeaderAuth, + McpServerHeaderOverrideAuth, + McpServerIntegration, + McpServerIntegrations, + McpServerOAuth2, + McpServerOAuth2Dcr, + McpServerOAuth2JwtSource, + McpServerPassthrough, + McpServerProviderAccount, + McpServerToolDetails, + McpServerWithFqn, + McpServerWithUrl, + McpTool, + Metadata, + Metric, + MimeType, + MirrorAction, + MistralAiIntegrations, + MistralAiKeyAuth, + MistralAiModel, + MistralAiProviderAccount, + MlRepo, + MlRepoManifest, + Model, + ModelConfiguration, + ModelCostMetric, + ModelManifest, + ModelManifestFramework, + ModelManifestSource, + ModelProviderAccount, + ModelType, + ModelVersion, + ModelVersionEnvironment, + MultiPartUpload, + MultiPartUploadResponse, + MultiPartUploadStorageProvider, + NatsInputConfig, + NatsMetricConfig, + NatsOutputConfig, + NatsUserPasswordAuth, + NodeSelector, + NodeSelectorCapacityType, + Nodepool, + NodepoolSelector, + NomicIntegrations, + NomicKeyAuth, + NomicModel, + NomicProviderAccount, + Notebook, + NotebookConfig, + NotificationTarget, + NotificationTargetForAlertRule, + NvidiaGpu, + NvidiaMiggpu, + NvidiaMiggpuProfile, + NvidiaTimeslicingGpu, + OAuth2LoginProvider, + OciRepo, + OllamaIntegrations, + OllamaKeyAuth, + OllamaModel, + OllamaProviderAccount, + OnnxFramework, + OpenAiIntegrations, + OpenAiModel, + OpenAiModerationsGuardrailConfig, + OpenAiModerationsGuardrailConfigCategoryThresholdsValue, + OpenAiModerationsGuardrailConfigCategoryThresholdsValueHarassment, + OpenRouterApiKeyAuth, + OpenRouterIntegrations, + OpenRouterModel, + OpenRouterProviderAccount, + OpenaiApiKeyAuth, + OpenaiProviderAccount, + Operation, + PaddleFramework, + PagerDuty, + PagerDutyIntegration, + PagerDutyIntegrationKeyAuth, + PagerDutyIntegrations, + PagerDutyProviderAccount, + Pagination, + PalmIntegrations, + PalmKeyAuth, + PalmModel, + PalmProviderAccount, + PaloAltoPrismaAirsGuardrailConfig, + PaloAltoPrismaAirsGuardrailConfigMode, + PaloAltoPrismaAirsKeyAuth, + PangeaGuardType, + PangeaGuardrailConfig, + PangeaKeyAuth, + Param, + ParamParamType, + Parameters, + ParametersStop, + PatronusAnswerRelevanceCriteria, + PatronusAnswerRelevanceEvaluator, + PatronusEvaluator, + PatronusGliderCriteria, + PatronusGliderEvaluator, + PatronusGuardrailConfig, + PatronusGuardrailConfigTarget, + PatronusJudgeCriteria, + PatronusJudgeEvaluator, + PatronusKeyAuth, + PatronusPhiCriteria, + PatronusPhiEvaluator, + PatronusPiiCriteria, + PatronusPiiEvaluator, + PatronusToxicityCriteria, + PatronusToxicityEvaluator, + PerThousandEmbeddingTokensCostMetric, + PerThousandTokensCostMetric, + Permissions, + PerplexityAiKeyAuth, + PerplexityAiModel, + PerplexityAiProviderAccount, + PerplexityIntegrations, + PersonalAccessTokenManifest, + Pip, + Poetry, + PolicyActions, + PolicyEntityTypes, + PolicyFilters, + PolicyManifest, + PolicyManifestMode, + PolicyManifestOperation, + PolicyMutationOperation, + PolicyValidationOperation, + Port, + PortAppProtocol, + PortAuth, + PortProtocol, + PresignedUrlObject, + PriorityBasedLoadBalanceTarget, + PriorityBasedLoadBalancing, + PriorityBasedLoadBalancingRule, + PrometheusAlertRule, + Prompt, + PromptFooGuardType, + PromptFooGuardrailConfig, + PromptVersion, + ProviderAccounts, + PublicCostMetric, + PySparkTaskConfig, + PyTorchFramework, + PythonBuild, + PythonBuildCommand, + PythonBuildPythonDependencies, + PythonTaskConfig, + PythonTaskConfigImage, + PythonTaskConfigMountsItem, + QuayArtifactsRegistry, + QuayBasicAuth, + QuayIntegrations, + QuayProviderAccount, + QuerySpansResponse, + RStudio, + RateLimitConfig, + RateLimitRule, + RateLimitUnit, + RateLimitWhen, + Recommendation, + RefusalContentPart, + RegisterUsersResponse, + RemoteSource, + Resources, + ResourcesDevicesItem, + ResourcesNode, + RetryConfig, + RevokeAllPersonalAccessTokenResponse, + Rolling, + RpsMetric, + SagemakerModel, + SambaNovaIntegrations, + SambaNovaKeyAuth, + SambaNovaModel, + SambaNovaProviderAccount, + Schedule, + ScheduleConcurrencyPolicy, + Secret, + SecretGroup, + SecretInput, + SecretMount, + SecretVersion, + SelfHostedModel, + SelfHostedModelAuthData, + SelfHostedModelIntegrations, + SelfHostedModelModelServer, + SelfHostedModelProviderAccount, + Service, + ServiceAutoscaling, + ServiceAutoscalingMetrics, + ServiceReplicas, + ServiceRolloutStrategy, + Session, + SignedUrl, + SklearnFramework, + SklearnModelSchema, + SklearnSerializationFormat, + SlackBot, + SlackBotAuth, + SlackBotIntegration, + SlackIntegrations, + SlackProviderAccount, + SlackWebhook, + SlackWebhookAuth, + SlackWebhookIntegration, + SmtpCredentials, + SortDirection, + SpaCyFramework, + SparkBuild, + SparkConfig, + SparkDriverConfig, + SparkExecutorConfig, + SparkExecutorConfigInstances, + SparkExecutorDynamicScaling, + SparkExecutorFixedInstances, + SparkImage, + SparkImageBuild, + SparkImageBuildBuildSource, + SparkJob, + SparkJobEntrypoint, + SparkJobImage, + SparkJobJavaEntrypoint, + SparkJobPythonEntrypoint, + SparkJobPythonNotebookEntrypoint, + SparkJobScalaEntrypoint, + SparkJobScalaNotebookEntrypoint, + SparkJobTriggerInput, + SqsInputConfig, + SqsOutputConfig, + SqsQueueMetricConfig, + SshServer, + SshServerConfig, + SsoTeamManifest, + StageArtifactResponse, + StaticVolumeConfig, + StatsModelsFramework, + StringDataMount, + Subject, + SubjectType, + SystemMessage, + SystemMessageContent, + TaskDockerFileBuild, + TaskPySparkBuild, + TaskPythonBuild, + Team, + TeamManifest, + TensorFlowFramework, + TerminateJobResponse, + TextContentPart, + TextContentPartText, + TogetherAiIntegrations, + TogetherAiKeyAuth, + TogetherAiModel, + TogetherAiProviderAccount, + TokenPagination, + ToolCall, + ToolMessage, + ToolMessageContent, + ToolSchema, + TraceSpan, + TracesSubjectType, + TracingProject, + TracingProjectManifest, + TransformersFramework, + TriggerJobRunResponse, + TrueFoundryApplyRequestManifest, + TrueFoundryApplyResponse, + TrueFoundryApplyResponseAction, + TrueFoundryApplyResponseExistingManifest, + TrueFoundryArtifactSource, + TrueFoundryDbssm, + TrueFoundryDeleteRequestManifest, + TrueFoundryIntegrations, + TrueFoundryInteractiveLogin, + TrueFoundryManagedSource, + TrueFoundryProviderAccount, + TtlIntegrations, + TtlProviderAccount, + TtlRegistry, + UpdateSecretInput, + UpdateUserRolesResponse, + UpgradeData, + UsageCodeSnippet, + User, + UserMessage, + UserMessageContent, + UserMessageContentItem, + UserMetadata, + UserMetadataTenantRoleManagedBy, + UserResource, + Uv, + ValidationError, + ValidationErrorLocItem, + VertexModel, + VertexModelV2, + VirtualAccount, + VirtualAccountManifest, + VirtualMcpServerIntegration, + VirtualMcpServerSource, + Volume, + VolumeBrowser, + VolumeConfig, + VolumeMount, + WebhookBasicAuth, + WebhookBearerAuth, + WebhookIntegration, + WebhookIntegrationAuthData, + WebhookIntegrations, + WebhookProviderAccount, + WeightBasedLoadBalancing, + WeightBasedLoadBalancingRule, + WorkbenchImage, + WorkerConfig, + WorkerConfigInputConfig, + WorkerConfigOutputConfig, + Workflow, + WorkflowAlert, + WorkflowFlyteEntitiesItem, + WorkflowSource, + Workspace, + WorkspaceManifest, + XgBoostFramework, + XgBoostModelSchema, + XgBoostSerializationFormat, + ) + from .errors import ( + BadRequestError, + ConflictError, + ExpectationFailedError, + FailedDependencyError, + ForbiddenError, + MethodNotAllowedError, + NotFoundError, + NotImplementedError, + UnauthorizedError, + UnprocessableEntityError, + ) + from . import ( + application_versions, + applications, + artifact_versions, + artifacts, + clusters, + data_directories, + environments, + internal, + jobs, + logs, + ml_repos, + model_versions, + models, + personal_access_tokens, + prompt_versions, + prompts, + secret_groups, + secrets, + teams, + traces, + users, + virtual_accounts, + workspaces, + ) + from .applications import ( + ApplicationsCancelDeploymentResponse, + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, + ) + from .artifact_versions import StageArtifactRequestManifest + from .client import AsyncTrueFoundry, TrueFoundry + from .clusters import ClustersDeleteResponse + from .jobs import TriggerJobRequestInput + from .teams import ApplyTeamRequestManifest, TeamsListRequestType + from .version import __version__ + from .workspaces import WorkspacesDeleteResponse +_dynamic_imports: typing.Dict[str, str] = { + "ActivateUserResponse": ".types", + "AddOnComponentSource": ".types", + "AddonComponent": ".types", + "AddonComponentName": ".types", + "AddonComponentStatus": ".types", + "Ai21Integrations": ".types", + "Ai21KeyAuth": ".types", + "Ai21Model": ".types", + "Ai21ProviderAccount": ".types", + "AiFeaturesSettings": ".types", + "Alert": ".types", + "AlertConfig": ".types", + "AlertConfigResource": ".types", + "AlertConfigResourceType": ".types", + "AlertSeverity": ".types", + "AmqpInputConfig": ".types", + "AmqpMetricConfig": ".types", + "AmqpOutputConfig": ".types", + "AnthropicIntegrations": ".types", + "AnthropicKeyAuth": ".types", + "AnthropicModel": ".types", + "AnthropicProviderAccount": ".types", + "Application": ".types", + "ApplicationDebugInfo": ".types", + "ApplicationLifecycleStage": ".types", + "ApplicationMetadata": ".types", + "ApplicationProblem": ".types", + "ApplicationSet": ".types", + "ApplicationSetComponentsItem": ".types", + "ApplicationType": ".types", + "ApplicationsCancelDeploymentResponse": ".applications", + "ApplicationsListRequestDeviceTypeFilter": ".applications", + "ApplicationsListRequestLifecycleStage": ".applications", + "ApplyMlEntityResponse": ".types", + "ApplyMlEntityResponseData": ".types", + "ApplyTeamRequestManifest": ".teams", + "Artifact": ".types", + "ArtifactManifest": ".types", + "ArtifactManifestSource": ".types", + "ArtifactPath": ".types", + "ArtifactType": ".types", + "ArtifactVersion": ".types", + "ArtifactsCacheVolume": ".types", + "ArtifactsDownload": ".types", + "ArtifactsDownloadArtifactsItem": ".types", + "AssistantMessage": ".types", + "AssistantMessageContent": ".types", + "AssistantMessageContentItem": ".types", + "AsyncProcessorSidecar": ".types", + "AsyncService": ".types", + "AsyncServiceAutoscaling": ".types", + "AsyncServiceAutoscalingMetrics": ".types", + "AsyncServiceReplicas": ".types", + "AsyncTrueFoundry": ".client", + "AutoRotate": ".types", + "Autoshutdown": ".types", + "AwsAccessKeyAuth": ".types", + "AwsAccessKeyBasedAuth": ".types", + "AwsAssumedRoleBasedAuth": ".types", + "AwsBedrockGuardrailConfig": ".types", + "AwsBedrockGuardrailConfigAuthData": ".types", + "AwsBedrockGuardrailConfigOperation": ".types", + "AwsBedrockProviderAccount": ".types", + "AwsBedrockProviderAccountAuthData": ".types", + "AwsEcr": ".types", + "AwsEcrAuthData": ".types", + "AwsEksIntegration": ".types", + "AwsEksIntegrationAuthData": ".types", + "AwsInferentia": ".types", + "AwsIntegrations": ".types", + "AwsParameterStore": ".types", + "AwsParameterStoreAuthData": ".types", + "AwsProviderAccount": ".types", + "AwsProviderAccountAuthData": ".types", + "AwsRegion": ".types", + "AwsS3": ".types", + "AwsS3AuthData": ".types", + "AwsSagemakerProviderAccount": ".types", + "AwsSagemakerProviderAccountAuthData": ".types", + "AwsSecretsManager": ".types", + "AwsSecretsManagerAuthData": ".types", + "AzureAiInferenceModel": ".types", + "AzureAiInferenceModelDeploymentDetails": ".types", + "AzureAiManagedDeployment": ".types", + "AzureAiServerlessDeployment": ".types", + "AzureAksIntegration": ".types", + "AzureBasicAuth": ".types", + "AzureBlobStorage": ".types", + "AzureConnectionStringAuth": ".types", + "AzureContainerRegistry": ".types", + "AzureContentSafetyCategory": ".types", + "AzureContentSafetyGuardrailConfig": ".types", + "AzureFoundryModel": ".types", + "AzureFoundryModelV2": ".types", + "AzureFoundryProviderAccount": ".types", + "AzureIntegrations": ".types", + "AzureKeyAuth": ".types", + "AzureOAuth": ".types", + "AzureOpenAiModel": ".types", + "AzureOpenAiModelV2": ".types", + "AzureOpenAiProviderAccount": ".types", + "AzurePiiCategory": ".types", + "AzurePiiGuardrailConfig": ".types", + "AzurePiiGuardrailConfigDomain": ".types", + "AzureProviderAccount": ".types", + "AzureReposIntegration": ".types", + "AzureVault": ".types", + "BadRequestError": ".errors", + "BaseArtifactVersion": ".types", + "BaseArtifactVersionManifest": ".types", + "BaseAutoscaling": ".types", + "BaseOAuth2Login": ".types", + "BaseOAuth2LoginJwtSource": ".types", + "BaseService": ".types", + "BaseServiceImage": ".types", + "BaseServiceMountsItem": ".types", + "BaseWorkbenchInput": ".types", + "BaseWorkbenchInputMountsItem": ".types", + "BasicAuthCreds": ".types", + "BedrockKeyAuth": ".types", + "BedrockModel": ".types", + "BedrockModelAuthData": ".types", + "BedrockModelV2": ".types", + "BitbucketIntegration": ".types", + "BitbucketProviderAccount": ".types", + "BlobStorageReference": ".types", + "BlueGreen": ".types", + "BudgetConfig": ".types", + "BudgetLimitUnit": ".types", + "BudgetRule": ".types", + "BudgetWhen": ".types", + "Build": ".types", + "BuildBuildSource": ".types", + "BuildBuildSpec": ".types", + "BuildInfo": ".types", + "BuildStatus": ".types", + "Canary": ".types", + "CanaryStep": ".types", + "CerebrasIntegrations": ".types", + "CerebrasKeyAuth": ".types", + "CerebrasModel": ".types", + "CerebrasProviderAccount": ".types", + "ChangePasswordResponse": ".types", + "ChatPromptManifest": ".types", + "ChatPromptManifestMcpServersItem": ".types", + "ChatPromptManifestMessagesItem": ".types", + "ChatPromptManifestResponseFormat": ".types", + "ChatPromptManifestRoutingConfig": ".types", + "Cluster": ".types", + "ClusterGateway": ".types", + "ClusterManifest": ".types", + "ClusterManifestClusterType": ".types", + "ClusterManifestMonitoring": ".types", + "ClusterManifestNodeLabelKeys": ".types", + "ClusterManifestWorkbenchConfig": ".types", + "ClusterType": ".types", + "ClustersDeleteResponse": ".clusters", + "Codeserver": ".types", + "CohereIntegrations": ".types", + "CohereKeyAuth": ".types", + "CohereModel": ".types", + "CohereProviderAccount": ".types", + "Collaborator": ".types", + "CommonToolsSettings": ".types", + "Config": ".types", + "ConflictError": ".errors", + "ContainerTaskConfig": ".types", + "ContainerTaskConfigImage": ".types", + "ContainerTaskConfigMountsItem": ".types", + "CoreNatsOutputConfig": ".types", + "CpuUtilizationMetric": ".types", + "CreateMultiPartUploadRequest": ".types", + "CreatePersonalAccessTokenResponse": ".types", + "CronMetric": ".types", + "CustomBasicAuth": ".types", + "CustomBearerAuth": ".types", + "CustomBlobStorage": ".types", + "CustomGuardrailConfig": ".types", + "CustomGuardrailConfigAuthData": ".types", + "CustomGuardrailConfigOperation": ".types", + "CustomGuardrailConfigTarget": ".types", + "CustomHelmRepo": ".types", + "CustomIntegrations": ".types", + "CustomJwtAuthIntegration": ".types", + "CustomModel": ".types", + "CustomModelAuthData": ".types", + "CustomModelModelServer": ".types", + "CustomProviderAccount": ".types", + "CustomTlsSettings": ".types", + "CustomUsernamePasswordArtifactsRegistry": ".types", + "DataDirectory": ".types", + "DataDirectoryManifest": ".types", + "DataDirectoryManifestSource": ".types", + "DatabricksApiKeyAuth": ".types", + "DatabricksIntegrations": ".types", + "DatabricksModel": ".types", + "DatabricksProviderAccount": ".types", + "DatabricksProviderAccountAuthData": ".types", + "DatabricksServicePrincipalAuth": ".types", + "DeactivateUserResponse": ".types", + "DeepinfraIntegrations": ".types", + "DeepinfraKeyAuth": ".types", + "DeepinfraModel": ".types", + "DeepinfraProviderAccount": ".types", + "DeleteApplicationResponse": ".types", + "DeleteJobRunResponse": ".types", + "DeletePersonalAccessTokenResponse": ".types", + "DeleteSecretGroupResponse": ".types", + "DeleteTeamResponse": ".types", + "DeleteUserResponse": ".types", + "DeleteVirtualAccountResponse": ".types", + "Deployment": ".types", + "DeploymentBuild": ".types", + "DeploymentManifest": ".types", + "DeploymentStatus": ".types", + "DeploymentStatusValue": ".types", + "DeploymentTransition": ".types", + "DeveloperMessage": ".types", + "DeveloperMessageContent": ".types", + "DockerFileBuild": ".types", + "DockerFileBuildCommand": ".types", + "DockerhubBasicAuth": ".types", + "DockerhubIntegrations": ".types", + "DockerhubProviderAccount": ".types", + "DockerhubRegistry": ".types", + "DynamicVolumeConfig": ".types", + "Email": ".types", + "EmailNotificationChannel": ".types", + "EmptyResponse": ".types", + "Endpoint": ".types", + "EnkryptAiGuardrailConfig": ".types", + "EnkryptAiGuardrailConfigOperation": ".types", + "EnkryptAiKeyAuth": ".types", + "Environment": ".types", + "EnvironmentColor": ".types", + "EnvironmentManifest": ".types", + "EnvironmentOptimizeFor": ".types", + "ExpectationFailedError": ".errors", + "ExternalBlobStorageSource": ".types", + "FailedDependencyError": ".errors", + "FallbackConfig": ".types", + "FallbackModel": ".types", + "FallbackRule": ".types", + "FallbackWhen": ".types", + "FastAiFramework": ".types", + "FiddlerGuardType": ".types", + "FiddlerGuardrailConfig": ".types", + "FiddlerKeyAuth": ".types", + "FileInfo": ".types", + "FlyteLaunchPlan": ".types", + "FlyteLaunchPlanId": ".types", + "FlyteLaunchPlanSpec": ".types", + "FlyteTask": ".types", + "FlyteTaskCustom": ".types", + "FlyteTaskCustomTruefoundry": ".types", + "FlyteTaskId": ".types", + "FlyteTaskTemplate": ".types", + "FlyteWorkflow": ".types", + "FlyteWorkflowId": ".types", + "FlyteWorkflowTemplate": ".types", + "ForbiddenError": ".errors", + "ForwardAction": ".types", + "Function": ".types", + "FunctionSchema": ".types", + "GatewayConfig": ".types", + "GatewayConfiguration": ".types", + "GcpApiKeyAuth": ".types", + "GcpGcr": ".types", + "GcpGcs": ".types", + "GcpGkeIntegration": ".types", + "GcpGsm": ".types", + "GcpIntegrations": ".types", + "GcpKeyFileAuth": ".types", + "GcpProviderAccount": ".types", + "GcpProviderAccountAuthData": ".types", + "GcpRegion": ".types", + "GcpTpu": ".types", + "GeminiModelV2": ".types", + "GetApplicationDeploymentResponse": ".types", + "GetApplicationResponse": ".types", + "GetArtifactResponse": ".types", + "GetArtifactVersionResponse": ".types", + "GetAuthenticatedVcsurlResponse": ".types", + "GetAutoProvisioningStateResponse": ".types", + "GetChartsResponse": ".types", + "GetClusterResponse": ".types", + "GetDataDirectoryResponse": ".types", + "GetEnvironmentResponse": ".types", + "GetJobRunResponse": ".types", + "GetLogsResponse": ".types", + "GetMlRepoResponse": ".types", + "GetModelResponse": ".types", + "GetModelVersionResponse": ".types", + "GetOrCreatePersonalAccessTokenResponse": ".types", + "GetPromptResponse": ".types", + "GetPromptVersionResponse": ".types", + "GetSecretGroupResponse": ".types", + "GetSecretResponse": ".types", + "GetSignedUrLsRequest": ".types", + "GetSignedUrLsResponse": ".types", + "GetSuggestedDeploymentEndpointResponse": ".types", + "GetTeamResponse": ".types", + "GetTokenForVirtualAccountResponse": ".types", + "GetUserResourcesResponse": ".types", + "GetUserResponse": ".types", + "GetUserTeamsResponse": ".types", + "GetVirtualAccountResponse": ".types", + "GetWorkspaceResponse": ".types", + "GitHelmRepo": ".types", + "GitRepositoryExistsResponse": ".types", + "GitSource": ".types", + "GithubIntegration": ".types", + "GithubProviderAccount": ".types", + "GitlabIntegration": ".types", + "GitlabProviderAccount": ".types", + "GluonFramework": ".types", + "GoogleGeminiProviderAccount": ".types", + "GoogleModel": ".types", + "GoogleVertexProviderAccount": ".types", + "Graph": ".types", + "GraphChartType": ".types", + "GroqIntegrations": ".types", + "GroqKeyAuth": ".types", + "GroqModel": ".types", + "GroqProviderAccount": ".types", + "GuardrailConfigGroup": ".types", + "GuardrailConfigIntegrations": ".types", + "Guardrails": ".types", + "GuardrailsConfig": ".types", + "GuardrailsRule": ".types", + "GuardrailsWhen": ".types", + "H2OFramework": ".types", + "HeaderMatch": ".types", + "HealthProbe": ".types", + "Helm": ".types", + "HelmRepo": ".types", + "HelmSource": ".types", + "HttpError": ".types", + "HttpErrorCode": ".types", + "HttpProbe": ".types", + "HttpValidationError": ".types", + "HuggingfaceArtifactSource": ".types", + "IChange": ".types", + "IChangeOperation": ".types", + "Image": ".types", + "ImageCommand": ".types", + "ImageContentPart": ".types", + "ImageUrl": ".types", + "ImageUrlUrl": ".types", + "InferMethodName": ".types", + "InfraProviderAccount": ".types", + "IngressControllerConfig": ".types", + "InputOutputBasedCostMetricValue": ".types", + "Intercept": ".types", + "InterceptRulesItem": ".types", + "InterceptRulesItemAction": ".types", + "InternalArtifactVersion": ".types", + "InternalListArtifactVersionsResponse": ".types", + "InternalListArtifactVersionsResponseDataItem": ".types", + "InternalModelVersion": ".types", + "InviteUserResponse": ".types", + "IsClusterConnectedResponse": ".types", + "JFrogIntegrations": ".types", + "JfrogArtifactsRegistry": ".types", + "JfrogBasicAuth": ".types", + "JfrogProviderAccount": ".types", + "Job": ".types", + "JobAlert": ".types", + "JobImage": ".types", + "JobMountsItem": ".types", + "JobRun": ".types", + "JobRunStatus": ".types", + "JobRunsSortBy": ".types", + "JobTrigger": ".types", + "JobTriggerInput": ".types", + "JobTriggerInputCommand": ".types", + "JsonObjectResponseFormat": ".types", + "JsonSchema": ".types", + "JsonSchemaResponseFormat": ".types", + "Jwt": ".types", + "JwtAuthConfig": ".types", + "JwtAuthConfigClaimsItem": ".types", + "KafkaInputConfig": ".types", + "KafkaMetricConfig": ".types", + "KafkaOutputConfig": ".types", + "KafkaSaslAuth": ".types", + "KerasFramework": ".types", + "Kustomize": ".types", + "LatencyBasedLoadBalanceTarget": ".types", + "LatencyBasedLoadBalancing": ".types", + "LatencyBasedLoadBalancingRule": ".types", + "LibraryName": ".types", + "LightGbmFramework": ".types", + "ListApplicationDeploymentsResponse": ".types", + "ListApplicationsResponse": ".types", + "ListArtifactVersionsResponse": ".types", + "ListArtifactsResponse": ".types", + "ListClusterAddonsResponse": ".types", + "ListClustersResponse": ".types", + "ListDataDirectoriesResponse": ".types", + "ListEnvironmentsResponse": ".types", + "ListFilesRequest": ".types", + "ListFilesResponse": ".types", + "ListJobRunResponse": ".types", + "ListMlReposResponse": ".types", + "ListModelVersionsResponse": ".types", + "ListModelsResponse": ".types", + "ListPersonalAccessTokenResponse": ".types", + "ListPromptVersionsResponse": ".types", + "ListPromptsResponse": ".types", + "ListSecretGroupResponse": ".types", + "ListSecretsResponse": ".types", + "ListTeamsResponse": ".types", + "ListUsersResponse": ".types", + "ListVirtualAccountResponse": ".types", + "ListWorkspacesResponse": ".types", + "LoadBalanceTarget": ".types", + "LoadBalancingConfig": ".types", + "LoadBalancingRule": ".types", + "LoadBalancingWhen": ".types", + "LocalArtifactSource": ".types", + "LocalModelSource": ".types", + "LocalSource": ".types", + "Log": ".types", + "LogsSearchFilterType": ".types", + "LogsSearchOperatorType": ".types", + "LogsSortingDirection": ".types", + "Manual": ".types", + "McpServerAuth": ".types", + "McpServerHeaderAuth": ".types", + "McpServerHeaderOverrideAuth": ".types", + "McpServerIntegration": ".types", + "McpServerIntegrations": ".types", + "McpServerOAuth2": ".types", + "McpServerOAuth2Dcr": ".types", + "McpServerOAuth2JwtSource": ".types", + "McpServerPassthrough": ".types", + "McpServerProviderAccount": ".types", + "McpServerToolDetails": ".types", + "McpServerWithFqn": ".types", + "McpServerWithUrl": ".types", + "McpTool": ".types", + "Metadata": ".types", + "MethodNotAllowedError": ".errors", + "Metric": ".types", + "MimeType": ".types", + "MirrorAction": ".types", + "MistralAiIntegrations": ".types", + "MistralAiKeyAuth": ".types", + "MistralAiModel": ".types", + "MistralAiProviderAccount": ".types", + "MlRepo": ".types", + "MlRepoManifest": ".types", + "Model": ".types", + "ModelConfiguration": ".types", + "ModelCostMetric": ".types", + "ModelManifest": ".types", + "ModelManifestFramework": ".types", + "ModelManifestSource": ".types", + "ModelProviderAccount": ".types", + "ModelType": ".types", + "ModelVersion": ".types", + "ModelVersionEnvironment": ".types", + "MultiPartUpload": ".types", + "MultiPartUploadResponse": ".types", + "MultiPartUploadStorageProvider": ".types", + "NatsInputConfig": ".types", + "NatsMetricConfig": ".types", + "NatsOutputConfig": ".types", + "NatsUserPasswordAuth": ".types", + "NodeSelector": ".types", + "NodeSelectorCapacityType": ".types", + "Nodepool": ".types", + "NodepoolSelector": ".types", + "NomicIntegrations": ".types", + "NomicKeyAuth": ".types", + "NomicModel": ".types", + "NomicProviderAccount": ".types", + "NotFoundError": ".errors", + "NotImplementedError": ".errors", + "Notebook": ".types", + "NotebookConfig": ".types", + "NotificationTarget": ".types", + "NotificationTargetForAlertRule": ".types", + "NvidiaGpu": ".types", + "NvidiaMiggpu": ".types", + "NvidiaMiggpuProfile": ".types", + "NvidiaTimeslicingGpu": ".types", + "OAuth2LoginProvider": ".types", + "OciRepo": ".types", + "OllamaIntegrations": ".types", + "OllamaKeyAuth": ".types", + "OllamaModel": ".types", + "OllamaProviderAccount": ".types", + "OnnxFramework": ".types", + "OpenAiIntegrations": ".types", + "OpenAiModel": ".types", + "OpenAiModerationsGuardrailConfig": ".types", + "OpenAiModerationsGuardrailConfigCategoryThresholdsValue": ".types", + "OpenAiModerationsGuardrailConfigCategoryThresholdsValueHarassment": ".types", + "OpenRouterApiKeyAuth": ".types", + "OpenRouterIntegrations": ".types", + "OpenRouterModel": ".types", + "OpenRouterProviderAccount": ".types", + "OpenaiApiKeyAuth": ".types", + "OpenaiProviderAccount": ".types", + "Operation": ".types", + "PaddleFramework": ".types", + "PagerDuty": ".types", + "PagerDutyIntegration": ".types", + "PagerDutyIntegrationKeyAuth": ".types", + "PagerDutyIntegrations": ".types", + "PagerDutyProviderAccount": ".types", + "Pagination": ".types", + "PalmIntegrations": ".types", + "PalmKeyAuth": ".types", + "PalmModel": ".types", + "PalmProviderAccount": ".types", + "PaloAltoPrismaAirsGuardrailConfig": ".types", + "PaloAltoPrismaAirsGuardrailConfigMode": ".types", + "PaloAltoPrismaAirsKeyAuth": ".types", + "PangeaGuardType": ".types", + "PangeaGuardrailConfig": ".types", + "PangeaKeyAuth": ".types", + "Param": ".types", + "ParamParamType": ".types", + "Parameters": ".types", + "ParametersStop": ".types", + "PatronusAnswerRelevanceCriteria": ".types", + "PatronusAnswerRelevanceEvaluator": ".types", + "PatronusEvaluator": ".types", + "PatronusGliderCriteria": ".types", + "PatronusGliderEvaluator": ".types", + "PatronusGuardrailConfig": ".types", + "PatronusGuardrailConfigTarget": ".types", + "PatronusJudgeCriteria": ".types", + "PatronusJudgeEvaluator": ".types", + "PatronusKeyAuth": ".types", + "PatronusPhiCriteria": ".types", + "PatronusPhiEvaluator": ".types", + "PatronusPiiCriteria": ".types", + "PatronusPiiEvaluator": ".types", + "PatronusToxicityCriteria": ".types", + "PatronusToxicityEvaluator": ".types", + "PerThousandEmbeddingTokensCostMetric": ".types", + "PerThousandTokensCostMetric": ".types", + "Permissions": ".types", + "PerplexityAiKeyAuth": ".types", + "PerplexityAiModel": ".types", + "PerplexityAiProviderAccount": ".types", + "PerplexityIntegrations": ".types", + "PersonalAccessTokenManifest": ".types", + "Pip": ".types", + "Poetry": ".types", + "PolicyActions": ".types", + "PolicyEntityTypes": ".types", + "PolicyFilters": ".types", + "PolicyManifest": ".types", + "PolicyManifestMode": ".types", + "PolicyManifestOperation": ".types", + "PolicyMutationOperation": ".types", + "PolicyValidationOperation": ".types", + "Port": ".types", + "PortAppProtocol": ".types", + "PortAuth": ".types", + "PortProtocol": ".types", + "PresignedUrlObject": ".types", + "PriorityBasedLoadBalanceTarget": ".types", + "PriorityBasedLoadBalancing": ".types", + "PriorityBasedLoadBalancingRule": ".types", + "PrometheusAlertRule": ".types", + "Prompt": ".types", + "PromptFooGuardType": ".types", + "PromptFooGuardrailConfig": ".types", + "PromptVersion": ".types", + "ProviderAccounts": ".types", + "PublicCostMetric": ".types", + "PySparkTaskConfig": ".types", + "PyTorchFramework": ".types", + "PythonBuild": ".types", + "PythonBuildCommand": ".types", + "PythonBuildPythonDependencies": ".types", + "PythonTaskConfig": ".types", + "PythonTaskConfigImage": ".types", + "PythonTaskConfigMountsItem": ".types", + "QuayArtifactsRegistry": ".types", + "QuayBasicAuth": ".types", + "QuayIntegrations": ".types", + "QuayProviderAccount": ".types", + "QuerySpansResponse": ".types", + "RStudio": ".types", + "RateLimitConfig": ".types", + "RateLimitRule": ".types", + "RateLimitUnit": ".types", + "RateLimitWhen": ".types", + "Recommendation": ".types", + "RefusalContentPart": ".types", + "RegisterUsersResponse": ".types", + "RemoteSource": ".types", + "Resources": ".types", + "ResourcesDevicesItem": ".types", + "ResourcesNode": ".types", + "RetryConfig": ".types", + "RevokeAllPersonalAccessTokenResponse": ".types", + "Rolling": ".types", + "RpsMetric": ".types", + "SagemakerModel": ".types", + "SambaNovaIntegrations": ".types", + "SambaNovaKeyAuth": ".types", + "SambaNovaModel": ".types", + "SambaNovaProviderAccount": ".types", + "Schedule": ".types", + "ScheduleConcurrencyPolicy": ".types", + "Secret": ".types", + "SecretGroup": ".types", + "SecretInput": ".types", + "SecretMount": ".types", + "SecretVersion": ".types", + "SelfHostedModel": ".types", + "SelfHostedModelAuthData": ".types", + "SelfHostedModelIntegrations": ".types", + "SelfHostedModelModelServer": ".types", + "SelfHostedModelProviderAccount": ".types", + "Service": ".types", + "ServiceAutoscaling": ".types", + "ServiceAutoscalingMetrics": ".types", + "ServiceReplicas": ".types", + "ServiceRolloutStrategy": ".types", + "Session": ".types", + "SignedUrl": ".types", + "SklearnFramework": ".types", + "SklearnModelSchema": ".types", + "SklearnSerializationFormat": ".types", + "SlackBot": ".types", + "SlackBotAuth": ".types", + "SlackBotIntegration": ".types", + "SlackIntegrations": ".types", + "SlackProviderAccount": ".types", + "SlackWebhook": ".types", + "SlackWebhookAuth": ".types", + "SlackWebhookIntegration": ".types", + "SmtpCredentials": ".types", + "SortDirection": ".types", + "SpaCyFramework": ".types", + "SparkBuild": ".types", + "SparkConfig": ".types", + "SparkDriverConfig": ".types", + "SparkExecutorConfig": ".types", + "SparkExecutorConfigInstances": ".types", + "SparkExecutorDynamicScaling": ".types", + "SparkExecutorFixedInstances": ".types", + "SparkImage": ".types", + "SparkImageBuild": ".types", + "SparkImageBuildBuildSource": ".types", + "SparkJob": ".types", + "SparkJobEntrypoint": ".types", + "SparkJobImage": ".types", + "SparkJobJavaEntrypoint": ".types", + "SparkJobPythonEntrypoint": ".types", + "SparkJobPythonNotebookEntrypoint": ".types", + "SparkJobScalaEntrypoint": ".types", + "SparkJobScalaNotebookEntrypoint": ".types", + "SparkJobTriggerInput": ".types", + "SqsInputConfig": ".types", + "SqsOutputConfig": ".types", + "SqsQueueMetricConfig": ".types", + "SshServer": ".types", + "SshServerConfig": ".types", + "SsoTeamManifest": ".types", + "StageArtifactRequestManifest": ".artifact_versions", + "StageArtifactResponse": ".types", + "StaticVolumeConfig": ".types", + "StatsModelsFramework": ".types", + "StringDataMount": ".types", + "Subject": ".types", + "SubjectType": ".types", + "SystemMessage": ".types", + "SystemMessageContent": ".types", + "TaskDockerFileBuild": ".types", + "TaskPySparkBuild": ".types", + "TaskPythonBuild": ".types", + "Team": ".types", + "TeamManifest": ".types", + "TeamsListRequestType": ".teams", + "TensorFlowFramework": ".types", + "TerminateJobResponse": ".types", + "TextContentPart": ".types", + "TextContentPartText": ".types", + "TogetherAiIntegrations": ".types", + "TogetherAiKeyAuth": ".types", + "TogetherAiModel": ".types", + "TogetherAiProviderAccount": ".types", + "TokenPagination": ".types", + "ToolCall": ".types", + "ToolMessage": ".types", + "ToolMessageContent": ".types", + "ToolSchema": ".types", + "TraceSpan": ".types", + "TracesSubjectType": ".types", + "TracingProject": ".types", + "TracingProjectManifest": ".types", + "TransformersFramework": ".types", + "TriggerJobRequestInput": ".jobs", + "TriggerJobRunResponse": ".types", + "TrueFoundry": ".client", + "TrueFoundryApplyRequestManifest": ".types", + "TrueFoundryApplyResponse": ".types", + "TrueFoundryApplyResponseAction": ".types", + "TrueFoundryApplyResponseExistingManifest": ".types", + "TrueFoundryArtifactSource": ".types", + "TrueFoundryDbssm": ".types", + "TrueFoundryDeleteRequestManifest": ".types", + "TrueFoundryIntegrations": ".types", + "TrueFoundryInteractiveLogin": ".types", + "TrueFoundryManagedSource": ".types", + "TrueFoundryProviderAccount": ".types", + "TtlIntegrations": ".types", + "TtlProviderAccount": ".types", + "TtlRegistry": ".types", + "UnauthorizedError": ".errors", + "UnprocessableEntityError": ".errors", + "UpdateSecretInput": ".types", + "UpdateUserRolesResponse": ".types", + "UpgradeData": ".types", + "UsageCodeSnippet": ".types", + "User": ".types", + "UserMessage": ".types", + "UserMessageContent": ".types", + "UserMessageContentItem": ".types", + "UserMetadata": ".types", + "UserMetadataTenantRoleManagedBy": ".types", + "UserResource": ".types", + "Uv": ".types", + "ValidationError": ".types", + "ValidationErrorLocItem": ".types", + "VertexModel": ".types", + "VertexModelV2": ".types", + "VirtualAccount": ".types", + "VirtualAccountManifest": ".types", + "VirtualMcpServerIntegration": ".types", + "VirtualMcpServerSource": ".types", + "Volume": ".types", + "VolumeBrowser": ".types", + "VolumeConfig": ".types", + "VolumeMount": ".types", + "WebhookBasicAuth": ".types", + "WebhookBearerAuth": ".types", + "WebhookIntegration": ".types", + "WebhookIntegrationAuthData": ".types", + "WebhookIntegrations": ".types", + "WebhookProviderAccount": ".types", + "WeightBasedLoadBalancing": ".types", + "WeightBasedLoadBalancingRule": ".types", + "WorkbenchImage": ".types", + "WorkerConfig": ".types", + "WorkerConfigInputConfig": ".types", + "WorkerConfigOutputConfig": ".types", + "Workflow": ".types", + "WorkflowAlert": ".types", + "WorkflowFlyteEntitiesItem": ".types", + "WorkflowSource": ".types", + "Workspace": ".types", + "WorkspaceManifest": ".types", + "WorkspacesDeleteResponse": ".workspaces", + "XgBoostFramework": ".types", + "XgBoostModelSchema": ".types", + "XgBoostSerializationFormat": ".types", + "__version__": ".version", + "application_versions": ".application_versions", + "applications": ".applications", + "artifact_versions": ".artifact_versions", + "artifacts": ".artifacts", + "clusters": ".clusters", + "data_directories": ".data_directories", + "environments": ".environments", + "internal": ".internal", + "jobs": ".jobs", + "logs": ".logs", + "ml_repos": ".ml_repos", + "model_versions": ".model_versions", + "models": ".models", + "personal_access_tokens": ".personal_access_tokens", + "prompt_versions": ".prompt_versions", + "prompts": ".prompts", + "secret_groups": ".secret_groups", + "secrets": ".secrets", + "teams": ".teams", + "traces": ".traces", + "users": ".users", + "virtual_accounts": ".virtual_accounts", + "workspaces": ".workspaces", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ActivateUserResponse", @@ -849,7 +1635,6 @@ "AlertConfigResource", "AlertConfigResourceType", "AlertSeverity", - "AlertStatus", "AmqpInputConfig", "AmqpMetricConfig", "AmqpOutputConfig", @@ -1060,9 +1845,6 @@ "DockerhubIntegrations", "DockerhubProviderAccount", "DockerhubRegistry", - "DurationFilter", - "DurationFilterOperation", - "DurationFilterValue", "DynamicVolumeConfig", "Email", "EmailNotificationChannel", @@ -1075,10 +1857,6 @@ "EnvironmentColor", "EnvironmentManifest", "EnvironmentOptimizeFor", - "Event", - "EventChart", - "EventChartCategory", - "EventInvolvedObject", "ExpectationFailedError", "ExternalBlobStorageSource", "FailedDependencyError", @@ -1091,7 +1869,6 @@ "FiddlerGuardrailConfig", "FiddlerKeyAuth", "FileInfo", - "Filter", "FlyteLaunchPlan", "FlyteLaunchPlanId", "FlyteLaunchPlanSpec", @@ -1121,7 +1898,6 @@ "GcpRegion", "GcpTpu", "GeminiModelV2", - "GetAlertsResponse", "GetApplicationDeploymentResponse", "GetApplicationResponse", "GetArtifactResponse", @@ -1132,7 +1908,6 @@ "GetClusterResponse", "GetDataDirectoryResponse", "GetEnvironmentResponse", - "GetEventsResponse", "GetJobRunResponse", "GetLogsResponse", "GetMlRepoResponse", @@ -1147,6 +1922,7 @@ "GetSignedUrLsResponse", "GetSuggestedDeploymentEndpointResponse", "GetTeamResponse", + "GetTokenForVirtualAccountResponse", "GetUserResourcesResponse", "GetUserResponse", "GetUserTeamsResponse", @@ -1171,22 +1947,12 @@ "GroqProviderAccount", "GuardrailConfigGroup", "GuardrailConfigIntegrations", - "GuardrailMetersRequestDtoFiltersValue", - "GuardrailMetersResponseDto", - "GuardrailMetricChart", - "GuardrailMetricsChartsDataRequestDtoChartName", - "GuardrailMetricsChartsDataRequestDtoFiltersValue", - "GuardrailMetricsChartsResponseDto", - "GuardrailMetricsFiltersResponseDto", "Guardrails", "GuardrailsConfig", "GuardrailsRule", "GuardrailsWhen", "H2OFramework", - "HeaderLatencyBasedLoadBalancingRule", "HeaderMatch", - "HeaderPriorityBasedLoadBalancingRule", - "HeaderWeightBasedLoadBalancingRule", "HealthProbe", "Helm", "HelmRepo", @@ -1194,9 +1960,6 @@ "HttpError", "HttpErrorCode", "HttpProbe", - "HttpStatusCodeFilter", - "HttpStatusCodeFilterOperation", - "HttpStatusCodeFilterValue", "HttpValidationError", "HuggingfaceArtifactSource", "IChange", @@ -1206,8 +1969,6 @@ "ImageContentPart", "ImageUrl", "ImageUrlUrl", - "InFilter", - "InFilterOperation", "InferMethodName", "InfraProviderAccount", "IngressControllerConfig", @@ -1232,13 +1993,13 @@ "JobRun", "JobRunStatus", "JobRunsSortBy", - "JobRunsSortDirection", "JobTrigger", "JobTriggerInput", "JobTriggerInputCommand", "JsonObjectResponseFormat", "JsonSchema", "JsonSchemaResponseFormat", + "Jwt", "JwtAuthConfig", "JwtAuthConfigClaimsItem", "KafkaInputConfig", @@ -1248,10 +2009,10 @@ "KerasFramework", "Kustomize", "LatencyBasedLoadBalanceTarget", + "LatencyBasedLoadBalancing", "LatencyBasedLoadBalancingRule", "LibraryName", "LightGbmFramework", - "LikeFilter", "ListApplicationDeploymentsResponse", "ListApplicationsResponse", "ListArtifactVersionsResponse", @@ -1287,14 +2048,6 @@ "LogsSearchOperatorType", "LogsSortingDirection", "Manual", - "McpMetersRequestDtoFiltersValue", - "McpMetersRequestDtoPage", - "McpMetersResponseDto", - "McpMetricChart", - "McpMetricsChartsDataRequestDtoChartName", - "McpMetricsChartsDataRequestDtoFiltersValue", - "McpMetricsChartsResponseDto", - "McpMetricsFiltersResponseDto", "McpServerAuth", "McpServerHeaderAuth", "McpServerHeaderOverrideAuth", @@ -1310,7 +2063,6 @@ "McpServerWithUrl", "McpTool", "Metadata", - "MetadataItem", "MethodNotAllowedError", "Metric", "MimeType", @@ -1387,6 +2139,7 @@ "PalmModel", "PalmProviderAccount", "PaloAltoPrismaAirsGuardrailConfig", + "PaloAltoPrismaAirsGuardrailConfigMode", "PaloAltoPrismaAirsKeyAuth", "PangeaGuardType", "PangeaGuardrailConfig", @@ -1435,6 +2188,7 @@ "PortProtocol", "PresignedUrlObject", "PriorityBasedLoadBalanceTarget", + "PriorityBasedLoadBalancing", "PriorityBasedLoadBalancingRule", "PrometheusAlertRule", "Prompt", @@ -1455,6 +2209,7 @@ "QuayBasicAuth", "QuayIntegrations", "QuayProviderAccount", + "QuerySpansResponse", "RStudio", "RateLimitConfig", "RateLimitRule", @@ -1507,6 +2262,7 @@ "SlackWebhookAuth", "SlackWebhookIntegration", "SmtpCredentials", + "SortDirection", "SpaCyFramework", "SparkBuild", "SparkConfig", @@ -1540,8 +2296,6 @@ "StringDataMount", "Subject", "SubjectType", - "SvcMcpMetricsGetMcpMetricsChartsRequestPage", - "SvcMcpMetricsGetMcpMetricsFiltersRequestPage", "SystemMessage", "SystemMessageContent", "TaskDockerFileBuild", @@ -1563,6 +2317,8 @@ "ToolMessage", "ToolMessageContent", "ToolSchema", + "TraceSpan", + "TracesSubjectType", "TracingProject", "TracingProjectManifest", "TransformersFramework", @@ -1615,6 +2371,7 @@ "WebhookIntegrationAuthData", "WebhookIntegrations", "WebhookProviderAccount", + "WeightBasedLoadBalancing", "WeightBasedLoadBalancingRule", "WorkbenchImage", "WorkerConfig", @@ -1631,7 +2388,6 @@ "XgBoostModelSchema", "XgBoostSerializationFormat", "__version__", - "alerts", "application_versions", "applications", "artifact_versions", @@ -1639,10 +2395,8 @@ "clusters", "data_directories", "environments", - "events", "internal", "jobs", - "llm_gateway", "logs", "ml_repos", "model_versions", @@ -1653,6 +2407,7 @@ "secret_groups", "secrets", "teams", + "traces", "users", "virtual_accounts", "workspaces", diff --git a/src/truefoundry_sdk/alerts/client.py b/src/truefoundry_sdk/alerts/client.py deleted file mode 100644 index 8d311d30..00000000 --- a/src/truefoundry_sdk/alerts/client.py +++ /dev/null @@ -1,165 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.alert_status import AlertStatus -from ..types.get_alerts_response import GetAlertsResponse -from .raw_client import AsyncRawAlertsClient, RawAlertsClient - - -class AlertsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawAlertsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawAlertsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawAlertsClient - """ - return self._raw_client - - def list( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - cluster_id: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - alert_status: typing.Optional[AlertStatus] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetAlertsResponse: - """ - Get alerts for a given application or cluster filtered by start and end timestamp - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - cluster_id : typing.Optional[str] - Cluster id - - application_id : typing.Optional[str] - Application id - - alert_status : typing.Optional[AlertStatus] - Alert status - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetAlertsResponse - Returns an object with alert name as key and list of alerts as value - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.alerts.list() - """ - _response = self._raw_client.list( - start_ts=start_ts, - end_ts=end_ts, - cluster_id=cluster_id, - application_id=application_id, - alert_status=alert_status, - request_options=request_options, - ) - return _response.data - - -class AsyncAlertsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawAlertsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawAlertsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawAlertsClient - """ - return self._raw_client - - async def list( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - cluster_id: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - alert_status: typing.Optional[AlertStatus] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetAlertsResponse: - """ - Get alerts for a given application or cluster filtered by start and end timestamp - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - cluster_id : typing.Optional[str] - Cluster id - - application_id : typing.Optional[str] - Application id - - alert_status : typing.Optional[AlertStatus] - Alert status - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetAlertsResponse - Returns an object with alert name as key and list of alerts as value - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.alerts.list() - - - asyncio.run(main()) - """ - _response = await self._raw_client.list( - start_ts=start_ts, - end_ts=end_ts, - cluster_id=cluster_id, - application_id=application_id, - alert_status=alert_status, - request_options=request_options, - ) - return _response.data diff --git a/src/truefoundry_sdk/alerts/raw_client.py b/src/truefoundry_sdk/alerts/raw_client.py deleted file mode 100644 index f55a771b..00000000 --- a/src/truefoundry_sdk/alerts/raw_client.py +++ /dev/null @@ -1,199 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from ..errors.bad_request_error import BadRequestError -from ..errors.forbidden_error import ForbiddenError -from ..types.alert_status import AlertStatus -from ..types.get_alerts_response import GetAlertsResponse -from ..types.http_error import HttpError - - -class RawAlertsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def list( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - cluster_id: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - alert_status: typing.Optional[AlertStatus] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[GetAlertsResponse]: - """ - Get alerts for a given application or cluster filtered by start and end timestamp - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - cluster_id : typing.Optional[str] - Cluster id - - application_id : typing.Optional[str] - Application id - - alert_status : typing.Optional[AlertStatus] - Alert status - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[GetAlertsResponse] - Returns an object with alert name as key and list of alerts as value - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/alerts", - method="GET", - params={ - "startTs": start_ts, - "endTs": end_ts, - "clusterId": cluster_id, - "applicationId": application_id, - "alertStatus": alert_status, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GetAlertsResponse, - parse_obj_as( - type_=GetAlertsResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[typing.Any], # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - HttpError, - parse_obj_as( - type_=HttpError, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawAlertsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def list( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - cluster_id: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - alert_status: typing.Optional[AlertStatus] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[GetAlertsResponse]: - """ - Get alerts for a given application or cluster filtered by start and end timestamp - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - cluster_id : typing.Optional[str] - Cluster id - - application_id : typing.Optional[str] - Application id - - alert_status : typing.Optional[AlertStatus] - Alert status - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[GetAlertsResponse] - Returns an object with alert name as key and list of alerts as value - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/alerts", - method="GET", - params={ - "startTs": start_ts, - "endTs": end_ts, - "clusterId": cluster_id, - "applicationId": application_id, - "alertStatus": alert_status, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GetAlertsResponse, - parse_obj_as( - type_=GetAlertsResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[typing.Any], # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - HttpError, - parse_obj_as( - type_=HttpError, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/truefoundry_sdk/applications/__init__.py b/src/truefoundry_sdk/applications/__init__.py index 9b7dbd21..892fbccd 100644 --- a/src/truefoundry_sdk/applications/__init__.py +++ b/src/truefoundry_sdk/applications/__init__.py @@ -2,11 +2,42 @@ # isort: skip_file -from .types import ( - ApplicationsCancelDeploymentResponse, - ApplicationsListRequestDeviceTypeFilter, - ApplicationsListRequestLifecycleStage, -) +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + ApplicationsCancelDeploymentResponse, + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, + ) +_dynamic_imports: typing.Dict[str, str] = { + "ApplicationsCancelDeploymentResponse": ".types", + "ApplicationsListRequestDeviceTypeFilter": ".types", + "ApplicationsListRequestLifecycleStage": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ApplicationsCancelDeploymentResponse", diff --git a/src/truefoundry_sdk/applications/client.py b/src/truefoundry_sdk/applications/client.py index 487a033b..3f5cfb8b 100644 --- a/src/truefoundry_sdk/applications/client.py +++ b/src/truefoundry_sdk/applications/client.py @@ -123,6 +123,10 @@ def list( Examples -------- from truefoundry_sdk import TrueFoundry + from truefoundry_sdk.applications import ( + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, + ) client = TrueFoundry( api_key="YOUR_API_KEY", @@ -131,6 +135,21 @@ def list( response = client.applications.list( limit=10, offset=0, + application_id="applicationId", + workspace_id="workspaceId", + application_name="applicationName", + fqn="fqn", + workspace_fqn="workspaceFqn", + application_type="applicationType", + name_search_query="nameSearchQuery", + environment_id="environmentId", + cluster_id="clusterId", + application_set_id="applicationSetId", + paused=True, + device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU, + last_deployed_by_subjects="lastDeployedBySubjects", + lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE, + is_recommendation_present_and_visible=True, ) for item in response: yield item @@ -509,6 +528,10 @@ async def list( import asyncio from truefoundry_sdk import AsyncTrueFoundry + from truefoundry_sdk.applications import ( + ApplicationsListRequestDeviceTypeFilter, + ApplicationsListRequestLifecycleStage, + ) client = AsyncTrueFoundry( api_key="YOUR_API_KEY", @@ -520,6 +543,21 @@ async def main() -> None: response = await client.applications.list( limit=10, offset=0, + application_id="applicationId", + workspace_id="workspaceId", + application_name="applicationName", + fqn="fqn", + workspace_fqn="workspaceFqn", + application_type="applicationType", + name_search_query="nameSearchQuery", + environment_id="environmentId", + cluster_id="clusterId", + application_set_id="applicationSetId", + paused=True, + device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU, + last_deployed_by_subjects="lastDeployedBySubjects", + lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE, + is_recommendation_present_and_visible=True, ) async for item in response: yield item diff --git a/src/truefoundry_sdk/applications/types/__init__.py b/src/truefoundry_sdk/applications/types/__init__.py index 77425225..c170b79b 100644 --- a/src/truefoundry_sdk/applications/types/__init__.py +++ b/src/truefoundry_sdk/applications/types/__init__.py @@ -2,9 +2,40 @@ # isort: skip_file -from .applications_cancel_deployment_response import ApplicationsCancelDeploymentResponse -from .applications_list_request_device_type_filter import ApplicationsListRequestDeviceTypeFilter -from .applications_list_request_lifecycle_stage import ApplicationsListRequestLifecycleStage +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .applications_cancel_deployment_response import ApplicationsCancelDeploymentResponse + from .applications_list_request_device_type_filter import ApplicationsListRequestDeviceTypeFilter + from .applications_list_request_lifecycle_stage import ApplicationsListRequestLifecycleStage +_dynamic_imports: typing.Dict[str, str] = { + "ApplicationsCancelDeploymentResponse": ".applications_cancel_deployment_response", + "ApplicationsListRequestDeviceTypeFilter": ".applications_list_request_device_type_filter", + "ApplicationsListRequestLifecycleStage": ".applications_list_request_lifecycle_stage", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ApplicationsCancelDeploymentResponse", diff --git a/src/truefoundry_sdk/artifact_versions/__init__.py b/src/truefoundry_sdk/artifact_versions/__init__.py index 0e7394c3..2f151247 100644 --- a/src/truefoundry_sdk/artifact_versions/__init__.py +++ b/src/truefoundry_sdk/artifact_versions/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import StageArtifactRequestManifest +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import StageArtifactRequestManifest +_dynamic_imports: typing.Dict[str, str] = {"StageArtifactRequestManifest": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["StageArtifactRequestManifest"] diff --git a/src/truefoundry_sdk/artifact_versions/client.py b/src/truefoundry_sdk/artifact_versions/client.py index f036ad37..09e401ab 100644 --- a/src/truefoundry_sdk/artifact_versions/client.py +++ b/src/truefoundry_sdk/artifact_versions/client.py @@ -199,7 +199,17 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.artifact_versions.list() + response = client.artifact_versions.list( + tag="tag", + fqn="fqn", + artifact_id="artifact_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -629,7 +639,17 @@ async def list( async def main() -> None: - response = await client.artifact_versions.list() + response = await client.artifact_versions.list( + tag="tag", + fqn="fqn", + artifact_id="artifact_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/artifact_versions/raw_client.py b/src/truefoundry_sdk/artifact_versions/raw_client.py index 60b226bc..4078a64c 100644 --- a/src/truefoundry_sdk/artifact_versions/raw_client.py +++ b/src/truefoundry_sdk/artifact_versions/raw_client.py @@ -526,7 +526,7 @@ def list_files( "id": id, "path": path, "limit": limit, - "page_token": page_token, + "pageToken": page_token, }, headers={ "content-type": "application/json", @@ -1131,7 +1131,7 @@ async def list_files( "id": id, "path": path, "limit": limit, - "page_token": page_token, + "pageToken": page_token, }, headers={ "content-type": "application/json", diff --git a/src/truefoundry_sdk/artifact_versions/types/__init__.py b/src/truefoundry_sdk/artifact_versions/types/__init__.py index fb48cbd6..3c3dfc60 100644 --- a/src/truefoundry_sdk/artifact_versions/types/__init__.py +++ b/src/truefoundry_sdk/artifact_versions/types/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .stage_artifact_request_manifest import StageArtifactRequestManifest +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .stage_artifact_request_manifest import StageArtifactRequestManifest +_dynamic_imports: typing.Dict[str, str] = {"StageArtifactRequestManifest": ".stage_artifact_request_manifest"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["StageArtifactRequestManifest"] diff --git a/src/truefoundry_sdk/artifacts/client.py b/src/truefoundry_sdk/artifacts/client.py index 8b618554..b15fa602 100644 --- a/src/truefoundry_sdk/artifacts/client.py +++ b/src/truefoundry_sdk/artifacts/client.py @@ -131,7 +131,14 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.artifacts.list() + response = client.artifacts.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + run_id="run_id", + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -325,7 +332,14 @@ async def list( async def main() -> None: - response = await client.artifacts.list() + response = await client.artifacts.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + run_id="run_id", + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/base_client.py b/src/truefoundry_sdk/base_client.py index 5b6d3f3b..5f130cbb 100644 --- a/src/truefoundry_sdk/base_client.py +++ b/src/truefoundry_sdk/base_client.py @@ -1,42 +1,43 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import os import typing import httpx -from .alerts.client import AlertsClient, AsyncAlertsClient -from .application_versions.client import ApplicationVersionsClient, AsyncApplicationVersionsClient -from .applications.client import ApplicationsClient, AsyncApplicationsClient -from .artifact_versions.client import ArtifactVersionsClient, AsyncArtifactVersionsClient -from .artifacts.client import ArtifactsClient, AsyncArtifactsClient -from .clusters.client import AsyncClustersClient, ClustersClient from .core.api_error import ApiError from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .core.request_options import RequestOptions -from .data_directories.client import AsyncDataDirectoriesClient, DataDirectoriesClient -from .environments.client import AsyncEnvironmentsClient, EnvironmentsClient -from .events.client import AsyncEventsClient, EventsClient -from .internal.client import AsyncInternalClient, InternalClient -from .jobs.client import AsyncJobsClient, JobsClient -from .llm_gateway.client import AsyncLlmGatewayClient, LlmGatewayClient -from .logs.client import AsyncLogsClient, LogsClient -from .ml_repos.client import AsyncMlReposClient, MlReposClient -from .model_versions.client import AsyncModelVersionsClient, ModelVersionsClient -from .models.client import AsyncModelsClient, ModelsClient -from .personal_access_tokens.client import AsyncPersonalAccessTokensClient, PersonalAccessTokensClient -from .prompt_versions.client import AsyncPromptVersionsClient, PromptVersionsClient -from .prompts.client import AsyncPromptsClient, PromptsClient from .raw_base_client import AsyncRawBaseTrueFoundry, RawBaseTrueFoundry -from .secret_groups.client import AsyncSecretGroupsClient, SecretGroupsClient -from .secrets.client import AsyncSecretsClient, SecretsClient -from .teams.client import AsyncTeamsClient, TeamsClient from .types.true_foundry_apply_request_manifest import TrueFoundryApplyRequestManifest from .types.true_foundry_apply_response import TrueFoundryApplyResponse from .types.true_foundry_delete_request_manifest import TrueFoundryDeleteRequestManifest -from .users.client import AsyncUsersClient, UsersClient -from .virtual_accounts.client import AsyncVirtualAccountsClient, VirtualAccountsClient -from .workspaces.client import AsyncWorkspacesClient, WorkspacesClient +if typing.TYPE_CHECKING: + from .application_versions.client import ApplicationVersionsClient, AsyncApplicationVersionsClient + from .applications.client import ApplicationsClient, AsyncApplicationsClient + from .artifact_versions.client import ArtifactVersionsClient, AsyncArtifactVersionsClient + from .artifacts.client import ArtifactsClient, AsyncArtifactsClient + from .clusters.client import AsyncClustersClient, ClustersClient + from .data_directories.client import AsyncDataDirectoriesClient, DataDirectoriesClient + from .environments.client import AsyncEnvironmentsClient, EnvironmentsClient + from .internal.client import AsyncInternalClient, InternalClient + from .jobs.client import AsyncJobsClient, JobsClient + from .logs.client import AsyncLogsClient, LogsClient + from .ml_repos.client import AsyncMlReposClient, MlReposClient + from .model_versions.client import AsyncModelVersionsClient, ModelVersionsClient + from .models.client import AsyncModelsClient, ModelsClient + from .personal_access_tokens.client import AsyncPersonalAccessTokensClient, PersonalAccessTokensClient + from .prompt_versions.client import AsyncPromptVersionsClient, PromptVersionsClient + from .prompts.client import AsyncPromptsClient, PromptsClient + from .secret_groups.client import AsyncSecretGroupsClient, SecretGroupsClient + from .secrets.client import AsyncSecretsClient, SecretsClient + from .teams.client import AsyncTeamsClient, TeamsClient + from .traces.client import AsyncTracesClient, TracesClient + from .users.client import AsyncUsersClient, UsersClient + from .virtual_accounts.client import AsyncVirtualAccountsClient, VirtualAccountsClient + from .workspaces.client import AsyncWorkspacesClient, WorkspacesClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -100,31 +101,29 @@ def __init__( timeout=_defaulted_timeout, ) self._raw_client = RawBaseTrueFoundry(client_wrapper=self._client_wrapper) - self.internal = InternalClient(client_wrapper=self._client_wrapper) - self.users = UsersClient(client_wrapper=self._client_wrapper) - self.teams = TeamsClient(client_wrapper=self._client_wrapper) - self.personal_access_tokens = PersonalAccessTokensClient(client_wrapper=self._client_wrapper) - self.virtual_accounts = VirtualAccountsClient(client_wrapper=self._client_wrapper) - self.llm_gateway = LlmGatewayClient(client_wrapper=self._client_wrapper) - self.secrets = SecretsClient(client_wrapper=self._client_wrapper) - self.secret_groups = SecretGroupsClient(client_wrapper=self._client_wrapper) - self.clusters = ClustersClient(client_wrapper=self._client_wrapper) - self.environments = EnvironmentsClient(client_wrapper=self._client_wrapper) - self.applications = ApplicationsClient(client_wrapper=self._client_wrapper) - self.application_versions = ApplicationVersionsClient(client_wrapper=self._client_wrapper) - self.jobs = JobsClient(client_wrapper=self._client_wrapper) - self.workspaces = WorkspacesClient(client_wrapper=self._client_wrapper) - self.events = EventsClient(client_wrapper=self._client_wrapper) - self.alerts = AlertsClient(client_wrapper=self._client_wrapper) - self.logs = LogsClient(client_wrapper=self._client_wrapper) - self.ml_repos = MlReposClient(client_wrapper=self._client_wrapper) - self.artifacts = ArtifactsClient(client_wrapper=self._client_wrapper) - self.prompts = PromptsClient(client_wrapper=self._client_wrapper) - self.models = ModelsClient(client_wrapper=self._client_wrapper) - self.artifact_versions = ArtifactVersionsClient(client_wrapper=self._client_wrapper) - self.model_versions = ModelVersionsClient(client_wrapper=self._client_wrapper) - self.prompt_versions = PromptVersionsClient(client_wrapper=self._client_wrapper) - self.data_directories = DataDirectoriesClient(client_wrapper=self._client_wrapper) + self._internal: typing.Optional[InternalClient] = None + self._users: typing.Optional[UsersClient] = None + self._teams: typing.Optional[TeamsClient] = None + self._personal_access_tokens: typing.Optional[PersonalAccessTokensClient] = None + self._virtual_accounts: typing.Optional[VirtualAccountsClient] = None + self._secrets: typing.Optional[SecretsClient] = None + self._secret_groups: typing.Optional[SecretGroupsClient] = None + self._clusters: typing.Optional[ClustersClient] = None + self._environments: typing.Optional[EnvironmentsClient] = None + self._applications: typing.Optional[ApplicationsClient] = None + self._application_versions: typing.Optional[ApplicationVersionsClient] = None + self._jobs: typing.Optional[JobsClient] = None + self._workspaces: typing.Optional[WorkspacesClient] = None + self._logs: typing.Optional[LogsClient] = None + self._ml_repos: typing.Optional[MlReposClient] = None + self._traces: typing.Optional[TracesClient] = None + self._artifacts: typing.Optional[ArtifactsClient] = None + self._prompts: typing.Optional[PromptsClient] = None + self._models: typing.Optional[ModelsClient] = None + self._artifact_versions: typing.Optional[ArtifactVersionsClient] = None + self._model_versions: typing.Optional[ModelVersionsClient] = None + self._prompt_versions: typing.Optional[PromptVersionsClient] = None + self._data_directories: typing.Optional[DataDirectoriesClient] = None @property def with_raw_response(self) -> RawBaseTrueFoundry: @@ -229,6 +228,190 @@ def delete( _response = self._raw_client.delete(manifest=manifest, request_options=request_options) return _response.data + @property + def internal(self): + if self._internal is None: + from .internal.client import InternalClient # noqa: E402 + + self._internal = InternalClient(client_wrapper=self._client_wrapper) + return self._internal + + @property + def users(self): + if self._users is None: + from .users.client import UsersClient # noqa: E402 + + self._users = UsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def teams(self): + if self._teams is None: + from .teams.client import TeamsClient # noqa: E402 + + self._teams = TeamsClient(client_wrapper=self._client_wrapper) + return self._teams + + @property + def personal_access_tokens(self): + if self._personal_access_tokens is None: + from .personal_access_tokens.client import PersonalAccessTokensClient # noqa: E402 + + self._personal_access_tokens = PersonalAccessTokensClient(client_wrapper=self._client_wrapper) + return self._personal_access_tokens + + @property + def virtual_accounts(self): + if self._virtual_accounts is None: + from .virtual_accounts.client import VirtualAccountsClient # noqa: E402 + + self._virtual_accounts = VirtualAccountsClient(client_wrapper=self._client_wrapper) + return self._virtual_accounts + + @property + def secrets(self): + if self._secrets is None: + from .secrets.client import SecretsClient # noqa: E402 + + self._secrets = SecretsClient(client_wrapper=self._client_wrapper) + return self._secrets + + @property + def secret_groups(self): + if self._secret_groups is None: + from .secret_groups.client import SecretGroupsClient # noqa: E402 + + self._secret_groups = SecretGroupsClient(client_wrapper=self._client_wrapper) + return self._secret_groups + + @property + def clusters(self): + if self._clusters is None: + from .clusters.client import ClustersClient # noqa: E402 + + self._clusters = ClustersClient(client_wrapper=self._client_wrapper) + return self._clusters + + @property + def environments(self): + if self._environments is None: + from .environments.client import EnvironmentsClient # noqa: E402 + + self._environments = EnvironmentsClient(client_wrapper=self._client_wrapper) + return self._environments + + @property + def applications(self): + if self._applications is None: + from .applications.client import ApplicationsClient # noqa: E402 + + self._applications = ApplicationsClient(client_wrapper=self._client_wrapper) + return self._applications + + @property + def application_versions(self): + if self._application_versions is None: + from .application_versions.client import ApplicationVersionsClient # noqa: E402 + + self._application_versions = ApplicationVersionsClient(client_wrapper=self._client_wrapper) + return self._application_versions + + @property + def jobs(self): + if self._jobs is None: + from .jobs.client import JobsClient # noqa: E402 + + self._jobs = JobsClient(client_wrapper=self._client_wrapper) + return self._jobs + + @property + def workspaces(self): + if self._workspaces is None: + from .workspaces.client import WorkspacesClient # noqa: E402 + + self._workspaces = WorkspacesClient(client_wrapper=self._client_wrapper) + return self._workspaces + + @property + def logs(self): + if self._logs is None: + from .logs.client import LogsClient # noqa: E402 + + self._logs = LogsClient(client_wrapper=self._client_wrapper) + return self._logs + + @property + def ml_repos(self): + if self._ml_repos is None: + from .ml_repos.client import MlReposClient # noqa: E402 + + self._ml_repos = MlReposClient(client_wrapper=self._client_wrapper) + return self._ml_repos + + @property + def traces(self): + if self._traces is None: + from .traces.client import TracesClient # noqa: E402 + + self._traces = TracesClient(client_wrapper=self._client_wrapper) + return self._traces + + @property + def artifacts(self): + if self._artifacts is None: + from .artifacts.client import ArtifactsClient # noqa: E402 + + self._artifacts = ArtifactsClient(client_wrapper=self._client_wrapper) + return self._artifacts + + @property + def prompts(self): + if self._prompts is None: + from .prompts.client import PromptsClient # noqa: E402 + + self._prompts = PromptsClient(client_wrapper=self._client_wrapper) + return self._prompts + + @property + def models(self): + if self._models is None: + from .models.client import ModelsClient # noqa: E402 + + self._models = ModelsClient(client_wrapper=self._client_wrapper) + return self._models + + @property + def artifact_versions(self): + if self._artifact_versions is None: + from .artifact_versions.client import ArtifactVersionsClient # noqa: E402 + + self._artifact_versions = ArtifactVersionsClient(client_wrapper=self._client_wrapper) + return self._artifact_versions + + @property + def model_versions(self): + if self._model_versions is None: + from .model_versions.client import ModelVersionsClient # noqa: E402 + + self._model_versions = ModelVersionsClient(client_wrapper=self._client_wrapper) + return self._model_versions + + @property + def prompt_versions(self): + if self._prompt_versions is None: + from .prompt_versions.client import PromptVersionsClient # noqa: E402 + + self._prompt_versions = PromptVersionsClient(client_wrapper=self._client_wrapper) + return self._prompt_versions + + @property + def data_directories(self): + if self._data_directories is None: + from .data_directories.client import DataDirectoriesClient # noqa: E402 + + self._data_directories = DataDirectoriesClient(client_wrapper=self._client_wrapper) + return self._data_directories + class AsyncBaseTrueFoundry: """ @@ -289,31 +472,29 @@ def __init__( timeout=_defaulted_timeout, ) self._raw_client = AsyncRawBaseTrueFoundry(client_wrapper=self._client_wrapper) - self.internal = AsyncInternalClient(client_wrapper=self._client_wrapper) - self.users = AsyncUsersClient(client_wrapper=self._client_wrapper) - self.teams = AsyncTeamsClient(client_wrapper=self._client_wrapper) - self.personal_access_tokens = AsyncPersonalAccessTokensClient(client_wrapper=self._client_wrapper) - self.virtual_accounts = AsyncVirtualAccountsClient(client_wrapper=self._client_wrapper) - self.llm_gateway = AsyncLlmGatewayClient(client_wrapper=self._client_wrapper) - self.secrets = AsyncSecretsClient(client_wrapper=self._client_wrapper) - self.secret_groups = AsyncSecretGroupsClient(client_wrapper=self._client_wrapper) - self.clusters = AsyncClustersClient(client_wrapper=self._client_wrapper) - self.environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper) - self.applications = AsyncApplicationsClient(client_wrapper=self._client_wrapper) - self.application_versions = AsyncApplicationVersionsClient(client_wrapper=self._client_wrapper) - self.jobs = AsyncJobsClient(client_wrapper=self._client_wrapper) - self.workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper) - self.events = AsyncEventsClient(client_wrapper=self._client_wrapper) - self.alerts = AsyncAlertsClient(client_wrapper=self._client_wrapper) - self.logs = AsyncLogsClient(client_wrapper=self._client_wrapper) - self.ml_repos = AsyncMlReposClient(client_wrapper=self._client_wrapper) - self.artifacts = AsyncArtifactsClient(client_wrapper=self._client_wrapper) - self.prompts = AsyncPromptsClient(client_wrapper=self._client_wrapper) - self.models = AsyncModelsClient(client_wrapper=self._client_wrapper) - self.artifact_versions = AsyncArtifactVersionsClient(client_wrapper=self._client_wrapper) - self.model_versions = AsyncModelVersionsClient(client_wrapper=self._client_wrapper) - self.prompt_versions = AsyncPromptVersionsClient(client_wrapper=self._client_wrapper) - self.data_directories = AsyncDataDirectoriesClient(client_wrapper=self._client_wrapper) + self._internal: typing.Optional[AsyncInternalClient] = None + self._users: typing.Optional[AsyncUsersClient] = None + self._teams: typing.Optional[AsyncTeamsClient] = None + self._personal_access_tokens: typing.Optional[AsyncPersonalAccessTokensClient] = None + self._virtual_accounts: typing.Optional[AsyncVirtualAccountsClient] = None + self._secrets: typing.Optional[AsyncSecretsClient] = None + self._secret_groups: typing.Optional[AsyncSecretGroupsClient] = None + self._clusters: typing.Optional[AsyncClustersClient] = None + self._environments: typing.Optional[AsyncEnvironmentsClient] = None + self._applications: typing.Optional[AsyncApplicationsClient] = None + self._application_versions: typing.Optional[AsyncApplicationVersionsClient] = None + self._jobs: typing.Optional[AsyncJobsClient] = None + self._workspaces: typing.Optional[AsyncWorkspacesClient] = None + self._logs: typing.Optional[AsyncLogsClient] = None + self._ml_repos: typing.Optional[AsyncMlReposClient] = None + self._traces: typing.Optional[AsyncTracesClient] = None + self._artifacts: typing.Optional[AsyncArtifactsClient] = None + self._prompts: typing.Optional[AsyncPromptsClient] = None + self._models: typing.Optional[AsyncModelsClient] = None + self._artifact_versions: typing.Optional[AsyncArtifactVersionsClient] = None + self._model_versions: typing.Optional[AsyncModelVersionsClient] = None + self._prompt_versions: typing.Optional[AsyncPromptVersionsClient] = None + self._data_directories: typing.Optional[AsyncDataDirectoriesClient] = None @property def with_raw_response(self) -> AsyncRawBaseTrueFoundry: @@ -433,3 +614,187 @@ async def main() -> None: """ _response = await self._raw_client.delete(manifest=manifest, request_options=request_options) return _response.data + + @property + def internal(self): + if self._internal is None: + from .internal.client import AsyncInternalClient # noqa: E402 + + self._internal = AsyncInternalClient(client_wrapper=self._client_wrapper) + return self._internal + + @property + def users(self): + if self._users is None: + from .users.client import AsyncUsersClient # noqa: E402 + + self._users = AsyncUsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def teams(self): + if self._teams is None: + from .teams.client import AsyncTeamsClient # noqa: E402 + + self._teams = AsyncTeamsClient(client_wrapper=self._client_wrapper) + return self._teams + + @property + def personal_access_tokens(self): + if self._personal_access_tokens is None: + from .personal_access_tokens.client import AsyncPersonalAccessTokensClient # noqa: E402 + + self._personal_access_tokens = AsyncPersonalAccessTokensClient(client_wrapper=self._client_wrapper) + return self._personal_access_tokens + + @property + def virtual_accounts(self): + if self._virtual_accounts is None: + from .virtual_accounts.client import AsyncVirtualAccountsClient # noqa: E402 + + self._virtual_accounts = AsyncVirtualAccountsClient(client_wrapper=self._client_wrapper) + return self._virtual_accounts + + @property + def secrets(self): + if self._secrets is None: + from .secrets.client import AsyncSecretsClient # noqa: E402 + + self._secrets = AsyncSecretsClient(client_wrapper=self._client_wrapper) + return self._secrets + + @property + def secret_groups(self): + if self._secret_groups is None: + from .secret_groups.client import AsyncSecretGroupsClient # noqa: E402 + + self._secret_groups = AsyncSecretGroupsClient(client_wrapper=self._client_wrapper) + return self._secret_groups + + @property + def clusters(self): + if self._clusters is None: + from .clusters.client import AsyncClustersClient # noqa: E402 + + self._clusters = AsyncClustersClient(client_wrapper=self._client_wrapper) + return self._clusters + + @property + def environments(self): + if self._environments is None: + from .environments.client import AsyncEnvironmentsClient # noqa: E402 + + self._environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper) + return self._environments + + @property + def applications(self): + if self._applications is None: + from .applications.client import AsyncApplicationsClient # noqa: E402 + + self._applications = AsyncApplicationsClient(client_wrapper=self._client_wrapper) + return self._applications + + @property + def application_versions(self): + if self._application_versions is None: + from .application_versions.client import AsyncApplicationVersionsClient # noqa: E402 + + self._application_versions = AsyncApplicationVersionsClient(client_wrapper=self._client_wrapper) + return self._application_versions + + @property + def jobs(self): + if self._jobs is None: + from .jobs.client import AsyncJobsClient # noqa: E402 + + self._jobs = AsyncJobsClient(client_wrapper=self._client_wrapper) + return self._jobs + + @property + def workspaces(self): + if self._workspaces is None: + from .workspaces.client import AsyncWorkspacesClient # noqa: E402 + + self._workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper) + return self._workspaces + + @property + def logs(self): + if self._logs is None: + from .logs.client import AsyncLogsClient # noqa: E402 + + self._logs = AsyncLogsClient(client_wrapper=self._client_wrapper) + return self._logs + + @property + def ml_repos(self): + if self._ml_repos is None: + from .ml_repos.client import AsyncMlReposClient # noqa: E402 + + self._ml_repos = AsyncMlReposClient(client_wrapper=self._client_wrapper) + return self._ml_repos + + @property + def traces(self): + if self._traces is None: + from .traces.client import AsyncTracesClient # noqa: E402 + + self._traces = AsyncTracesClient(client_wrapper=self._client_wrapper) + return self._traces + + @property + def artifacts(self): + if self._artifacts is None: + from .artifacts.client import AsyncArtifactsClient # noqa: E402 + + self._artifacts = AsyncArtifactsClient(client_wrapper=self._client_wrapper) + return self._artifacts + + @property + def prompts(self): + if self._prompts is None: + from .prompts.client import AsyncPromptsClient # noqa: E402 + + self._prompts = AsyncPromptsClient(client_wrapper=self._client_wrapper) + return self._prompts + + @property + def models(self): + if self._models is None: + from .models.client import AsyncModelsClient # noqa: E402 + + self._models = AsyncModelsClient(client_wrapper=self._client_wrapper) + return self._models + + @property + def artifact_versions(self): + if self._artifact_versions is None: + from .artifact_versions.client import AsyncArtifactVersionsClient # noqa: E402 + + self._artifact_versions = AsyncArtifactVersionsClient(client_wrapper=self._client_wrapper) + return self._artifact_versions + + @property + def model_versions(self): + if self._model_versions is None: + from .model_versions.client import AsyncModelVersionsClient # noqa: E402 + + self._model_versions = AsyncModelVersionsClient(client_wrapper=self._client_wrapper) + return self._model_versions + + @property + def prompt_versions(self): + if self._prompt_versions is None: + from .prompt_versions.client import AsyncPromptVersionsClient # noqa: E402 + + self._prompt_versions = AsyncPromptVersionsClient(client_wrapper=self._client_wrapper) + return self._prompt_versions + + @property + def data_directories(self): + if self._data_directories is None: + from .data_directories.client import AsyncDataDirectoriesClient # noqa: E402 + + self._data_directories = AsyncDataDirectoriesClient(client_wrapper=self._client_wrapper) + return self._data_directories diff --git a/src/truefoundry_sdk/client.py b/src/truefoundry_sdk/client.py index 30498230..2a520311 100644 --- a/src/truefoundry_sdk/client.py +++ b/src/truefoundry_sdk/client.py @@ -2,30 +2,7 @@ import typing import httpx - -from truefoundry_sdk._wrapped_clients import ( - WrappedApplicationsClient, - WrappedArtifactsClient, - WrappedArtifactVersionsClient, - WrappedAsyncApplicationsClient, - WrappedAsyncArtifactsClient, - WrappedAsyncArtifactVersionsClient, - WrappedAsyncDataDirectoriesClient, - WrappedAsyncModelsClient, - WrappedAsyncModelVersionsClient, - WrappedAsyncPromptsClient, - WrappedAsyncPromptVersionsClient, - WrappedAsyncSecretGroupsClient, - WrappedAsyncWorkspacesClient, - WrappedDataDirectoriesClient, - WrappedModelsClient, - WrappedModelVersionsClient, - WrappedPromptsClient, - WrappedPromptVersionsClient, - WrappedSecretGroupsClient, - WrappedWorkspacesClient, -) -from truefoundry_sdk.base_client import AsyncBaseTrueFoundry, BaseTrueFoundry +from .base_client import AsyncBaseTrueFoundry, BaseTrueFoundry class TrueFoundry(BaseTrueFoundry): @@ -45,16 +22,86 @@ def __init__( follow_redirects=follow_redirects, httpx_client=httpx_client, ) - self.applications = WrappedApplicationsClient(client_wrapper=self._client_wrapper) - self.artifacts = WrappedArtifactsClient(client_wrapper=self._client_wrapper) - self.artifact_versions = WrappedArtifactVersionsClient(client_wrapper=self._client_wrapper) - self.data_directories = WrappedDataDirectoriesClient(client_wrapper=self._client_wrapper) - self.models = WrappedModelsClient(client_wrapper=self._client_wrapper) - self.model_versions = WrappedModelVersionsClient(client_wrapper=self._client_wrapper) - self.prompts = WrappedPromptsClient(client_wrapper=self._client_wrapper) - self.prompt_versions = WrappedPromptVersionsClient(client_wrapper=self._client_wrapper) - self.secret_groups = WrappedSecretGroupsClient(client_wrapper=self._client_wrapper) - self.workspaces = WrappedWorkspacesClient(client_wrapper=self._client_wrapper) + + @property + def applications(self): + if self._applications is None: + from ._wrapped_clients import WrappedApplicationsClient # noqa: E402 + + self._applications = WrappedApplicationsClient(client_wrapper=self._client_wrapper) + return self._applications + + @property + def artifacts(self): + if self._artifacts is None: + from ._wrapped_clients import WrappedArtifactsClient # noqa: E402 + + self._artifacts = WrappedArtifactsClient(client_wrapper=self._client_wrapper) + return self._artifacts + + @property + def artifact_versions(self): + if self._artifact_versions is None: + from ._wrapped_clients import WrappedArtifactVersionsClient # noqa: E402 + + self._artifact_versions = WrappedArtifactVersionsClient(client_wrapper=self._client_wrapper) + return self._artifact_versions + + @property + def data_directories(self): + if self._data_directories is None: + from ._wrapped_clients import WrappedDataDirectoriesClient # noqa: E402 + + self._data_directories = WrappedDataDirectoriesClient(client_wrapper=self._client_wrapper) + return self._data_directories + + @property + def models(self): + if self._models is None: + from ._wrapped_clients import WrappedModelsClient # noqa: E402 + + self._models = WrappedModelsClient(client_wrapper=self._client_wrapper) + return self._models + + @property + def model_versions(self): + if self._model_versions is None: + from ._wrapped_clients import WrappedModelVersionsClient # noqa: E402 + + self._model_versions = WrappedModelVersionsClient(client_wrapper=self._client_wrapper) + return self._model_versions + + @property + def prompts(self): + if self._prompts is None: + from ._wrapped_clients import WrappedPromptsClient # noqa: E402 + + self._prompts = WrappedPromptsClient(client_wrapper=self._client_wrapper) + return self._prompts + + @property + def prompt_versions(self): + if self._prompt_versions is None: + from ._wrapped_clients import WrappedPromptVersionsClient # noqa: E402 + + self._prompt_versions = WrappedPromptVersionsClient(client_wrapper=self._client_wrapper) + return self._prompt_versions + + @property + def secret_groups(self): + if self._secret_groups is None: + from ._wrapped_clients import WrappedSecretGroupsClient # noqa: E402 + + self._secret_groups = WrappedSecretGroupsClient(client_wrapper=self._client_wrapper) + return self._secret_groups + + @property + def workspaces(self): + if self._workspaces is None: + from ._wrapped_clients import WrappedWorkspacesClient # noqa: E402 + + self._workspaces = WrappedWorkspacesClient(client_wrapper=self._client_wrapper) + return self._workspaces class AsyncTrueFoundry(AsyncBaseTrueFoundry): @@ -74,16 +121,86 @@ def __init__( follow_redirects=follow_redirects, httpx_client=httpx_client, ) - self.applications = WrappedAsyncApplicationsClient(client_wrapper=self._client_wrapper) - self.artifacts = WrappedAsyncArtifactsClient(client_wrapper=self._client_wrapper) - self.artifact_versions = WrappedAsyncArtifactVersionsClient(client_wrapper=self._client_wrapper) - self.data_directories = WrappedAsyncDataDirectoriesClient(client_wrapper=self._client_wrapper) - self.models = WrappedAsyncModelsClient(client_wrapper=self._client_wrapper) - self.model_versions = WrappedAsyncModelVersionsClient(client_wrapper=self._client_wrapper) - self.prompts = WrappedAsyncPromptsClient(client_wrapper=self._client_wrapper) - self.prompt_versions = WrappedAsyncPromptVersionsClient(client_wrapper=self._client_wrapper) - self.secret_groups = WrappedAsyncSecretGroupsClient(client_wrapper=self._client_wrapper) - self.workspaces = WrappedAsyncWorkspacesClient(client_wrapper=self._client_wrapper) + + @property + def applications(self): + if self._applications is None: + from ._wrapped_clients import WrappedAsyncApplicationsClient # noqa: E402 + + self._applications = WrappedAsyncApplicationsClient(client_wrapper=self._client_wrapper) + return self._applications + + @property + def artifacts(self): + if self._artifacts is None: + from ._wrapped_clients import WrappedAsyncArtifactsClient # noqa: E402 + + self._artifacts = WrappedAsyncArtifactsClient(client_wrapper=self._client_wrapper) + return self._artifacts + + @property + def artifact_versions(self): + if self._artifact_versions is None: + from ._wrapped_clients import WrappedAsyncArtifactVersionsClient # noqa: E402 + + self._artifact_versions = WrappedAsyncArtifactVersionsClient(client_wrapper=self._client_wrapper) + return self._artifact_versions + + @property + def data_directories(self): + if self._data_directories is None: + from ._wrapped_clients import WrappedAsyncDataDirectoriesClient # noqa: E402 + + self._data_directories = WrappedAsyncDataDirectoriesClient(client_wrapper=self._client_wrapper) + return self._data_directories + + @property + def models(self): + if self._models is None: + from ._wrapped_clients import WrappedAsyncModelsClient # noqa: E402 + + self._models = WrappedAsyncModelsClient(client_wrapper=self._client_wrapper) + return self._models + + @property + def model_versions(self): + if self._model_versions is None: + from ._wrapped_clients import WrappedAsyncModelVersionsClient # noqa: E402 + + self._model_versions = WrappedAsyncModelVersionsClient(client_wrapper=self._client_wrapper) + return self._model_versions + + @property + def prompts(self): + if self._prompts is None: + from ._wrapped_clients import WrappedAsyncPromptsClient # noqa: E402 + + self._prompts = WrappedAsyncPromptsClient(client_wrapper=self._client_wrapper) + return self._prompts + + @property + def prompt_versions(self): + if self._prompt_versions is None: + from ._wrapped_clients import WrappedAsyncPromptVersionsClient # noqa: E402 + + self._prompt_versions = WrappedAsyncPromptVersionsClient(client_wrapper=self._client_wrapper) + return self._prompt_versions + + @property + def secret_groups(self): + if self._secret_groups is None: + from ._wrapped_clients import WrappedAsyncSecretGroupsClient # noqa: E402 + + self._secret_groups = WrappedAsyncSecretGroupsClient(client_wrapper=self._client_wrapper) + return self._secret_groups + + @property + def workspaces(self): + if self._workspaces is None: + from ._wrapped_clients import WrappedAsyncWorkspacesClient # noqa: E402 + + self._workspaces = WrappedAsyncWorkspacesClient(client_wrapper=self._client_wrapper) + return self._workspaces TrueFoundry.__doc__ = BaseTrueFoundry.__doc__ diff --git a/src/truefoundry_sdk/clusters/__init__.py b/src/truefoundry_sdk/clusters/__init__.py index b0b6e2e7..aa029355 100644 --- a/src/truefoundry_sdk/clusters/__init__.py +++ b/src/truefoundry_sdk/clusters/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import ClustersDeleteResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ClustersDeleteResponse +_dynamic_imports: typing.Dict[str, str] = {"ClustersDeleteResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["ClustersDeleteResponse"] diff --git a/src/truefoundry_sdk/clusters/types/__init__.py b/src/truefoundry_sdk/clusters/types/__init__.py index 4e6e948c..b183cd47 100644 --- a/src/truefoundry_sdk/clusters/types/__init__.py +++ b/src/truefoundry_sdk/clusters/types/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .clusters_delete_response import ClustersDeleteResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .clusters_delete_response import ClustersDeleteResponse +_dynamic_imports: typing.Dict[str, str] = {"ClustersDeleteResponse": ".clusters_delete_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["ClustersDeleteResponse"] diff --git a/src/truefoundry_sdk/core/__init__.py b/src/truefoundry_sdk/core/__init__.py index d1461de7..bfce76d9 100644 --- a/src/truefoundry_sdk/core/__init__.py +++ b/src/truefoundry_sdk/core/__init__.py @@ -2,27 +2,82 @@ # isort: skip_file -from .api_error import ApiError -from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper -from .datetime_utils import serialize_datetime -from .file import File, convert_file_dict_to_httpx_tuples, with_content_type -from .http_client import AsyncHttpClient, HttpClient -from .http_response import AsyncHttpResponse, HttpResponse -from .jsonable_encoder import jsonable_encoder -from .pagination import AsyncPager, SyncPager -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, -) -from .query_encoder import encode_query -from .remove_none_from_dict import remove_none_from_dict -from .request_options import RequestOptions -from .serialization import FieldMetadata, convert_and_respect_annotation_metadata +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .api_error import ApiError + from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper + from .datetime_utils import serialize_datetime + from .file import File, convert_file_dict_to_httpx_tuples, with_content_type + from .http_client import AsyncHttpClient, HttpClient + from .http_response import AsyncHttpResponse, HttpResponse + from .jsonable_encoder import jsonable_encoder + from .pagination import AsyncPager, SyncPager + from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, + ) + from .query_encoder import encode_query + from .remove_none_from_dict import remove_none_from_dict + from .request_options import RequestOptions + from .serialization import FieldMetadata, convert_and_respect_annotation_metadata +_dynamic_imports: typing.Dict[str, str] = { + "ApiError": ".api_error", + "AsyncClientWrapper": ".client_wrapper", + "AsyncHttpClient": ".http_client", + "AsyncHttpResponse": ".http_response", + "AsyncPager": ".pagination", + "BaseClientWrapper": ".client_wrapper", + "FieldMetadata": ".serialization", + "File": ".file", + "HttpClient": ".http_client", + "HttpResponse": ".http_response", + "IS_PYDANTIC_V2": ".pydantic_utilities", + "RequestOptions": ".request_options", + "SyncClientWrapper": ".client_wrapper", + "SyncPager": ".pagination", + "UniversalBaseModel": ".pydantic_utilities", + "UniversalRootModel": ".pydantic_utilities", + "convert_and_respect_annotation_metadata": ".serialization", + "convert_file_dict_to_httpx_tuples": ".file", + "encode_query": ".query_encoder", + "jsonable_encoder": ".jsonable_encoder", + "parse_obj_as": ".pydantic_utilities", + "remove_none_from_dict": ".remove_none_from_dict", + "serialize_datetime": ".datetime_utils", + "universal_field_validator": ".pydantic_utilities", + "universal_root_validator": ".pydantic_utilities", + "update_forward_refs": ".pydantic_utilities", + "with_content_type": ".file", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ApiError", diff --git a/src/truefoundry_sdk/core/force_multipart.py b/src/truefoundry_sdk/core/force_multipart.py index ae24ccff..5440913f 100644 --- a/src/truefoundry_sdk/core/force_multipart.py +++ b/src/truefoundry_sdk/core/force_multipart.py @@ -1,7 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from typing import Any, Dict -class ForceMultipartDict(dict): + +class ForceMultipartDict(Dict[str, Any]): """ A dictionary subclass that always evaluates to True in boolean contexts. @@ -9,7 +11,7 @@ class ForceMultipartDict(dict): the dictionary is empty, which would normally evaluate to False. """ - def __bool__(self): + def __bool__(self) -> bool: return True diff --git a/src/truefoundry_sdk/core/http_response.py b/src/truefoundry_sdk/core/http_response.py index 48a1798a..2479747e 100644 --- a/src/truefoundry_sdk/core/http_response.py +++ b/src/truefoundry_sdk/core/http_response.py @@ -4,8 +4,8 @@ import httpx +# Generic to represent the underlying type of the data wrapped by the HTTP response. T = TypeVar("T") -"""Generic to represent the underlying type of the data wrapped by the HTTP response.""" class BaseHttpResponse: diff --git a/src/truefoundry_sdk/core/http_sse/__init__.py b/src/truefoundry_sdk/core/http_sse/__init__.py new file mode 100644 index 00000000..730e5a33 --- /dev/null +++ b/src/truefoundry_sdk/core/http_sse/__init__.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from ._api import EventSource, aconnect_sse, connect_sse + from ._exceptions import SSEError + from ._models import ServerSentEvent +_dynamic_imports: typing.Dict[str, str] = { + "EventSource": "._api", + "SSEError": "._exceptions", + "ServerSentEvent": "._models", + "aconnect_sse": "._api", + "connect_sse": "._api", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/src/truefoundry_sdk/core/http_sse/_api.py b/src/truefoundry_sdk/core/http_sse/_api.py new file mode 100644 index 00000000..f900b3b6 --- /dev/null +++ b/src/truefoundry_sdk/core/http_sse/_api.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +import re +from contextlib import asynccontextmanager, contextmanager +from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast + +import httpx +from ._decoders import SSEDecoder +from ._exceptions import SSEError +from ._models import ServerSentEvent + + +class EventSource: + def __init__(self, response: httpx.Response) -> None: + self._response = response + + def _check_content_type(self) -> None: + content_type = self._response.headers.get("content-type", "").partition(";")[0] + if "text/event-stream" not in content_type: + raise SSEError( + f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" + ) + + def _get_charset(self) -> str: + """Extract charset from Content-Type header, fallback to UTF-8.""" + content_type = self._response.headers.get("content-type", "") + + # Parse charset parameter using regex + charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) + if charset_match: + charset = charset_match.group(1).strip("\"'") + # Validate that it's a known encoding + try: + # Test if the charset is valid by trying to encode/decode + "test".encode(charset).decode(charset) + return charset + except (LookupError, UnicodeError): + # If charset is invalid, fall back to UTF-8 + pass + + # Default to UTF-8 if no charset specified or invalid charset + return "utf-8" + + @property + def response(self) -> httpx.Response: + return self._response + + def iter_sse(self) -> Iterator[ServerSentEvent]: + self._check_content_type() + decoder = SSEDecoder() + charset = self._get_charset() + + buffer = "" + for chunk in self._response.iter_bytes(): + # Decode chunk using detected charset + text_chunk = chunk.decode(charset, errors="replace") + buffer += text_chunk + + # Process complete lines + while "\n" in buffer: + line, buffer = buffer.split("\n", 1) + line = line.rstrip("\r") + sse = decoder.decode(line) + # when we reach a "\n\n" => line = '' + # => decoder will attempt to return an SSE Event + if sse is not None: + yield sse + + # Process any remaining data in buffer + if buffer.strip(): + line = buffer.rstrip("\r") + sse = decoder.decode(line) + if sse is not None: + yield sse + + async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: + self._check_content_type() + decoder = SSEDecoder() + lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) + try: + async for line in lines: + line = line.rstrip("\n") + sse = decoder.decode(line) + if sse is not None: + yield sse + finally: + await lines.aclose() + + +@contextmanager +def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) + + +@asynccontextmanager +async def aconnect_sse( + client: httpx.AsyncClient, + method: str, + url: str, + **kwargs: Any, +) -> AsyncIterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + async with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) diff --git a/src/truefoundry_sdk/core/http_sse/_decoders.py b/src/truefoundry_sdk/core/http_sse/_decoders.py new file mode 100644 index 00000000..339b0890 --- /dev/null +++ b/src/truefoundry_sdk/core/http_sse/_decoders.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import List, Optional + +from ._models import ServerSentEvent + + +class SSEDecoder: + def __init__(self) -> None: + self._event = "" + self._data: List[str] = [] + self._last_event_id = "" + self._retry: Optional[int] = None + + def decode(self, line: str) -> Optional[ServerSentEvent]: + # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 + + if not line: + if not self._event and not self._data and not self._last_event_id and self._retry is None: + return None + + sse = ServerSentEvent( + event=self._event, + data="\n".join(self._data), + id=self._last_event_id, + retry=self._retry, + ) + + # NOTE: as per the SSE spec, do not reset last_event_id. + self._event = "" + self._data = [] + self._retry = None + + return sse + + if line.startswith(":"): + return None + + fieldname, _, value = line.partition(":") + + if value.startswith(" "): + value = value[1:] + + if fieldname == "event": + self._event = value + elif fieldname == "data": + self._data.append(value) + elif fieldname == "id": + if "\0" in value: + pass + else: + self._last_event_id = value + elif fieldname == "retry": + try: + self._retry = int(value) + except (TypeError, ValueError): + pass + else: + pass # Field is ignored. + + return None diff --git a/src/truefoundry_sdk/events/__init__.py b/src/truefoundry_sdk/core/http_sse/_exceptions.py similarity index 51% rename from src/truefoundry_sdk/events/__init__.py rename to src/truefoundry_sdk/core/http_sse/_exceptions.py index 5cde0202..81605a8a 100644 --- a/src/truefoundry_sdk/events/__init__.py +++ b/src/truefoundry_sdk/core/http_sse/_exceptions.py @@ -1,4 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -# isort: skip_file +import httpx + +class SSEError(httpx.TransportError): + pass diff --git a/src/truefoundry_sdk/core/http_sse/_models.py b/src/truefoundry_sdk/core/http_sse/_models.py new file mode 100644 index 00000000..1af57f8f --- /dev/null +++ b/src/truefoundry_sdk/core/http_sse/_models.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +from dataclasses import dataclass +from typing import Any, Optional + + +@dataclass(frozen=True) +class ServerSentEvent: + event: str = "message" + data: str = "" + id: str = "" + retry: Optional[int] = None + + def json(self) -> Any: + """Parse the data field as JSON.""" + return json.loads(self.data) diff --git a/src/truefoundry_sdk/core/pagination.py b/src/truefoundry_sdk/core/pagination.py index 209a1ff1..97bcb645 100644 --- a/src/truefoundry_sdk/core/pagination.py +++ b/src/truefoundry_sdk/core/pagination.py @@ -7,8 +7,8 @@ from .http_response import BaseHttpResponse +# Generic to represent the underlying type of the results within a page T = TypeVar("T") -"""Generic to represent the underlying type of the results within a page""" # SDKs implement a Page ABC per-pagination request, the endpoint then returns a pager that wraps this type diff --git a/src/truefoundry_sdk/core/pydantic_utilities.py b/src/truefoundry_sdk/core/pydantic_utilities.py index 7db29500..8906cdfa 100644 --- a/src/truefoundry_sdk/core/pydantic_utilities.py +++ b/src/truefoundry_sdk/core/pydantic_utilities.py @@ -61,7 +61,7 @@ class UniversalBaseModel(pydantic.BaseModel): @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] def serialize_model(self) -> Any: # type: ignore[name-defined] - serialized = self.model_dump() + serialized = self.dict() # type: ignore[attr-defined] data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} return data @@ -147,7 +147,10 @@ def dict(self, **kwargs: Any) -> Dict[str, Any]: dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") + return cast( + Dict[str, Any], + convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), + ) def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: diff --git a/src/truefoundry_sdk/data_directories/client.py b/src/truefoundry_sdk/data_directories/client.py index 051367d2..39fb1d5f 100644 --- a/src/truefoundry_sdk/data_directories/client.py +++ b/src/truefoundry_sdk/data_directories/client.py @@ -114,6 +114,7 @@ def delete( ) client.data_directories.delete( id="id", + delete_contents=True, ) """ _response = self._raw_client.delete(id, delete_contents=delete_contents, request_options=request_options) @@ -171,7 +172,13 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.data_directories.list() + response = client.data_directories.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + limit=1, + offset=1, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -535,6 +542,7 @@ async def delete( async def main() -> None: await client.data_directories.delete( id="id", + delete_contents=True, ) @@ -600,7 +608,13 @@ async def list( async def main() -> None: - response = await client.data_directories.list() + response = await client.data_directories.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + limit=1, + offset=1, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/data_directories/raw_client.py b/src/truefoundry_sdk/data_directories/raw_client.py index 323e6c15..f0e938a6 100644 --- a/src/truefoundry_sdk/data_directories/raw_client.py +++ b/src/truefoundry_sdk/data_directories/raw_client.py @@ -349,7 +349,7 @@ def list_files( "id": id, "path": path, "limit": limit, - "page_token": page_token, + "pageToken": page_token, }, headers={ "content-type": "application/json", @@ -933,7 +933,7 @@ async def list_files( "id": id, "path": path, "limit": limit, - "page_token": page_token, + "pageToken": page_token, }, headers={ "content-type": "application/json", diff --git a/src/truefoundry_sdk/errors/__init__.py b/src/truefoundry_sdk/errors/__init__.py index bd94947e..f13cfbfb 100644 --- a/src/truefoundry_sdk/errors/__init__.py +++ b/src/truefoundry_sdk/errors/__init__.py @@ -2,16 +2,54 @@ # isort: skip_file -from .bad_request_error import BadRequestError -from .conflict_error import ConflictError -from .expectation_failed_error import ExpectationFailedError -from .failed_dependency_error import FailedDependencyError -from .forbidden_error import ForbiddenError -from .method_not_allowed_error import MethodNotAllowedError -from .not_found_error import NotFoundError -from .not_implemented_error import NotImplementedError -from .unauthorized_error import UnauthorizedError -from .unprocessable_entity_error import UnprocessableEntityError +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .bad_request_error import BadRequestError + from .conflict_error import ConflictError + from .expectation_failed_error import ExpectationFailedError + from .failed_dependency_error import FailedDependencyError + from .forbidden_error import ForbiddenError + from .method_not_allowed_error import MethodNotAllowedError + from .not_found_error import NotFoundError + from .not_implemented_error import NotImplementedError + from .unauthorized_error import UnauthorizedError + from .unprocessable_entity_error import UnprocessableEntityError +_dynamic_imports: typing.Dict[str, str] = { + "BadRequestError": ".bad_request_error", + "ConflictError": ".conflict_error", + "ExpectationFailedError": ".expectation_failed_error", + "FailedDependencyError": ".failed_dependency_error", + "ForbiddenError": ".forbidden_error", + "MethodNotAllowedError": ".method_not_allowed_error", + "NotFoundError": ".not_found_error", + "NotImplementedError": ".not_implemented_error", + "UnauthorizedError": ".unauthorized_error", + "UnprocessableEntityError": ".unprocessable_entity_error", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "BadRequestError", diff --git a/src/truefoundry_sdk/events/client.py b/src/truefoundry_sdk/events/client.py deleted file mode 100644 index 9f1bbdb8..00000000 --- a/src/truefoundry_sdk/events/client.py +++ /dev/null @@ -1,174 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.get_events_response import GetEventsResponse -from .raw_client import AsyncRawEventsClient, RawEventsClient - - -class EventsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawEventsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawEventsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawEventsClient - """ - return self._raw_client - - def get( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - application_fqn: typing.Optional[str] = None, - pod_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - job_run_name: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetEventsResponse: - """ - Get Events for Pod, Job Run, Application. The events are sourced from Kubernetes as well as events captured by truefoundry. Optional query parameters include startTs, endTs for filtering. - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - application_id : typing.Optional[str] - Application ID - - application_fqn : typing.Optional[str] - Application FQN - - pod_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Name of the pods - - job_run_name : typing.Optional[str] - Job run name - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetEventsResponse - Returns a list of events matching the query parameters. - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.events.get() - """ - _response = self._raw_client.get( - start_ts=start_ts, - end_ts=end_ts, - application_id=application_id, - application_fqn=application_fqn, - pod_names=pod_names, - job_run_name=job_run_name, - request_options=request_options, - ) - return _response.data - - -class AsyncEventsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawEventsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawEventsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawEventsClient - """ - return self._raw_client - - async def get( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - application_fqn: typing.Optional[str] = None, - pod_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - job_run_name: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> GetEventsResponse: - """ - Get Events for Pod, Job Run, Application. The events are sourced from Kubernetes as well as events captured by truefoundry. Optional query parameters include startTs, endTs for filtering. - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - application_id : typing.Optional[str] - Application ID - - application_fqn : typing.Optional[str] - Application FQN - - pod_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Name of the pods - - job_run_name : typing.Optional[str] - Job run name - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetEventsResponse - Returns a list of events matching the query parameters. - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.events.get() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get( - start_ts=start_ts, - end_ts=end_ts, - application_id=application_id, - application_fqn=application_fqn, - pod_names=pod_names, - job_run_name=job_run_name, - request_options=request_options, - ) - return _response.data diff --git a/src/truefoundry_sdk/events/raw_client.py b/src/truefoundry_sdk/events/raw_client.py deleted file mode 100644 index e029dda8..00000000 --- a/src/truefoundry_sdk/events/raw_client.py +++ /dev/null @@ -1,231 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from ..errors.bad_request_error import BadRequestError -from ..errors.forbidden_error import ForbiddenError -from ..errors.not_found_error import NotFoundError -from ..types.get_events_response import GetEventsResponse -from ..types.http_error import HttpError - - -class RawEventsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - application_fqn: typing.Optional[str] = None, - pod_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - job_run_name: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[GetEventsResponse]: - """ - Get Events for Pod, Job Run, Application. The events are sourced from Kubernetes as well as events captured by truefoundry. Optional query parameters include startTs, endTs for filtering. - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - application_id : typing.Optional[str] - Application ID - - application_fqn : typing.Optional[str] - Application FQN - - pod_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Name of the pods - - job_run_name : typing.Optional[str] - Job run name - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[GetEventsResponse] - Returns a list of events matching the query parameters. - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/events", - method="GET", - params={ - "startTs": start_ts, - "endTs": end_ts, - "applicationId": application_id, - "applicationFqn": application_fqn, - "podNames": pod_names, - "jobRunName": job_run_name, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GetEventsResponse, - parse_obj_as( - type_=GetEventsResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[typing.Any], # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - HttpError, - parse_obj_as( - type_=HttpError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[typing.Any], # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawEventsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get( - self, - *, - start_ts: typing.Optional[str] = None, - end_ts: typing.Optional[str] = None, - application_id: typing.Optional[str] = None, - application_fqn: typing.Optional[str] = None, - pod_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - job_run_name: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[GetEventsResponse]: - """ - Get Events for Pod, Job Run, Application. The events are sourced from Kubernetes as well as events captured by truefoundry. Optional query parameters include startTs, endTs for filtering. - - Parameters - ---------- - start_ts : typing.Optional[str] - Start timestamp (ISO format) for querying events - - end_ts : typing.Optional[str] - End timestamp (ISO format) for querying events - - application_id : typing.Optional[str] - Application ID - - application_fqn : typing.Optional[str] - Application FQN - - pod_names : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Name of the pods - - job_run_name : typing.Optional[str] - Job run name - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[GetEventsResponse] - Returns a list of events matching the query parameters. - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/events", - method="GET", - params={ - "startTs": start_ts, - "endTs": end_ts, - "applicationId": application_id, - "applicationFqn": application_fqn, - "podNames": pod_names, - "jobRunName": job_run_name, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GetEventsResponse, - parse_obj_as( - type_=GetEventsResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[typing.Any], # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - HttpError, - parse_obj_as( - type_=HttpError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Optional[typing.Any], - parse_obj_as( - type_=typing.Optional[typing.Any], # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/truefoundry_sdk/internal/__init__.py b/src/truefoundry_sdk/internal/__init__.py index 5d229e6b..62c272a4 100644 --- a/src/truefoundry_sdk/internal/__init__.py +++ b/src/truefoundry_sdk/internal/__init__.py @@ -2,24 +2,70 @@ # isort: skip_file -from . import ( - ai_gateway, - applications, - artifact_versions, - clusters, - deployments, - docker_registries, - metrics, - ml, - users, - vcs, - workflows, -) -from .ai_gateway import AiGatewayGetGatewayConfigRequestType -from .docker_registries import DockerRegistriesCreateRepositoryResponse, DockerRegistriesGetCredentialsResponse -from .metrics import MetricsGetChartsRequestFilterEntity -from .ml import ApplyMlEntityRequestManifest, DeleteMlEntityRequestManifest -from .workflows import WorkflowsExecuteWorkflowResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import ( + ai_gateway, + applications, + artifact_versions, + clusters, + deployments, + docker_registries, + metrics, + ml, + users, + vcs, + workflows, + ) + from .ai_gateway import AiGatewayGetGatewayConfigRequestType + from .docker_registries import DockerRegistriesCreateRepositoryResponse, DockerRegistriesGetCredentialsResponse + from .metrics import MetricsGetChartsRequestFilterEntity + from .ml import ApplyMlEntityRequestManifest, DeleteMlEntityRequestManifest + from .workflows import WorkflowsExecuteWorkflowResponse +_dynamic_imports: typing.Dict[str, str] = { + "AiGatewayGetGatewayConfigRequestType": ".ai_gateway", + "ApplyMlEntityRequestManifest": ".ml", + "DeleteMlEntityRequestManifest": ".ml", + "DockerRegistriesCreateRepositoryResponse": ".docker_registries", + "DockerRegistriesGetCredentialsResponse": ".docker_registries", + "MetricsGetChartsRequestFilterEntity": ".metrics", + "WorkflowsExecuteWorkflowResponse": ".workflows", + "ai_gateway": ".ai_gateway", + "applications": ".applications", + "artifact_versions": ".artifact_versions", + "clusters": ".clusters", + "deployments": ".deployments", + "docker_registries": ".docker_registries", + "metrics": ".metrics", + "ml": ".ml", + "users": ".users", + "vcs": ".vcs", + "workflows": ".workflows", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "AiGatewayGetGatewayConfigRequestType", diff --git a/src/truefoundry_sdk/internal/ai_gateway/__init__.py b/src/truefoundry_sdk/internal/ai_gateway/__init__.py index 1974fc99..f601c83a 100644 --- a/src/truefoundry_sdk/internal/ai_gateway/__init__.py +++ b/src/truefoundry_sdk/internal/ai_gateway/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import AiGatewayGetGatewayConfigRequestType +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import AiGatewayGetGatewayConfigRequestType +_dynamic_imports: typing.Dict[str, str] = {"AiGatewayGetGatewayConfigRequestType": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["AiGatewayGetGatewayConfigRequestType"] diff --git a/src/truefoundry_sdk/internal/ai_gateway/types/__init__.py b/src/truefoundry_sdk/internal/ai_gateway/types/__init__.py index 85a926a9..e3b46549 100644 --- a/src/truefoundry_sdk/internal/ai_gateway/types/__init__.py +++ b/src/truefoundry_sdk/internal/ai_gateway/types/__init__.py @@ -2,6 +2,35 @@ # isort: skip_file -from .ai_gateway_get_gateway_config_request_type import AiGatewayGetGatewayConfigRequestType +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .ai_gateway_get_gateway_config_request_type import AiGatewayGetGatewayConfigRequestType +_dynamic_imports: typing.Dict[str, str] = { + "AiGatewayGetGatewayConfigRequestType": ".ai_gateway_get_gateway_config_request_type" +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["AiGatewayGetGatewayConfigRequestType"] diff --git a/src/truefoundry_sdk/internal/applications/client.py b/src/truefoundry_sdk/internal/applications/client.py index 09a61c87..be1ef5c9 100644 --- a/src/truefoundry_sdk/internal/applications/client.py +++ b/src/truefoundry_sdk/internal/applications/client.py @@ -22,6 +22,43 @@ def with_raw_response(self) -> RawApplicationsClient: """ return self._raw_client + def promote_rollout( + self, id: str, *, full: typing.Optional[bool] = False, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Promote an application rollout for canary and blue-green. + + Parameters + ---------- + id : str + Id of the application + + full : typing.Optional[bool] + Whether to promote a rollout to full + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from truefoundry_sdk import TrueFoundry + + client = TrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + client.internal.applications.promote_rollout( + id="id", + full=True, + ) + """ + _response = self._raw_client.promote_rollout(id, full=full, request_options=request_options) + return _response.data + def get_pod_template_hash_to_deployment_version( self, id: str, @@ -58,6 +95,7 @@ def get_pod_template_hash_to_deployment_version( ) client.internal.applications.get_pod_template_hash_to_deployment_version( id="id", + pod_template_hashes="podTemplateHashes", ) """ _response = self._raw_client.get_pod_template_hash_to_deployment_version( @@ -81,6 +119,51 @@ def with_raw_response(self) -> AsyncRawApplicationsClient: """ return self._raw_client + async def promote_rollout( + self, id: str, *, full: typing.Optional[bool] = False, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + Promote an application rollout for canary and blue-green. + + Parameters + ---------- + id : str + Id of the application + + full : typing.Optional[bool] + Whether to promote a rollout to full + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from truefoundry_sdk import AsyncTrueFoundry + + client = AsyncTrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.internal.applications.promote_rollout( + id="id", + full=True, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.promote_rollout(id, full=full, request_options=request_options) + return _response.data + async def get_pod_template_hash_to_deployment_version( self, id: str, @@ -122,6 +205,7 @@ async def get_pod_template_hash_to_deployment_version( async def main() -> None: await client.internal.applications.get_pod_template_hash_to_deployment_version( id="id", + pod_template_hashes="podTemplateHashes", ) diff --git a/src/truefoundry_sdk/internal/applications/raw_client.py b/src/truefoundry_sdk/internal/applications/raw_client.py index d631f5c6..4dcffa93 100644 --- a/src/truefoundry_sdk/internal/applications/raw_client.py +++ b/src/truefoundry_sdk/internal/applications/raw_client.py @@ -10,12 +10,73 @@ from ...core.pydantic_utilities import parse_obj_as from ...core.request_options import RequestOptions from ...errors.bad_request_error import BadRequestError +from ...errors.method_not_allowed_error import MethodNotAllowedError +from ...errors.not_found_error import NotFoundError class RawApplicationsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def promote_rollout( + self, id: str, *, full: typing.Optional[bool] = False, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[None]: + """ + Promote an application rollout for canary and blue-green. + + Parameters + ---------- + id : str + Id of the application + + full : typing.Optional[bool] + Whether to promote a rollout to full + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"api/svc/v1/apps/{jsonable_encoder(id)}/rollout/promote", + method="POST", + params={ + "full": full, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 405: + raise MethodNotAllowedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def get_pod_template_hash_to_deployment_version( self, id: str, @@ -81,6 +142,65 @@ class AsyncRawApplicationsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def promote_rollout( + self, id: str, *, full: typing.Optional[bool] = False, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Promote an application rollout for canary and blue-green. + + Parameters + ---------- + id : str + Id of the application + + full : typing.Optional[bool] + Whether to promote a rollout to full + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/svc/v1/apps/{jsonable_encoder(id)}/rollout/promote", + method="POST", + params={ + "full": full, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 405: + raise MethodNotAllowedError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def get_pod_template_hash_to_deployment_version( self, id: str, diff --git a/src/truefoundry_sdk/internal/artifact_versions/client.py b/src/truefoundry_sdk/internal/artifact_versions/client.py index c4fe93a3..02ccdebc 100644 --- a/src/truefoundry_sdk/internal/artifact_versions/client.py +++ b/src/truefoundry_sdk/internal/artifact_versions/client.py @@ -86,7 +86,18 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.internal.artifact_versions.list() + response = client.internal.artifact_versions.list( + tag="tag", + fqn="fqn", + artifact_id="artifact_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + include_model_versions=True, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -192,7 +203,18 @@ async def list( async def main() -> None: - response = await client.internal.artifact_versions.list() + response = await client.internal.artifact_versions.list( + tag="tag", + fqn="fqn", + artifact_id="artifact_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + include_model_versions=True, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/internal/client.py b/src/truefoundry_sdk/internal/client.py index adbedd51..32fb8375 100644 --- a/src/truefoundry_sdk/internal/client.py +++ b/src/truefoundry_sdk/internal/client.py @@ -1,47 +1,42 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions -from .ai_gateway.client import AiGatewayClient, AsyncAiGatewayClient -from .applications.client import ApplicationsClient, AsyncApplicationsClient -from .artifact_versions.client import ArtifactVersionsClient, AsyncArtifactVersionsClient -from .clusters.client import AsyncClustersClient, ClustersClient -from .deployments.client import AsyncDeploymentsClient, DeploymentsClient -from .docker_registries.client import AsyncDockerRegistriesClient, DockerRegistriesClient -from .metrics.client import AsyncMetricsClient, MetricsClient -from .ml.client import AsyncMlClient, MlClient from .raw_client import AsyncRawInternalClient, RawInternalClient -from .users.client import AsyncUsersClient, UsersClient -from .vcs.client import AsyncVcsClient, VcsClient -from .workflows.client import AsyncWorkflowsClient, WorkflowsClient + +if typing.TYPE_CHECKING: + from .ai_gateway.client import AiGatewayClient, AsyncAiGatewayClient + from .applications.client import ApplicationsClient, AsyncApplicationsClient + from .artifact_versions.client import ArtifactVersionsClient, AsyncArtifactVersionsClient + from .clusters.client import AsyncClustersClient, ClustersClient + from .deployments.client import AsyncDeploymentsClient, DeploymentsClient + from .docker_registries.client import AsyncDockerRegistriesClient, DockerRegistriesClient + from .metrics.client import AsyncMetricsClient, MetricsClient + from .ml.client import AsyncMlClient, MlClient + from .users.client import AsyncUsersClient, UsersClient + from .vcs.client import AsyncVcsClient, VcsClient + from .workflows.client import AsyncWorkflowsClient, WorkflowsClient class InternalClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawInternalClient(client_wrapper=client_wrapper) - self.users = UsersClient(client_wrapper=client_wrapper) - - self.ai_gateway = AiGatewayClient(client_wrapper=client_wrapper) - - self.clusters = ClustersClient(client_wrapper=client_wrapper) - - self.deployments = DeploymentsClient(client_wrapper=client_wrapper) - - self.applications = ApplicationsClient(client_wrapper=client_wrapper) - - self.metrics = MetricsClient(client_wrapper=client_wrapper) - - self.vcs = VcsClient(client_wrapper=client_wrapper) - - self.docker_registries = DockerRegistriesClient(client_wrapper=client_wrapper) - - self.workflows = WorkflowsClient(client_wrapper=client_wrapper) - - self.artifact_versions = ArtifactVersionsClient(client_wrapper=client_wrapper) - - self.ml = MlClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._users: typing.Optional[UsersClient] = None + self._ai_gateway: typing.Optional[AiGatewayClient] = None + self._clusters: typing.Optional[ClustersClient] = None + self._deployments: typing.Optional[DeploymentsClient] = None + self._applications: typing.Optional[ApplicationsClient] = None + self._metrics: typing.Optional[MetricsClient] = None + self._vcs: typing.Optional[VcsClient] = None + self._docker_registries: typing.Optional[DockerRegistriesClient] = None + self._workflows: typing.Optional[WorkflowsClient] = None + self._artifact_versions: typing.Optional[ArtifactVersionsClient] = None + self._ml: typing.Optional[MlClient] = None @property def with_raw_response(self) -> RawInternalClient: @@ -92,31 +87,110 @@ def get_id_from_fqn( _response = self._raw_client.get_id_from_fqn(type, fqn=fqn, request_options=request_options) return _response.data + @property + def users(self): + if self._users is None: + from .users.client import UsersClient # noqa: E402 -class AsyncInternalClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawInternalClient(client_wrapper=client_wrapper) - self.users = AsyncUsersClient(client_wrapper=client_wrapper) + self._users = UsersClient(client_wrapper=self._client_wrapper) + return self._users - self.ai_gateway = AsyncAiGatewayClient(client_wrapper=client_wrapper) + @property + def ai_gateway(self): + if self._ai_gateway is None: + from .ai_gateway.client import AiGatewayClient # noqa: E402 - self.clusters = AsyncClustersClient(client_wrapper=client_wrapper) + self._ai_gateway = AiGatewayClient(client_wrapper=self._client_wrapper) + return self._ai_gateway - self.deployments = AsyncDeploymentsClient(client_wrapper=client_wrapper) + @property + def clusters(self): + if self._clusters is None: + from .clusters.client import ClustersClient # noqa: E402 - self.applications = AsyncApplicationsClient(client_wrapper=client_wrapper) + self._clusters = ClustersClient(client_wrapper=self._client_wrapper) + return self._clusters - self.metrics = AsyncMetricsClient(client_wrapper=client_wrapper) + @property + def deployments(self): + if self._deployments is None: + from .deployments.client import DeploymentsClient # noqa: E402 + + self._deployments = DeploymentsClient(client_wrapper=self._client_wrapper) + return self._deployments + + @property + def applications(self): + if self._applications is None: + from .applications.client import ApplicationsClient # noqa: E402 + + self._applications = ApplicationsClient(client_wrapper=self._client_wrapper) + return self._applications + + @property + def metrics(self): + if self._metrics is None: + from .metrics.client import MetricsClient # noqa: E402 + + self._metrics = MetricsClient(client_wrapper=self._client_wrapper) + return self._metrics + + @property + def vcs(self): + if self._vcs is None: + from .vcs.client import VcsClient # noqa: E402 + + self._vcs = VcsClient(client_wrapper=self._client_wrapper) + return self._vcs + + @property + def docker_registries(self): + if self._docker_registries is None: + from .docker_registries.client import DockerRegistriesClient # noqa: E402 + + self._docker_registries = DockerRegistriesClient(client_wrapper=self._client_wrapper) + return self._docker_registries + + @property + def workflows(self): + if self._workflows is None: + from .workflows.client import WorkflowsClient # noqa: E402 + + self._workflows = WorkflowsClient(client_wrapper=self._client_wrapper) + return self._workflows + + @property + def artifact_versions(self): + if self._artifact_versions is None: + from .artifact_versions.client import ArtifactVersionsClient # noqa: E402 - self.vcs = AsyncVcsClient(client_wrapper=client_wrapper) + self._artifact_versions = ArtifactVersionsClient(client_wrapper=self._client_wrapper) + return self._artifact_versions - self.docker_registries = AsyncDockerRegistriesClient(client_wrapper=client_wrapper) + @property + def ml(self): + if self._ml is None: + from .ml.client import MlClient # noqa: E402 - self.workflows = AsyncWorkflowsClient(client_wrapper=client_wrapper) + self._ml = MlClient(client_wrapper=self._client_wrapper) + return self._ml - self.artifact_versions = AsyncArtifactVersionsClient(client_wrapper=client_wrapper) - self.ml = AsyncMlClient(client_wrapper=client_wrapper) +class AsyncInternalClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawInternalClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._users: typing.Optional[AsyncUsersClient] = None + self._ai_gateway: typing.Optional[AsyncAiGatewayClient] = None + self._clusters: typing.Optional[AsyncClustersClient] = None + self._deployments: typing.Optional[AsyncDeploymentsClient] = None + self._applications: typing.Optional[AsyncApplicationsClient] = None + self._metrics: typing.Optional[AsyncMetricsClient] = None + self._vcs: typing.Optional[AsyncVcsClient] = None + self._docker_registries: typing.Optional[AsyncDockerRegistriesClient] = None + self._workflows: typing.Optional[AsyncWorkflowsClient] = None + self._artifact_versions: typing.Optional[AsyncArtifactVersionsClient] = None + self._ml: typing.Optional[AsyncMlClient] = None @property def with_raw_response(self) -> AsyncRawInternalClient: @@ -174,3 +248,91 @@ async def main() -> None: """ _response = await self._raw_client.get_id_from_fqn(type, fqn=fqn, request_options=request_options) return _response.data + + @property + def users(self): + if self._users is None: + from .users.client import AsyncUsersClient # noqa: E402 + + self._users = AsyncUsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def ai_gateway(self): + if self._ai_gateway is None: + from .ai_gateway.client import AsyncAiGatewayClient # noqa: E402 + + self._ai_gateway = AsyncAiGatewayClient(client_wrapper=self._client_wrapper) + return self._ai_gateway + + @property + def clusters(self): + if self._clusters is None: + from .clusters.client import AsyncClustersClient # noqa: E402 + + self._clusters = AsyncClustersClient(client_wrapper=self._client_wrapper) + return self._clusters + + @property + def deployments(self): + if self._deployments is None: + from .deployments.client import AsyncDeploymentsClient # noqa: E402 + + self._deployments = AsyncDeploymentsClient(client_wrapper=self._client_wrapper) + return self._deployments + + @property + def applications(self): + if self._applications is None: + from .applications.client import AsyncApplicationsClient # noqa: E402 + + self._applications = AsyncApplicationsClient(client_wrapper=self._client_wrapper) + return self._applications + + @property + def metrics(self): + if self._metrics is None: + from .metrics.client import AsyncMetricsClient # noqa: E402 + + self._metrics = AsyncMetricsClient(client_wrapper=self._client_wrapper) + return self._metrics + + @property + def vcs(self): + if self._vcs is None: + from .vcs.client import AsyncVcsClient # noqa: E402 + + self._vcs = AsyncVcsClient(client_wrapper=self._client_wrapper) + return self._vcs + + @property + def docker_registries(self): + if self._docker_registries is None: + from .docker_registries.client import AsyncDockerRegistriesClient # noqa: E402 + + self._docker_registries = AsyncDockerRegistriesClient(client_wrapper=self._client_wrapper) + return self._docker_registries + + @property + def workflows(self): + if self._workflows is None: + from .workflows.client import AsyncWorkflowsClient # noqa: E402 + + self._workflows = AsyncWorkflowsClient(client_wrapper=self._client_wrapper) + return self._workflows + + @property + def artifact_versions(self): + if self._artifact_versions is None: + from .artifact_versions.client import AsyncArtifactVersionsClient # noqa: E402 + + self._artifact_versions = AsyncArtifactVersionsClient(client_wrapper=self._client_wrapper) + return self._artifact_versions + + @property + def ml(self): + if self._ml is None: + from .ml.client import AsyncMlClient # noqa: E402 + + self._ml = AsyncMlClient(client_wrapper=self._client_wrapper) + return self._ml diff --git a/src/truefoundry_sdk/internal/deployments/client.py b/src/truefoundry_sdk/internal/deployments/client.py index 436e8f06..0b0a46bd 100644 --- a/src/truefoundry_sdk/internal/deployments/client.py +++ b/src/truefoundry_sdk/internal/deployments/client.py @@ -200,6 +200,9 @@ def get_suggested_endpoint( application_type=ApplicationType.ASYNC_SERVICE, application_name="applicationName", workspace_id="workspaceId", + base_domain="baseDomain", + port="port", + prefer_wildcard=True, ) """ _response = self._raw_client.get_suggested_endpoint( @@ -428,6 +431,9 @@ async def main() -> None: application_type=ApplicationType.ASYNC_SERVICE, application_name="applicationName", workspace_id="workspaceId", + base_domain="baseDomain", + port="port", + prefer_wildcard=True, ) diff --git a/src/truefoundry_sdk/internal/docker_registries/__init__.py b/src/truefoundry_sdk/internal/docker_registries/__init__.py index 1f5b5aba..5d663781 100644 --- a/src/truefoundry_sdk/internal/docker_registries/__init__.py +++ b/src/truefoundry_sdk/internal/docker_registries/__init__.py @@ -2,6 +2,36 @@ # isort: skip_file -from .types import DockerRegistriesCreateRepositoryResponse, DockerRegistriesGetCredentialsResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import DockerRegistriesCreateRepositoryResponse, DockerRegistriesGetCredentialsResponse +_dynamic_imports: typing.Dict[str, str] = { + "DockerRegistriesCreateRepositoryResponse": ".types", + "DockerRegistriesGetCredentialsResponse": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["DockerRegistriesCreateRepositoryResponse", "DockerRegistriesGetCredentialsResponse"] diff --git a/src/truefoundry_sdk/internal/docker_registries/client.py b/src/truefoundry_sdk/internal/docker_registries/client.py index fb02cc2d..b96f1594 100644 --- a/src/truefoundry_sdk/internal/docker_registries/client.py +++ b/src/truefoundry_sdk/internal/docker_registries/client.py @@ -110,7 +110,10 @@ def get_credentials( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - client.internal.docker_registries.get_credentials() + client.internal.docker_registries.get_credentials( + fqn="fqn", + cluster_id="clusterId", + ) """ _response = self._raw_client.get_credentials(fqn=fqn, cluster_id=cluster_id, request_options=request_options) return _response.data @@ -227,7 +230,10 @@ async def get_credentials( async def main() -> None: - await client.internal.docker_registries.get_credentials() + await client.internal.docker_registries.get_credentials( + fqn="fqn", + cluster_id="clusterId", + ) asyncio.run(main()) diff --git a/src/truefoundry_sdk/internal/docker_registries/types/__init__.py b/src/truefoundry_sdk/internal/docker_registries/types/__init__.py index d823971e..985a750e 100644 --- a/src/truefoundry_sdk/internal/docker_registries/types/__init__.py +++ b/src/truefoundry_sdk/internal/docker_registries/types/__init__.py @@ -2,7 +2,37 @@ # isort: skip_file -from .docker_registries_create_repository_response import DockerRegistriesCreateRepositoryResponse -from .docker_registries_get_credentials_response import DockerRegistriesGetCredentialsResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .docker_registries_create_repository_response import DockerRegistriesCreateRepositoryResponse + from .docker_registries_get_credentials_response import DockerRegistriesGetCredentialsResponse +_dynamic_imports: typing.Dict[str, str] = { + "DockerRegistriesCreateRepositoryResponse": ".docker_registries_create_repository_response", + "DockerRegistriesGetCredentialsResponse": ".docker_registries_get_credentials_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["DockerRegistriesCreateRepositoryResponse", "DockerRegistriesGetCredentialsResponse"] diff --git a/src/truefoundry_sdk/internal/metrics/__init__.py b/src/truefoundry_sdk/internal/metrics/__init__.py index 8e9f8ba6..64d20cf4 100644 --- a/src/truefoundry_sdk/internal/metrics/__init__.py +++ b/src/truefoundry_sdk/internal/metrics/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import MetricsGetChartsRequestFilterEntity +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import MetricsGetChartsRequestFilterEntity +_dynamic_imports: typing.Dict[str, str] = {"MetricsGetChartsRequestFilterEntity": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["MetricsGetChartsRequestFilterEntity"] diff --git a/src/truefoundry_sdk/internal/metrics/client.py b/src/truefoundry_sdk/internal/metrics/client.py index d88828bc..e7195557 100644 --- a/src/truefoundry_sdk/internal/metrics/client.py +++ b/src/truefoundry_sdk/internal/metrics/client.py @@ -75,7 +75,10 @@ def get_charts( client.internal.metrics.get_charts( workspace_id="workspaceId", application_id="applicationId", + start_ts="startTs", + end_ts="endTs", filter_entity=MetricsGetChartsRequestFilterEntity.APPLICATION, + filter_query="filterQuery", ) """ _response = self._raw_client.get_charts( @@ -161,7 +164,10 @@ async def main() -> None: await client.internal.metrics.get_charts( workspace_id="workspaceId", application_id="applicationId", + start_ts="startTs", + end_ts="endTs", filter_entity=MetricsGetChartsRequestFilterEntity.APPLICATION, + filter_query="filterQuery", ) diff --git a/src/truefoundry_sdk/internal/metrics/types/__init__.py b/src/truefoundry_sdk/internal/metrics/types/__init__.py index eab69463..61d728f1 100644 --- a/src/truefoundry_sdk/internal/metrics/types/__init__.py +++ b/src/truefoundry_sdk/internal/metrics/types/__init__.py @@ -2,6 +2,35 @@ # isort: skip_file -from .metrics_get_charts_request_filter_entity import MetricsGetChartsRequestFilterEntity +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .metrics_get_charts_request_filter_entity import MetricsGetChartsRequestFilterEntity +_dynamic_imports: typing.Dict[str, str] = { + "MetricsGetChartsRequestFilterEntity": ".metrics_get_charts_request_filter_entity" +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["MetricsGetChartsRequestFilterEntity"] diff --git a/src/truefoundry_sdk/internal/ml/__init__.py b/src/truefoundry_sdk/internal/ml/__init__.py index 39d4aabc..5a3880b3 100644 --- a/src/truefoundry_sdk/internal/ml/__init__.py +++ b/src/truefoundry_sdk/internal/ml/__init__.py @@ -2,6 +2,36 @@ # isort: skip_file -from .types import ApplyMlEntityRequestManifest, DeleteMlEntityRequestManifest +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ApplyMlEntityRequestManifest, DeleteMlEntityRequestManifest +_dynamic_imports: typing.Dict[str, str] = { + "ApplyMlEntityRequestManifest": ".types", + "DeleteMlEntityRequestManifest": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["ApplyMlEntityRequestManifest", "DeleteMlEntityRequestManifest"] diff --git a/src/truefoundry_sdk/internal/ml/types/__init__.py b/src/truefoundry_sdk/internal/ml/types/__init__.py index 4137d648..3c2cd021 100644 --- a/src/truefoundry_sdk/internal/ml/types/__init__.py +++ b/src/truefoundry_sdk/internal/ml/types/__init__.py @@ -2,7 +2,37 @@ # isort: skip_file -from .apply_ml_entity_request_manifest import ApplyMlEntityRequestManifest -from .delete_ml_entity_request_manifest import DeleteMlEntityRequestManifest +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .apply_ml_entity_request_manifest import ApplyMlEntityRequestManifest + from .delete_ml_entity_request_manifest import DeleteMlEntityRequestManifest +_dynamic_imports: typing.Dict[str, str] = { + "ApplyMlEntityRequestManifest": ".apply_ml_entity_request_manifest", + "DeleteMlEntityRequestManifest": ".delete_ml_entity_request_manifest", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["ApplyMlEntityRequestManifest", "DeleteMlEntityRequestManifest"] diff --git a/src/truefoundry_sdk/internal/workflows/__init__.py b/src/truefoundry_sdk/internal/workflows/__init__.py index 8e2a5c04..fb6d37ec 100644 --- a/src/truefoundry_sdk/internal/workflows/__init__.py +++ b/src/truefoundry_sdk/internal/workflows/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import WorkflowsExecuteWorkflowResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import WorkflowsExecuteWorkflowResponse +_dynamic_imports: typing.Dict[str, str] = {"WorkflowsExecuteWorkflowResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["WorkflowsExecuteWorkflowResponse"] diff --git a/src/truefoundry_sdk/internal/workflows/types/__init__.py b/src/truefoundry_sdk/internal/workflows/types/__init__.py index 89aacd75..b829ebce 100644 --- a/src/truefoundry_sdk/internal/workflows/types/__init__.py +++ b/src/truefoundry_sdk/internal/workflows/types/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .workflows_execute_workflow_response import WorkflowsExecuteWorkflowResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .workflows_execute_workflow_response import WorkflowsExecuteWorkflowResponse +_dynamic_imports: typing.Dict[str, str] = {"WorkflowsExecuteWorkflowResponse": ".workflows_execute_workflow_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["WorkflowsExecuteWorkflowResponse"] diff --git a/src/truefoundry_sdk/jobs/__init__.py b/src/truefoundry_sdk/jobs/__init__.py index e6e8ab14..877f23f2 100644 --- a/src/truefoundry_sdk/jobs/__init__.py +++ b/src/truefoundry_sdk/jobs/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import TriggerJobRequestInput +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import TriggerJobRequestInput +_dynamic_imports: typing.Dict[str, str] = {"TriggerJobRequestInput": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["TriggerJobRequestInput"] diff --git a/src/truefoundry_sdk/jobs/client.py b/src/truefoundry_sdk/jobs/client.py index 25174f2c..33d1e060 100644 --- a/src/truefoundry_sdk/jobs/client.py +++ b/src/truefoundry_sdk/jobs/client.py @@ -10,8 +10,8 @@ from ..types.job_run import JobRun from ..types.job_run_status import JobRunStatus from ..types.job_runs_sort_by import JobRunsSortBy -from ..types.job_runs_sort_direction import JobRunsSortDirection from ..types.metadata import Metadata +from ..types.sort_direction import SortDirection from ..types.terminate_job_response import TerminateJobResponse from ..types.trigger_job_run_response import TriggerJobRunResponse from .raw_client import AsyncRawJobsClient, RawJobsClient @@ -44,7 +44,7 @@ def list_runs( offset: typing.Optional[int] = 0, search_prefix: typing.Optional[str] = None, sort_by: typing.Optional[JobRunsSortBy] = None, - order: typing.Optional[JobRunsSortDirection] = None, + order: typing.Optional[SortDirection] = None, triggered_by: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None, version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None, @@ -70,7 +70,7 @@ def list_runs( sort_by : typing.Optional[JobRunsSortBy] Attribute to sort by - order : typing.Optional[JobRunsSortDirection] + order : typing.Optional[SortDirection] Sorting order triggered_by : typing.Optional[typing.Union[str, typing.Sequence[str]]] @@ -92,7 +92,7 @@ def list_runs( Examples -------- - from truefoundry_sdk import TrueFoundry + from truefoundry_sdk import JobRunsSortBy, SortDirection, TrueFoundry client = TrueFoundry( api_key="YOUR_API_KEY", @@ -102,6 +102,9 @@ def list_runs( job_id="jobId", limit=10, offset=0, + search_prefix="searchPrefix", + sort_by=JobRunsSortBy.START_TIME, + order=SortDirection.ASC, ) for item in response: yield item @@ -315,7 +318,7 @@ async def list_runs( offset: typing.Optional[int] = 0, search_prefix: typing.Optional[str] = None, sort_by: typing.Optional[JobRunsSortBy] = None, - order: typing.Optional[JobRunsSortDirection] = None, + order: typing.Optional[SortDirection] = None, triggered_by: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None, version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None, @@ -341,7 +344,7 @@ async def list_runs( sort_by : typing.Optional[JobRunsSortBy] Attribute to sort by - order : typing.Optional[JobRunsSortDirection] + order : typing.Optional[SortDirection] Sorting order triggered_by : typing.Optional[typing.Union[str, typing.Sequence[str]]] @@ -365,7 +368,7 @@ async def list_runs( -------- import asyncio - from truefoundry_sdk import AsyncTrueFoundry + from truefoundry_sdk import AsyncTrueFoundry, JobRunsSortBy, SortDirection client = AsyncTrueFoundry( api_key="YOUR_API_KEY", @@ -378,6 +381,9 @@ async def main() -> None: job_id="jobId", limit=10, offset=0, + search_prefix="searchPrefix", + sort_by=JobRunsSortBy.START_TIME, + order=SortDirection.ASC, ) async for item in response: yield item diff --git a/src/truefoundry_sdk/jobs/raw_client.py b/src/truefoundry_sdk/jobs/raw_client.py index a442854a..ed98d5b8 100644 --- a/src/truefoundry_sdk/jobs/raw_client.py +++ b/src/truefoundry_sdk/jobs/raw_client.py @@ -23,9 +23,9 @@ from ..types.job_run import JobRun from ..types.job_run_status import JobRunStatus from ..types.job_runs_sort_by import JobRunsSortBy -from ..types.job_runs_sort_direction import JobRunsSortDirection from ..types.list_job_run_response import ListJobRunResponse from ..types.metadata import Metadata +from ..types.sort_direction import SortDirection from ..types.terminate_job_response import TerminateJobResponse from ..types.trigger_job_run_response import TriggerJobRunResponse from .types.trigger_job_request_input import TriggerJobRequestInput @@ -46,7 +46,7 @@ def list_runs( offset: typing.Optional[int] = 0, search_prefix: typing.Optional[str] = None, sort_by: typing.Optional[JobRunsSortBy] = None, - order: typing.Optional[JobRunsSortDirection] = None, + order: typing.Optional[SortDirection] = None, triggered_by: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None, version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None, @@ -72,7 +72,7 @@ def list_runs( sort_by : typing.Optional[JobRunsSortBy] Attribute to sort by - order : typing.Optional[JobRunsSortDirection] + order : typing.Optional[SortDirection] Sorting order triggered_by : typing.Optional[typing.Union[str, typing.Sequence[str]]] @@ -527,7 +527,7 @@ async def list_runs( offset: typing.Optional[int] = 0, search_prefix: typing.Optional[str] = None, sort_by: typing.Optional[JobRunsSortBy] = None, - order: typing.Optional[JobRunsSortDirection] = None, + order: typing.Optional[SortDirection] = None, triggered_by: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] = None, version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] = None, @@ -553,7 +553,7 @@ async def list_runs( sort_by : typing.Optional[JobRunsSortBy] Attribute to sort by - order : typing.Optional[JobRunsSortDirection] + order : typing.Optional[SortDirection] Sorting order triggered_by : typing.Optional[typing.Union[str, typing.Sequence[str]]] diff --git a/src/truefoundry_sdk/jobs/types/__init__.py b/src/truefoundry_sdk/jobs/types/__init__.py index 6de5a392..9561e642 100644 --- a/src/truefoundry_sdk/jobs/types/__init__.py +++ b/src/truefoundry_sdk/jobs/types/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .trigger_job_request_input import TriggerJobRequestInput +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .trigger_job_request_input import TriggerJobRequestInput +_dynamic_imports: typing.Dict[str, str] = {"TriggerJobRequestInput": ".trigger_job_request_input"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["TriggerJobRequestInput"] diff --git a/src/truefoundry_sdk/llm_gateway/__init__.py b/src/truefoundry_sdk/llm_gateway/__init__.py deleted file mode 100644 index ce4ae85a..00000000 --- a/src/truefoundry_sdk/llm_gateway/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import ( - GuardrailMetersRequestDtoFiltersValue, - GuardrailMetricsChartsDataRequestDtoChartName, - GuardrailMetricsChartsDataRequestDtoFiltersValue, - McpMetersRequestDtoFiltersValue, - McpMetersRequestDtoPage, - McpMetricsChartsDataRequestDtoChartName, - McpMetricsChartsDataRequestDtoFiltersValue, - SvcMcpMetricsGetMcpMetricsChartsRequestPage, - SvcMcpMetricsGetMcpMetricsFiltersRequestPage, -) - -__all__ = [ - "GuardrailMetersRequestDtoFiltersValue", - "GuardrailMetricsChartsDataRequestDtoChartName", - "GuardrailMetricsChartsDataRequestDtoFiltersValue", - "McpMetersRequestDtoFiltersValue", - "McpMetersRequestDtoPage", - "McpMetricsChartsDataRequestDtoChartName", - "McpMetricsChartsDataRequestDtoFiltersValue", - "SvcMcpMetricsGetMcpMetricsChartsRequestPage", - "SvcMcpMetricsGetMcpMetricsFiltersRequestPage", -] diff --git a/src/truefoundry_sdk/llm_gateway/client.py b/src/truefoundry_sdk/llm_gateway/client.py deleted file mode 100644 index 4f105bb1..00000000 --- a/src/truefoundry_sdk/llm_gateway/client.py +++ /dev/null @@ -1,1066 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.guardrail_meters_response_dto import GuardrailMetersResponseDto -from ..types.guardrail_metrics_charts_response_dto import GuardrailMetricsChartsResponseDto -from ..types.guardrail_metrics_filters_response_dto import GuardrailMetricsFiltersResponseDto -from ..types.mcp_meters_response_dto import McpMetersResponseDto -from ..types.mcp_metrics_charts_response_dto import McpMetricsChartsResponseDto -from ..types.mcp_metrics_filters_response_dto import McpMetricsFiltersResponseDto -from ..types.metadata_item import MetadataItem -from .raw_client import AsyncRawLlmGatewayClient, RawLlmGatewayClient -from .types.guardrail_meters_request_dto_filters_value import GuardrailMetersRequestDtoFiltersValue -from .types.guardrail_metrics_charts_data_request_dto_chart_name import GuardrailMetricsChartsDataRequestDtoChartName -from .types.guardrail_metrics_charts_data_request_dto_filters_value import ( - GuardrailMetricsChartsDataRequestDtoFiltersValue, -) -from .types.mcp_meters_request_dto_filters_value import McpMetersRequestDtoFiltersValue -from .types.mcp_meters_request_dto_page import McpMetersRequestDtoPage -from .types.mcp_metrics_charts_data_request_dto_chart_name import McpMetricsChartsDataRequestDtoChartName -from .types.mcp_metrics_charts_data_request_dto_filters_value import McpMetricsChartsDataRequestDtoFiltersValue -from .types.svc_mcp_metrics_get_mcp_metrics_charts_request_page import SvcMcpMetricsGetMcpMetricsChartsRequestPage -from .types.svc_mcp_metrics_get_mcp_metrics_filters_request_page import SvcMcpMetricsGetMcpMetricsFiltersRequestPage - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class LlmGatewayClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawLlmGatewayClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawLlmGatewayClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawLlmGatewayClient - """ - return self._raw_client - - def svc_metrics_get_llm_playground_tables( - self, - *, - start_ts: typing.Optional[str] = OMIT, - end_ts: typing.Optional[str] = OMIT, - model_names: typing.Optional[typing.Sequence[str]] = OMIT, - usernames: typing.Optional[typing.Sequence[str]] = OMIT, - metadata: typing.Optional[typing.Sequence[MetadataItem]] = OMIT, - utc_offset_seconds: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Parameters - ---------- - start_ts : typing.Optional[str] - Start Timestamp in milliseconds - - end_ts : typing.Optional[str] - End Timestamp in milliseconds - - model_names : typing.Optional[typing.Sequence[str]] - Model Names - - usernames : typing.Optional[typing.Sequence[str]] - Usernames - - metadata : typing.Optional[typing.Sequence[MetadataItem]] - - utc_offset_seconds : typing.Optional[str] - UTC Offset in seconds - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_metrics_get_llm_playground_tables() - """ - _response = self._raw_client.svc_metrics_get_llm_playground_tables( - start_ts=start_ts, - end_ts=end_ts, - model_names=model_names, - usernames=usernames, - metadata=metadata, - utc_offset_seconds=utc_offset_seconds, - request_options=request_options, - ) - return _response.data - - def svc_inference_request_get_filter_type_and_label_values( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_inference_request_get_filter_type_and_label_values() - """ - _response = self._raw_client.svc_inference_request_get_filter_type_and_label_values( - request_options=request_options - ) - return _response.data - - def svc_mcp_metrics_get_mcp_metrics_charts( - self, - *, - page: SvcMcpMetricsGetMcpMetricsChartsRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> McpMetricsChartsResponseDto: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - page : SvcMcpMetricsGetMcpMetricsChartsRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - McpMetricsChartsResponseDto - Available MCP metrics charts - - Examples - -------- - from truefoundry_sdk import TrueFoundry - from truefoundry_sdk.llm_gateway import ( - SvcMcpMetricsGetMcpMetricsChartsRequestPage, - ) - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts( - page=SvcMcpMetricsGetMcpMetricsChartsRequestPage.MCPSERVER, - ) - """ - _response = self._raw_client.svc_mcp_metrics_get_mcp_metrics_charts(page=page, request_options=request_options) - return _response.data - - def svc_mcp_metrics_get_mcp_metrics_filters( - self, - *, - start_time: int, - end_time: int, - page: SvcMcpMetricsGetMcpMetricsFiltersRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> McpMetricsFiltersResponseDto: - """ - Retrieves available MCP metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - page : SvcMcpMetricsGetMcpMetricsFiltersRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - McpMetricsFiltersResponseDto - Available MCP metrics filters - - Examples - -------- - from truefoundry_sdk import TrueFoundry - from truefoundry_sdk.llm_gateway import ( - SvcMcpMetricsGetMcpMetricsFiltersRequestPage, - ) - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_filters( - start_time=1710201609, - end_time=1710202200, - page=SvcMcpMetricsGetMcpMetricsFiltersRequestPage.MCPSERVER, - ) - """ - _response = self._raw_client.svc_mcp_metrics_get_mcp_metrics_filters( - start_time=start_time, end_time=end_time, page=page, request_options=request_options - ) - return _response.data - - def svc_mcp_metrics_get_mcp_meters( - self, - *, - page: McpMetersRequestDtoPage, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> McpMetersResponseDto: - """ - Retrieves aggregated MCP metrics data. - - Parameters - ---------- - page : McpMetersRequestDtoPage - Page type. Possible values: "mcpserver" or "tool" - - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - McpMetersResponseDto - Aggregated MCP metrics data - - Examples - -------- - from truefoundry_sdk import TrueFoundry - from truefoundry_sdk.llm_gateway import McpMetersRequestDtoPage - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_mcp_metrics_get_mcp_meters( - page=McpMetersRequestDtoPage.MCPSERVER, - ) - """ - _response = self._raw_client.svc_mcp_metrics_get_mcp_meters( - page=page, start_time=start_time, end_time=end_time, filters=filters, request_options=request_options - ) - return _response.data - - def svc_mcp_metrics_get_mcp_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: McpMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : McpMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from truefoundry_sdk import TrueFoundry - from truefoundry_sdk.llm_gateway import McpMetricsChartsDataRequestDtoChartName - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts_data( - start_time=1710201609, - end_time=1710202200, - chart_name=McpMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_MCP_SERVER, - ) - """ - _response = self._raw_client.svc_mcp_metrics_get_mcp_metrics_charts_data( - start_time=start_time, - end_time=end_time, - chart_name=chart_name, - filters=filters, - request_options=request_options, - ) - return _response.data - - def svc_guardrail_metrics_get_guardrail_metrics_charts( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> GuardrailMetricsChartsResponseDto: - """ - Retrieves available Guardrail metrics charts. - - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GuardrailMetricsChartsResponseDto - Available Guardrail metrics charts - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts() - """ - _response = self._raw_client.svc_guardrail_metrics_get_guardrail_metrics_charts(request_options=request_options) - return _response.data - - def svc_guardrail_metrics_get_guardrail_metrics_filters( - self, *, start_time: int, end_time: int, request_options: typing.Optional[RequestOptions] = None - ) -> GuardrailMetricsFiltersResponseDto: - """ - Retrieves available Guardrail metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GuardrailMetricsFiltersResponseDto - Available Guardrail metrics filters - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_filters( - start_time=1710201609, - end_time=1710202200, - ) - """ - _response = self._raw_client.svc_guardrail_metrics_get_guardrail_metrics_filters( - start_time=start_time, end_time=end_time, request_options=request_options - ) - return _response.data - - def svc_guardrail_metrics_get_guardrail_meters( - self, - *, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> GuardrailMetersResponseDto: - """ - Retrieves aggregated Guardrail metrics data. - - Parameters - ---------- - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GuardrailMetersResponseDto - Aggregated Guardrail metrics data - - Examples - -------- - from truefoundry_sdk import TrueFoundry - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_guardrail_metrics_get_guardrail_meters() - """ - _response = self._raw_client.svc_guardrail_metrics_get_guardrail_meters( - start_time=start_time, end_time=end_time, filters=filters, request_options=request_options - ) - return _response.data - - def svc_guardrail_metrics_get_guardrail_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: GuardrailMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Retrieves Guardrail metrics charts data. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : GuardrailMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from truefoundry_sdk import TrueFoundry - from truefoundry_sdk.llm_gateway import ( - GuardrailMetricsChartsDataRequestDtoChartName, - ) - - client = TrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts_data( - start_time=1710201609, - end_time=1710202200, - chart_name=GuardrailMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_GUARDRAIL, - ) - """ - _response = self._raw_client.svc_guardrail_metrics_get_guardrail_metrics_charts_data( - start_time=start_time, - end_time=end_time, - chart_name=chart_name, - filters=filters, - request_options=request_options, - ) - return _response.data - - -class AsyncLlmGatewayClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawLlmGatewayClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawLlmGatewayClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawLlmGatewayClient - """ - return self._raw_client - - async def svc_metrics_get_llm_playground_tables( - self, - *, - start_ts: typing.Optional[str] = OMIT, - end_ts: typing.Optional[str] = OMIT, - model_names: typing.Optional[typing.Sequence[str]] = OMIT, - usernames: typing.Optional[typing.Sequence[str]] = OMIT, - metadata: typing.Optional[typing.Sequence[MetadataItem]] = OMIT, - utc_offset_seconds: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Parameters - ---------- - start_ts : typing.Optional[str] - Start Timestamp in milliseconds - - end_ts : typing.Optional[str] - End Timestamp in milliseconds - - model_names : typing.Optional[typing.Sequence[str]] - Model Names - - usernames : typing.Optional[typing.Sequence[str]] - Usernames - - metadata : typing.Optional[typing.Sequence[MetadataItem]] - - utc_offset_seconds : typing.Optional[str] - UTC Offset in seconds - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_metrics_get_llm_playground_tables() - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_metrics_get_llm_playground_tables( - start_ts=start_ts, - end_ts=end_ts, - model_names=model_names, - usernames=usernames, - metadata=metadata, - utc_offset_seconds=utc_offset_seconds, - request_options=request_options, - ) - return _response.data - - async def svc_inference_request_get_filter_type_and_label_values( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_inference_request_get_filter_type_and_label_values() - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_inference_request_get_filter_type_and_label_values( - request_options=request_options - ) - return _response.data - - async def svc_mcp_metrics_get_mcp_metrics_charts( - self, - *, - page: SvcMcpMetricsGetMcpMetricsChartsRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> McpMetricsChartsResponseDto: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - page : SvcMcpMetricsGetMcpMetricsChartsRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - McpMetricsChartsResponseDto - Available MCP metrics charts - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - from truefoundry_sdk.llm_gateway import ( - SvcMcpMetricsGetMcpMetricsChartsRequestPage, - ) - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts( - page=SvcMcpMetricsGetMcpMetricsChartsRequestPage.MCPSERVER, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_mcp_metrics_get_mcp_metrics_charts( - page=page, request_options=request_options - ) - return _response.data - - async def svc_mcp_metrics_get_mcp_metrics_filters( - self, - *, - start_time: int, - end_time: int, - page: SvcMcpMetricsGetMcpMetricsFiltersRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> McpMetricsFiltersResponseDto: - """ - Retrieves available MCP metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - page : SvcMcpMetricsGetMcpMetricsFiltersRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - McpMetricsFiltersResponseDto - Available MCP metrics filters - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - from truefoundry_sdk.llm_gateway import ( - SvcMcpMetricsGetMcpMetricsFiltersRequestPage, - ) - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_filters( - start_time=1710201609, - end_time=1710202200, - page=SvcMcpMetricsGetMcpMetricsFiltersRequestPage.MCPSERVER, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_mcp_metrics_get_mcp_metrics_filters( - start_time=start_time, end_time=end_time, page=page, request_options=request_options - ) - return _response.data - - async def svc_mcp_metrics_get_mcp_meters( - self, - *, - page: McpMetersRequestDtoPage, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> McpMetersResponseDto: - """ - Retrieves aggregated MCP metrics data. - - Parameters - ---------- - page : McpMetersRequestDtoPage - Page type. Possible values: "mcpserver" or "tool" - - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - McpMetersResponseDto - Aggregated MCP metrics data - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - from truefoundry_sdk.llm_gateway import McpMetersRequestDtoPage - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_mcp_metrics_get_mcp_meters( - page=McpMetersRequestDtoPage.MCPSERVER, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_mcp_metrics_get_mcp_meters( - page=page, start_time=start_time, end_time=end_time, filters=filters, request_options=request_options - ) - return _response.data - - async def svc_mcp_metrics_get_mcp_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: McpMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : McpMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - from truefoundry_sdk.llm_gateway import McpMetricsChartsDataRequestDtoChartName - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_mcp_metrics_get_mcp_metrics_charts_data( - start_time=1710201609, - end_time=1710202200, - chart_name=McpMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_MCP_SERVER, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_mcp_metrics_get_mcp_metrics_charts_data( - start_time=start_time, - end_time=end_time, - chart_name=chart_name, - filters=filters, - request_options=request_options, - ) - return _response.data - - async def svc_guardrail_metrics_get_guardrail_metrics_charts( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> GuardrailMetricsChartsResponseDto: - """ - Retrieves available Guardrail metrics charts. - - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GuardrailMetricsChartsResponseDto - Available Guardrail metrics charts - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts() - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_guardrail_metrics_get_guardrail_metrics_charts( - request_options=request_options - ) - return _response.data - - async def svc_guardrail_metrics_get_guardrail_metrics_filters( - self, *, start_time: int, end_time: int, request_options: typing.Optional[RequestOptions] = None - ) -> GuardrailMetricsFiltersResponseDto: - """ - Retrieves available Guardrail metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GuardrailMetricsFiltersResponseDto - Available Guardrail metrics filters - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_filters( - start_time=1710201609, - end_time=1710202200, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_guardrail_metrics_get_guardrail_metrics_filters( - start_time=start_time, end_time=end_time, request_options=request_options - ) - return _response.data - - async def svc_guardrail_metrics_get_guardrail_meters( - self, - *, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> GuardrailMetersResponseDto: - """ - Retrieves aggregated Guardrail metrics data. - - Parameters - ---------- - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GuardrailMetersResponseDto - Aggregated Guardrail metrics data - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_guardrail_metrics_get_guardrail_meters() - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_guardrail_metrics_get_guardrail_meters( - start_time=start_time, end_time=end_time, filters=filters, request_options=request_options - ) - return _response.data - - async def svc_guardrail_metrics_get_guardrail_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: GuardrailMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Retrieves Guardrail metrics charts data. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : GuardrailMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from truefoundry_sdk import AsyncTrueFoundry - from truefoundry_sdk.llm_gateway import ( - GuardrailMetricsChartsDataRequestDtoChartName, - ) - - client = AsyncTrueFoundry( - api_key="YOUR_API_KEY", - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.llm_gateway.svc_guardrail_metrics_get_guardrail_metrics_charts_data( - start_time=1710201609, - end_time=1710202200, - chart_name=GuardrailMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_GUARDRAIL, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.svc_guardrail_metrics_get_guardrail_metrics_charts_data( - start_time=start_time, - end_time=end_time, - chart_name=chart_name, - filters=filters, - request_options=request_options, - ) - return _response.data diff --git a/src/truefoundry_sdk/llm_gateway/raw_client.py b/src/truefoundry_sdk/llm_gateway/raw_client.py deleted file mode 100644 index 5982359f..00000000 --- a/src/truefoundry_sdk/llm_gateway/raw_client.py +++ /dev/null @@ -1,1086 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..types.guardrail_meters_response_dto import GuardrailMetersResponseDto -from ..types.guardrail_metrics_charts_response_dto import GuardrailMetricsChartsResponseDto -from ..types.guardrail_metrics_filters_response_dto import GuardrailMetricsFiltersResponseDto -from ..types.mcp_meters_response_dto import McpMetersResponseDto -from ..types.mcp_metrics_charts_response_dto import McpMetricsChartsResponseDto -from ..types.mcp_metrics_filters_response_dto import McpMetricsFiltersResponseDto -from ..types.metadata_item import MetadataItem -from .types.guardrail_meters_request_dto_filters_value import GuardrailMetersRequestDtoFiltersValue -from .types.guardrail_metrics_charts_data_request_dto_chart_name import GuardrailMetricsChartsDataRequestDtoChartName -from .types.guardrail_metrics_charts_data_request_dto_filters_value import ( - GuardrailMetricsChartsDataRequestDtoFiltersValue, -) -from .types.mcp_meters_request_dto_filters_value import McpMetersRequestDtoFiltersValue -from .types.mcp_meters_request_dto_page import McpMetersRequestDtoPage -from .types.mcp_metrics_charts_data_request_dto_chart_name import McpMetricsChartsDataRequestDtoChartName -from .types.mcp_metrics_charts_data_request_dto_filters_value import McpMetricsChartsDataRequestDtoFiltersValue -from .types.svc_mcp_metrics_get_mcp_metrics_charts_request_page import SvcMcpMetricsGetMcpMetricsChartsRequestPage -from .types.svc_mcp_metrics_get_mcp_metrics_filters_request_page import SvcMcpMetricsGetMcpMetricsFiltersRequestPage - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawLlmGatewayClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def svc_metrics_get_llm_playground_tables( - self, - *, - start_ts: typing.Optional[str] = OMIT, - end_ts: typing.Optional[str] = OMIT, - model_names: typing.Optional[typing.Sequence[str]] = OMIT, - usernames: typing.Optional[typing.Sequence[str]] = OMIT, - metadata: typing.Optional[typing.Sequence[MetadataItem]] = OMIT, - utc_offset_seconds: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[None]: - """ - Parameters - ---------- - start_ts : typing.Optional[str] - Start Timestamp in milliseconds - - end_ts : typing.Optional[str] - End Timestamp in milliseconds - - model_names : typing.Optional[typing.Sequence[str]] - Model Names - - usernames : typing.Optional[typing.Sequence[str]] - Usernames - - metadata : typing.Optional[typing.Sequence[MetadataItem]] - - utc_offset_seconds : typing.Optional[str] - UTC Offset in seconds - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/metrics/tables", - method="POST", - json={ - "startTs": start_ts, - "endTs": end_ts, - "modelNames": model_names, - "usernames": usernames, - "metadata": convert_and_respect_annotation_metadata( - object_=metadata, annotation=typing.Sequence[MetadataItem], direction="write" - ), - "utcOffsetSeconds": utc_offset_seconds, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_inference_request_get_filter_type_and_label_values( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/requests/column-details", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_mcp_metrics_get_mcp_metrics_charts( - self, - *, - page: SvcMcpMetricsGetMcpMetricsChartsRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[McpMetricsChartsResponseDto]: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - page : SvcMcpMetricsGetMcpMetricsChartsRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[McpMetricsChartsResponseDto] - Available MCP metrics charts - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/charts", - method="GET", - params={ - "page": page, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - McpMetricsChartsResponseDto, - parse_obj_as( - type_=McpMetricsChartsResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_mcp_metrics_get_mcp_metrics_filters( - self, - *, - start_time: int, - end_time: int, - page: SvcMcpMetricsGetMcpMetricsFiltersRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[McpMetricsFiltersResponseDto]: - """ - Retrieves available MCP metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - page : SvcMcpMetricsGetMcpMetricsFiltersRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[McpMetricsFiltersResponseDto] - Available MCP metrics filters - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/filters", - method="GET", - params={ - "startTime": start_time, - "endTime": end_time, - "page": page, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - McpMetricsFiltersResponseDto, - parse_obj_as( - type_=McpMetricsFiltersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_mcp_metrics_get_mcp_meters( - self, - *, - page: McpMetersRequestDtoPage, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[McpMetersResponseDto]: - """ - Retrieves aggregated MCP metrics data. - - Parameters - ---------- - page : McpMetersRequestDtoPage - Page type. Possible values: "mcpserver" or "tool" - - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[McpMetersResponseDto] - Aggregated MCP metrics data - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/meters", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, annotation=typing.Dict[str, McpMetersRequestDtoFiltersValue], direction="write" - ), - "page": page, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - McpMetersResponseDto, - parse_obj_as( - type_=McpMetersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_mcp_metrics_get_mcp_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: McpMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[None]: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : McpMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/chartsData", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, - annotation=typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue], - direction="write", - ), - "chartName": chart_name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_guardrail_metrics_get_guardrail_metrics_charts( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[GuardrailMetricsChartsResponseDto]: - """ - Retrieves available Guardrail metrics charts. - - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[GuardrailMetricsChartsResponseDto] - Available Guardrail metrics charts - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/charts", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GuardrailMetricsChartsResponseDto, - parse_obj_as( - type_=GuardrailMetricsChartsResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_guardrail_metrics_get_guardrail_metrics_filters( - self, *, start_time: int, end_time: int, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[GuardrailMetricsFiltersResponseDto]: - """ - Retrieves available Guardrail metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[GuardrailMetricsFiltersResponseDto] - Available Guardrail metrics filters - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/filters", - method="GET", - params={ - "startTime": start_time, - "endTime": end_time, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GuardrailMetricsFiltersResponseDto, - parse_obj_as( - type_=GuardrailMetricsFiltersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_guardrail_metrics_get_guardrail_meters( - self, - *, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[GuardrailMetersResponseDto]: - """ - Retrieves aggregated Guardrail metrics data. - - Parameters - ---------- - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[GuardrailMetersResponseDto] - Aggregated Guardrail metrics data - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/meters", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, - annotation=typing.Dict[str, GuardrailMetersRequestDtoFiltersValue], - direction="write", - ), - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GuardrailMetersResponseDto, - parse_obj_as( - type_=GuardrailMetersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def svc_guardrail_metrics_get_guardrail_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: GuardrailMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[None]: - """ - Retrieves Guardrail metrics charts data. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : GuardrailMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/chartsData", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, - annotation=typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue], - direction="write", - ), - "chartName": chart_name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawLlmGatewayClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def svc_metrics_get_llm_playground_tables( - self, - *, - start_ts: typing.Optional[str] = OMIT, - end_ts: typing.Optional[str] = OMIT, - model_names: typing.Optional[typing.Sequence[str]] = OMIT, - usernames: typing.Optional[typing.Sequence[str]] = OMIT, - metadata: typing.Optional[typing.Sequence[MetadataItem]] = OMIT, - utc_offset_seconds: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - start_ts : typing.Optional[str] - Start Timestamp in milliseconds - - end_ts : typing.Optional[str] - End Timestamp in milliseconds - - model_names : typing.Optional[typing.Sequence[str]] - Model Names - - usernames : typing.Optional[typing.Sequence[str]] - Usernames - - metadata : typing.Optional[typing.Sequence[MetadataItem]] - - utc_offset_seconds : typing.Optional[str] - UTC Offset in seconds - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/metrics/tables", - method="POST", - json={ - "startTs": start_ts, - "endTs": end_ts, - "modelNames": model_names, - "usernames": usernames, - "metadata": convert_and_respect_annotation_metadata( - object_=metadata, annotation=typing.Sequence[MetadataItem], direction="write" - ), - "utcOffsetSeconds": utc_offset_seconds, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_inference_request_get_filter_type_and_label_values( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/requests/column-details", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_mcp_metrics_get_mcp_metrics_charts( - self, - *, - page: SvcMcpMetricsGetMcpMetricsChartsRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[McpMetricsChartsResponseDto]: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - page : SvcMcpMetricsGetMcpMetricsChartsRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[McpMetricsChartsResponseDto] - Available MCP metrics charts - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/charts", - method="GET", - params={ - "page": page, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - McpMetricsChartsResponseDto, - parse_obj_as( - type_=McpMetricsChartsResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_mcp_metrics_get_mcp_metrics_filters( - self, - *, - start_time: int, - end_time: int, - page: SvcMcpMetricsGetMcpMetricsFiltersRequestPage, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[McpMetricsFiltersResponseDto]: - """ - Retrieves available MCP metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - page : SvcMcpMetricsGetMcpMetricsFiltersRequestPage - Page type. Possible values: "mcpserver" or "tool" - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[McpMetricsFiltersResponseDto] - Available MCP metrics filters - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/filters", - method="GET", - params={ - "startTime": start_time, - "endTime": end_time, - "page": page, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - McpMetricsFiltersResponseDto, - parse_obj_as( - type_=McpMetricsFiltersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_mcp_metrics_get_mcp_meters( - self, - *, - page: McpMetersRequestDtoPage, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[McpMetersResponseDto]: - """ - Retrieves aggregated MCP metrics data. - - Parameters - ---------- - page : McpMetersRequestDtoPage - Page type. Possible values: "mcpserver" or "tool" - - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, McpMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[McpMetersResponseDto] - Aggregated MCP metrics data - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/meters", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, annotation=typing.Dict[str, McpMetersRequestDtoFiltersValue], direction="write" - ), - "page": page, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - McpMetersResponseDto, - parse_obj_as( - type_=McpMetersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_mcp_metrics_get_mcp_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: McpMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[None]: - """ - Retrieves available MCP metrics charts. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : McpMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/mcp-metrics/chartsData", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, - annotation=typing.Dict[str, McpMetricsChartsDataRequestDtoFiltersValue], - direction="write", - ), - "chartName": chart_name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_guardrail_metrics_get_guardrail_metrics_charts( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[GuardrailMetricsChartsResponseDto]: - """ - Retrieves available Guardrail metrics charts. - - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[GuardrailMetricsChartsResponseDto] - Available Guardrail metrics charts - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/charts", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GuardrailMetricsChartsResponseDto, - parse_obj_as( - type_=GuardrailMetricsChartsResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_guardrail_metrics_get_guardrail_metrics_filters( - self, *, start_time: int, end_time: int, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[GuardrailMetricsFiltersResponseDto]: - """ - Retrieves available Guardrail metrics filters. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[GuardrailMetricsFiltersResponseDto] - Available Guardrail metrics filters - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/filters", - method="GET", - params={ - "startTime": start_time, - "endTime": end_time, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GuardrailMetricsFiltersResponseDto, - parse_obj_as( - type_=GuardrailMetricsFiltersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_guardrail_metrics_get_guardrail_meters( - self, - *, - start_time: typing.Optional[int] = OMIT, - end_time: typing.Optional[int] = OMIT, - filters: typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[GuardrailMetersResponseDto]: - """ - Retrieves aggregated Guardrail metrics data. - - Parameters - ---------- - start_time : typing.Optional[int] - Start time in epoch seconds (e.g., 1710201609) - - end_time : typing.Optional[int] - End time in epoch seconds (e.g., 1710202200) - - filters : typing.Optional[typing.Dict[str, GuardrailMetersRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[GuardrailMetersResponseDto] - Aggregated Guardrail metrics data - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/meters", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, - annotation=typing.Dict[str, GuardrailMetersRequestDtoFiltersValue], - direction="write", - ), - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - GuardrailMetersResponseDto, - parse_obj_as( - type_=GuardrailMetersResponseDto, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def svc_guardrail_metrics_get_guardrail_metrics_charts_data( - self, - *, - start_time: int, - end_time: int, - chart_name: GuardrailMetricsChartsDataRequestDtoChartName, - filters: typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[None]: - """ - Retrieves Guardrail metrics charts data. - - Parameters - ---------- - start_time : int - Start time in epoch seconds (e.g., 1710201609) - - end_time : int - End time in epoch seconds (e.g., 1710202200) - - chart_name : GuardrailMetricsChartsDataRequestDtoChartName - Chart name - - filters : typing.Optional[typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue]] - Map of filterName → filter object - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "api/svc/v1/llm-gateway/guardrail-metrics/chartsData", - method="POST", - json={ - "startTime": start_time, - "endTime": end_time, - "filters": convert_and_respect_annotation_metadata( - object_=filters, - annotation=typing.Dict[str, GuardrailMetricsChartsDataRequestDtoFiltersValue], - direction="write", - ), - "chartName": chart_name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/truefoundry_sdk/llm_gateway/types/__init__.py b/src/truefoundry_sdk/llm_gateway/types/__init__.py deleted file mode 100644 index 30a64aa1..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .guardrail_meters_request_dto_filters_value import GuardrailMetersRequestDtoFiltersValue -from .guardrail_metrics_charts_data_request_dto_chart_name import GuardrailMetricsChartsDataRequestDtoChartName -from .guardrail_metrics_charts_data_request_dto_filters_value import GuardrailMetricsChartsDataRequestDtoFiltersValue -from .mcp_meters_request_dto_filters_value import McpMetersRequestDtoFiltersValue -from .mcp_meters_request_dto_page import McpMetersRequestDtoPage -from .mcp_metrics_charts_data_request_dto_chart_name import McpMetricsChartsDataRequestDtoChartName -from .mcp_metrics_charts_data_request_dto_filters_value import McpMetricsChartsDataRequestDtoFiltersValue -from .svc_mcp_metrics_get_mcp_metrics_charts_request_page import SvcMcpMetricsGetMcpMetricsChartsRequestPage -from .svc_mcp_metrics_get_mcp_metrics_filters_request_page import SvcMcpMetricsGetMcpMetricsFiltersRequestPage - -__all__ = [ - "GuardrailMetersRequestDtoFiltersValue", - "GuardrailMetricsChartsDataRequestDtoChartName", - "GuardrailMetricsChartsDataRequestDtoFiltersValue", - "McpMetersRequestDtoFiltersValue", - "McpMetersRequestDtoPage", - "McpMetricsChartsDataRequestDtoChartName", - "McpMetricsChartsDataRequestDtoFiltersValue", - "SvcMcpMetricsGetMcpMetricsChartsRequestPage", - "SvcMcpMetricsGetMcpMetricsFiltersRequestPage", -] diff --git a/src/truefoundry_sdk/llm_gateway/types/guardrail_meters_request_dto_filters_value.py b/src/truefoundry_sdk/llm_gateway/types/guardrail_meters_request_dto_filters_value.py deleted file mode 100644 index 1a200c5e..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/guardrail_meters_request_dto_filters_value.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.duration_filter import DurationFilter -from ...types.http_status_code_filter import HttpStatusCodeFilter -from ...types.in_filter import InFilter -from ...types.like_filter import LikeFilter - -GuardrailMetersRequestDtoFiltersValue = typing.Union[InFilter, DurationFilter, LikeFilter, HttpStatusCodeFilter] diff --git a/src/truefoundry_sdk/llm_gateway/types/guardrail_metrics_charts_data_request_dto_chart_name.py b/src/truefoundry_sdk/llm_gateway/types/guardrail_metrics_charts_data_request_dto_chart_name.py deleted file mode 100644 index a0e80391..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/guardrail_metrics_charts_data_request_dto_chart_name.py +++ /dev/null @@ -1,49 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class GuardrailMetricsChartsDataRequestDtoChartName(str, enum.Enum): - """ - Chart name - """ - - RATE_OF_REQUESTS_PER_GUARDRAIL = "rateOfRequestsPerGuardrail" - LATENCY_PER_GUARDRAIL = "latencyPerGuardrail" - FLAGGED_RATE_OF_REQUESTS_PER_GUARDRAIL = "flaggedRateOfRequestsPerGuardrail" - MUTATED_RATE_OF_REQUESTS_PER_GUARDRAIL = "mutatedRateOfRequestsPerGuardrail" - INPUT_REQUESTS_BREAKDOWN_PER_GUARDRAIL = "inputRequestsBreakdownPerGuardrail" - OUTPUT_REQUESTS_BREAKDOWN_PER_GUARDRAIL = "outputRequestsBreakdownPerGuardrail" - LATENCY_SUMMARY_PER_GUARDRAIL = "latencySummaryPerGuardrail" - GUARDRAIL_ERRORS = "guardrailErrors" - - def visit( - self, - rate_of_requests_per_guardrail: typing.Callable[[], T_Result], - latency_per_guardrail: typing.Callable[[], T_Result], - flagged_rate_of_requests_per_guardrail: typing.Callable[[], T_Result], - mutated_rate_of_requests_per_guardrail: typing.Callable[[], T_Result], - input_requests_breakdown_per_guardrail: typing.Callable[[], T_Result], - output_requests_breakdown_per_guardrail: typing.Callable[[], T_Result], - latency_summary_per_guardrail: typing.Callable[[], T_Result], - guardrail_errors: typing.Callable[[], T_Result], - ) -> T_Result: - if self is GuardrailMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_GUARDRAIL: - return rate_of_requests_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.LATENCY_PER_GUARDRAIL: - return latency_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.FLAGGED_RATE_OF_REQUESTS_PER_GUARDRAIL: - return flagged_rate_of_requests_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.MUTATED_RATE_OF_REQUESTS_PER_GUARDRAIL: - return mutated_rate_of_requests_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.INPUT_REQUESTS_BREAKDOWN_PER_GUARDRAIL: - return input_requests_breakdown_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.OUTPUT_REQUESTS_BREAKDOWN_PER_GUARDRAIL: - return output_requests_breakdown_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.LATENCY_SUMMARY_PER_GUARDRAIL: - return latency_summary_per_guardrail() - if self is GuardrailMetricsChartsDataRequestDtoChartName.GUARDRAIL_ERRORS: - return guardrail_errors() diff --git a/src/truefoundry_sdk/llm_gateway/types/guardrail_metrics_charts_data_request_dto_filters_value.py b/src/truefoundry_sdk/llm_gateway/types/guardrail_metrics_charts_data_request_dto_filters_value.py deleted file mode 100644 index 27d4ef1f..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/guardrail_metrics_charts_data_request_dto_filters_value.py +++ /dev/null @@ -1,12 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.duration_filter import DurationFilter -from ...types.http_status_code_filter import HttpStatusCodeFilter -from ...types.in_filter import InFilter -from ...types.like_filter import LikeFilter - -GuardrailMetricsChartsDataRequestDtoFiltersValue = typing.Union[ - InFilter, DurationFilter, LikeFilter, HttpStatusCodeFilter -] diff --git a/src/truefoundry_sdk/llm_gateway/types/mcp_meters_request_dto_filters_value.py b/src/truefoundry_sdk/llm_gateway/types/mcp_meters_request_dto_filters_value.py deleted file mode 100644 index 0919a5a1..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/mcp_meters_request_dto_filters_value.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.duration_filter import DurationFilter -from ...types.http_status_code_filter import HttpStatusCodeFilter -from ...types.in_filter import InFilter -from ...types.like_filter import LikeFilter - -McpMetersRequestDtoFiltersValue = typing.Union[InFilter, DurationFilter, LikeFilter, HttpStatusCodeFilter] diff --git a/src/truefoundry_sdk/llm_gateway/types/mcp_meters_request_dto_page.py b/src/truefoundry_sdk/llm_gateway/types/mcp_meters_request_dto_page.py deleted file mode 100644 index 7ecb9030..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/mcp_meters_request_dto_page.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class McpMetersRequestDtoPage(str, enum.Enum): - """ - Page type. Possible values: "mcpserver" or "tool" - """ - - MCPSERVER = "mcpserver" - TOOL = "tool" - - def visit(self, mcpserver: typing.Callable[[], T_Result], tool: typing.Callable[[], T_Result]) -> T_Result: - if self is McpMetersRequestDtoPage.MCPSERVER: - return mcpserver() - if self is McpMetersRequestDtoPage.TOOL: - return tool() diff --git a/src/truefoundry_sdk/llm_gateway/types/mcp_metrics_charts_data_request_dto_chart_name.py b/src/truefoundry_sdk/llm_gateway/types/mcp_metrics_charts_data_request_dto_chart_name.py deleted file mode 100644 index dc60010b..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/mcp_metrics_charts_data_request_dto_chart_name.py +++ /dev/null @@ -1,49 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class McpMetricsChartsDataRequestDtoChartName(str, enum.Enum): - """ - Chart name - """ - - RATE_OF_REQUESTS_PER_MCP_SERVER = "rateOfRequestsPerMcpServer" - LATENCY_PER_MCP_SERVER = "latencyPerMcpServer" - MCP_SERVER_ERRORS = "mcpServerErrors" - RATE_OF_REQUESTS_PER_TOOL = "rateOfRequestsPerTool" - LATENCY_PER_TOOL = "latencyPerTool" - TOOL_ERRORS = "toolErrors" - LATENCY_SUMMARY_PER_TOOL = "latencySummaryPerTool" - REQUESTS_PER_TOOL = "requestsPerTool" - - def visit( - self, - rate_of_requests_per_mcp_server: typing.Callable[[], T_Result], - latency_per_mcp_server: typing.Callable[[], T_Result], - mcp_server_errors: typing.Callable[[], T_Result], - rate_of_requests_per_tool: typing.Callable[[], T_Result], - latency_per_tool: typing.Callable[[], T_Result], - tool_errors: typing.Callable[[], T_Result], - latency_summary_per_tool: typing.Callable[[], T_Result], - requests_per_tool: typing.Callable[[], T_Result], - ) -> T_Result: - if self is McpMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_MCP_SERVER: - return rate_of_requests_per_mcp_server() - if self is McpMetricsChartsDataRequestDtoChartName.LATENCY_PER_MCP_SERVER: - return latency_per_mcp_server() - if self is McpMetricsChartsDataRequestDtoChartName.MCP_SERVER_ERRORS: - return mcp_server_errors() - if self is McpMetricsChartsDataRequestDtoChartName.RATE_OF_REQUESTS_PER_TOOL: - return rate_of_requests_per_tool() - if self is McpMetricsChartsDataRequestDtoChartName.LATENCY_PER_TOOL: - return latency_per_tool() - if self is McpMetricsChartsDataRequestDtoChartName.TOOL_ERRORS: - return tool_errors() - if self is McpMetricsChartsDataRequestDtoChartName.LATENCY_SUMMARY_PER_TOOL: - return latency_summary_per_tool() - if self is McpMetricsChartsDataRequestDtoChartName.REQUESTS_PER_TOOL: - return requests_per_tool() diff --git a/src/truefoundry_sdk/llm_gateway/types/mcp_metrics_charts_data_request_dto_filters_value.py b/src/truefoundry_sdk/llm_gateway/types/mcp_metrics_charts_data_request_dto_filters_value.py deleted file mode 100644 index 95416ddf..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/mcp_metrics_charts_data_request_dto_filters_value.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.duration_filter import DurationFilter -from ...types.http_status_code_filter import HttpStatusCodeFilter -from ...types.in_filter import InFilter -from ...types.like_filter import LikeFilter - -McpMetricsChartsDataRequestDtoFiltersValue = typing.Union[InFilter, DurationFilter, LikeFilter, HttpStatusCodeFilter] diff --git a/src/truefoundry_sdk/llm_gateway/types/svc_mcp_metrics_get_mcp_metrics_charts_request_page.py b/src/truefoundry_sdk/llm_gateway/types/svc_mcp_metrics_get_mcp_metrics_charts_request_page.py deleted file mode 100644 index 70209e3e..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/svc_mcp_metrics_get_mcp_metrics_charts_request_page.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class SvcMcpMetricsGetMcpMetricsChartsRequestPage(str, enum.Enum): - MCPSERVER = "mcpserver" - TOOL = "tool" - - def visit(self, mcpserver: typing.Callable[[], T_Result], tool: typing.Callable[[], T_Result]) -> T_Result: - if self is SvcMcpMetricsGetMcpMetricsChartsRequestPage.MCPSERVER: - return mcpserver() - if self is SvcMcpMetricsGetMcpMetricsChartsRequestPage.TOOL: - return tool() diff --git a/src/truefoundry_sdk/llm_gateway/types/svc_mcp_metrics_get_mcp_metrics_filters_request_page.py b/src/truefoundry_sdk/llm_gateway/types/svc_mcp_metrics_get_mcp_metrics_filters_request_page.py deleted file mode 100644 index 75d679df..00000000 --- a/src/truefoundry_sdk/llm_gateway/types/svc_mcp_metrics_get_mcp_metrics_filters_request_page.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class SvcMcpMetricsGetMcpMetricsFiltersRequestPage(str, enum.Enum): - MCPSERVER = "mcpserver" - TOOL = "tool" - - def visit(self, mcpserver: typing.Callable[[], T_Result], tool: typing.Callable[[], T_Result]) -> T_Result: - if self is SvcMcpMetricsGetMcpMetricsFiltersRequestPage.MCPSERVER: - return mcpserver() - if self is SvcMcpMetricsGetMcpMetricsFiltersRequestPage.TOOL: - return tool() diff --git a/src/truefoundry_sdk/logs/client.py b/src/truefoundry_sdk/logs/client.py index 095048e1..bb677537 100644 --- a/src/truefoundry_sdk/logs/client.py +++ b/src/truefoundry_sdk/logs/client.py @@ -114,13 +114,35 @@ def get( Examples -------- - from truefoundry_sdk import TrueFoundry + from truefoundry_sdk import ( + LogsSearchFilterType, + LogsSearchOperatorType, + LogsSortingDirection, + TrueFoundry, + ) client = TrueFoundry( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - client.logs.get() + client.logs.get( + start_ts=1000000, + end_ts=1000000, + limit=1, + direction=LogsSortingDirection.ASC, + num_logs_to_ignore=1, + application_id="applicationId", + application_fqn="applicationFqn", + deployment_id="deploymentId", + job_run_name="jobRunName", + pod_name="podName", + container_name="containerName", + pod_names_regex="podNamesRegex", + search_filters="searchFilters", + search_string="searchString", + search_type=LogsSearchFilterType.REGEX, + search_operator=LogsSearchOperatorType.EQUAL, + ) """ _response = self._raw_client.get( start_ts=start_ts, @@ -250,7 +272,12 @@ async def get( -------- import asyncio - from truefoundry_sdk import AsyncTrueFoundry + from truefoundry_sdk import ( + AsyncTrueFoundry, + LogsSearchFilterType, + LogsSearchOperatorType, + LogsSortingDirection, + ) client = AsyncTrueFoundry( api_key="YOUR_API_KEY", @@ -259,7 +286,24 @@ async def get( async def main() -> None: - await client.logs.get() + await client.logs.get( + start_ts=1000000, + end_ts=1000000, + limit=1, + direction=LogsSortingDirection.ASC, + num_logs_to_ignore=1, + application_id="applicationId", + application_fqn="applicationFqn", + deployment_id="deploymentId", + job_run_name="jobRunName", + pod_name="podName", + container_name="containerName", + pod_names_regex="podNamesRegex", + search_filters="searchFilters", + search_string="searchString", + search_type=LogsSearchFilterType.REGEX, + search_operator=LogsSearchOperatorType.EQUAL, + ) asyncio.run(main()) diff --git a/src/truefoundry_sdk/ml_repos/client.py b/src/truefoundry_sdk/ml_repos/client.py index c08a73e4..4e69c54e 100644 --- a/src/truefoundry_sdk/ml_repos/client.py +++ b/src/truefoundry_sdk/ml_repos/client.py @@ -188,7 +188,11 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.ml_repos.list() + response = client.ml_repos.list( + name="name", + limit=1, + offset=1, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -400,7 +404,11 @@ async def list( async def main() -> None: - response = await client.ml_repos.list() + response = await client.ml_repos.list( + name="name", + limit=1, + offset=1, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/model_versions/client.py b/src/truefoundry_sdk/model_versions/client.py index 9396d444..9dfc8721 100644 --- a/src/truefoundry_sdk/model_versions/client.py +++ b/src/truefoundry_sdk/model_versions/client.py @@ -193,7 +193,17 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.model_versions.list() + response = client.model_versions.list( + tag="tag", + fqn="fqn", + model_id="model_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -424,7 +434,17 @@ async def list( async def main() -> None: - response = await client.model_versions.list() + response = await client.model_versions.list( + tag="tag", + fqn="fqn", + model_id="model_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + include_internal_metadata=True, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/models/client.py b/src/truefoundry_sdk/models/client.py index 704fd3f6..caf2f38d 100644 --- a/src/truefoundry_sdk/models/client.py +++ b/src/truefoundry_sdk/models/client.py @@ -131,7 +131,14 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.models.list() + response = client.models.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + run_id="run_id", + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -321,7 +328,14 @@ async def list( async def main() -> None: - response = await client.models.list() + response = await client.models.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + run_id="run_id", + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/prompt_versions/client.py b/src/truefoundry_sdk/prompt_versions/client.py index 6ba5c3b1..36381e77 100644 --- a/src/truefoundry_sdk/prompt_versions/client.py +++ b/src/truefoundry_sdk/prompt_versions/client.py @@ -184,7 +184,16 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.prompt_versions.list() + response = client.prompt_versions.list( + tag="tag", + fqn="fqn", + prompt_id="prompt_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -405,7 +414,16 @@ async def list( async def main() -> None: - response = await client.prompt_versions.list() + response = await client.prompt_versions.list( + tag="tag", + fqn="fqn", + prompt_id="prompt_id", + ml_repo_id="ml_repo_id", + name="name", + version=1, + offset=1, + limit=1, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/prompts/client.py b/src/truefoundry_sdk/prompts/client.py index c8a1c012..f19e4110 100644 --- a/src/truefoundry_sdk/prompts/client.py +++ b/src/truefoundry_sdk/prompts/client.py @@ -128,7 +128,13 @@ def list( api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", ) - response = client.prompts.list() + response = client.prompts.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -313,7 +319,13 @@ async def list( async def main() -> None: - response = await client.prompts.list() + response = await client.prompts.list( + fqn="fqn", + ml_repo_id="ml_repo_id", + name="name", + offset=1, + limit=1, + ) async for item in response: yield item diff --git a/src/truefoundry_sdk/secret_groups/client.py b/src/truefoundry_sdk/secret_groups/client.py index 57994596..149dc169 100644 --- a/src/truefoundry_sdk/secret_groups/client.py +++ b/src/truefoundry_sdk/secret_groups/client.py @@ -76,6 +76,8 @@ def list( response = client.secret_groups.list( limit=10, offset=0, + fqn="fqn", + search="search", ) for item in response: yield item @@ -316,6 +318,8 @@ async def main() -> None: response = await client.secret_groups.list( limit=10, offset=0, + fqn="fqn", + search="search", ) async for item in response: yield item diff --git a/src/truefoundry_sdk/teams/__init__.py b/src/truefoundry_sdk/teams/__init__.py index 3b0b7384..66cab5e2 100644 --- a/src/truefoundry_sdk/teams/__init__.py +++ b/src/truefoundry_sdk/teams/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import ApplyTeamRequestManifest, TeamsListRequestType +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ApplyTeamRequestManifest, TeamsListRequestType +_dynamic_imports: typing.Dict[str, str] = {"ApplyTeamRequestManifest": ".types", "TeamsListRequestType": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["ApplyTeamRequestManifest", "TeamsListRequestType"] diff --git a/src/truefoundry_sdk/teams/client.py b/src/truefoundry_sdk/teams/client.py index bbfdc2de..ea3e97be 100644 --- a/src/truefoundry_sdk/teams/client.py +++ b/src/truefoundry_sdk/teams/client.py @@ -64,6 +64,7 @@ def list( Examples -------- from truefoundry_sdk import TrueFoundry + from truefoundry_sdk.teams import TeamsListRequestType client = TrueFoundry( api_key="YOUR_API_KEY", @@ -72,6 +73,7 @@ def list( response = client.teams.list( limit=10, offset=0, + type=TeamsListRequestType.TEAM, ) for item in response: yield item @@ -242,6 +244,7 @@ async def list( import asyncio from truefoundry_sdk import AsyncTrueFoundry + from truefoundry_sdk.teams import TeamsListRequestType client = AsyncTrueFoundry( api_key="YOUR_API_KEY", @@ -253,6 +256,7 @@ async def main() -> None: response = await client.teams.list( limit=10, offset=0, + type=TeamsListRequestType.TEAM, ) async for item in response: yield item diff --git a/src/truefoundry_sdk/teams/types/__init__.py b/src/truefoundry_sdk/teams/types/__init__.py index 91edce23..ebf7ae42 100644 --- a/src/truefoundry_sdk/teams/types/__init__.py +++ b/src/truefoundry_sdk/teams/types/__init__.py @@ -2,7 +2,37 @@ # isort: skip_file -from .apply_team_request_manifest import ApplyTeamRequestManifest -from .teams_list_request_type import TeamsListRequestType +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .apply_team_request_manifest import ApplyTeamRequestManifest + from .teams_list_request_type import TeamsListRequestType +_dynamic_imports: typing.Dict[str, str] = { + "ApplyTeamRequestManifest": ".apply_team_request_manifest", + "TeamsListRequestType": ".teams_list_request_type", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["ApplyTeamRequestManifest", "TeamsListRequestType"] diff --git a/src/truefoundry_sdk/alerts/__init__.py b/src/truefoundry_sdk/traces/__init__.py similarity index 100% rename from src/truefoundry_sdk/alerts/__init__.py rename to src/truefoundry_sdk/traces/__init__.py diff --git a/src/truefoundry_sdk/traces/client.py b/src/truefoundry_sdk/traces/client.py new file mode 100644 index 00000000..98adcf28 --- /dev/null +++ b/src/truefoundry_sdk/traces/client.py @@ -0,0 +1,251 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.pagination import AsyncPager, SyncPager +from ..core.request_options import RequestOptions +from ..types.sort_direction import SortDirection +from ..types.trace_span import TraceSpan +from ..types.traces_subject_type import TracesSubjectType +from .raw_client import AsyncRawTracesClient, RawTracesClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class TracesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawTracesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawTracesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawTracesClient + """ + return self._raw_client + + def query_spans( + self, + *, + start_time: str, + tracing_project_fqn: str, + end_time: typing.Optional[str] = OMIT, + trace_ids: typing.Optional[typing.Sequence[str]] = OMIT, + span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + parent_span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + created_by_subject_types: typing.Optional[typing.Sequence[TracesSubjectType]] = OMIT, + created_by_subject_slugs: typing.Optional[typing.Sequence[str]] = OMIT, + application_names: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + sort_direction: typing.Optional[SortDirection] = OMIT, + page_token: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[TraceSpan]: + """ + Parameters + ---------- + start_time : str + Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z) + + tracing_project_fqn : str + Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default) + + end_time : typing.Optional[str] + End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided. + + trace_ids : typing.Optional[typing.Sequence[str]] + Array of trace IDs to filter by + + span_ids : typing.Optional[typing.Sequence[str]] + Array of span IDs to filter by + + parent_span_ids : typing.Optional[typing.Sequence[str]] + Array of parent span IDs to filter by + + created_by_subject_types : typing.Optional[typing.Sequence[TracesSubjectType]] + Array of subject types to filter by + + created_by_subject_slugs : typing.Optional[typing.Sequence[str]] + Array of subject slugs to filter by + + application_names : typing.Optional[typing.Sequence[str]] + Array of application names to filter by + + limit : typing.Optional[int] + The maximum number of spans to return per page. Defaults to 200 if not provided. + + sort_direction : typing.Optional[SortDirection] + Sort direction for results. Defaults to desc. + + page_token : typing.Optional[str] + Base64 encoded page token for pagination + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[TraceSpan] + Returns filtered spans with attributes + + Examples + -------- + from truefoundry_sdk import TrueFoundry + + client = TrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + response = client.traces.query_spans( + start_time="startTime", + tracing_project_fqn="tracingProjectFqn", + ) + for item in response: + yield item + # alternatively, you can paginate page-by-page + for page in response.iter_pages(): + yield page + """ + return self._raw_client.query_spans( + start_time=start_time, + tracing_project_fqn=tracing_project_fqn, + end_time=end_time, + trace_ids=trace_ids, + span_ids=span_ids, + parent_span_ids=parent_span_ids, + created_by_subject_types=created_by_subject_types, + created_by_subject_slugs=created_by_subject_slugs, + application_names=application_names, + limit=limit, + sort_direction=sort_direction, + page_token=page_token, + request_options=request_options, + ) + + +class AsyncTracesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawTracesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawTracesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawTracesClient + """ + return self._raw_client + + async def query_spans( + self, + *, + start_time: str, + tracing_project_fqn: str, + end_time: typing.Optional[str] = OMIT, + trace_ids: typing.Optional[typing.Sequence[str]] = OMIT, + span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + parent_span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + created_by_subject_types: typing.Optional[typing.Sequence[TracesSubjectType]] = OMIT, + created_by_subject_slugs: typing.Optional[typing.Sequence[str]] = OMIT, + application_names: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + sort_direction: typing.Optional[SortDirection] = OMIT, + page_token: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[TraceSpan]: + """ + Parameters + ---------- + start_time : str + Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z) + + tracing_project_fqn : str + Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default) + + end_time : typing.Optional[str] + End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided. + + trace_ids : typing.Optional[typing.Sequence[str]] + Array of trace IDs to filter by + + span_ids : typing.Optional[typing.Sequence[str]] + Array of span IDs to filter by + + parent_span_ids : typing.Optional[typing.Sequence[str]] + Array of parent span IDs to filter by + + created_by_subject_types : typing.Optional[typing.Sequence[TracesSubjectType]] + Array of subject types to filter by + + created_by_subject_slugs : typing.Optional[typing.Sequence[str]] + Array of subject slugs to filter by + + application_names : typing.Optional[typing.Sequence[str]] + Array of application names to filter by + + limit : typing.Optional[int] + The maximum number of spans to return per page. Defaults to 200 if not provided. + + sort_direction : typing.Optional[SortDirection] + Sort direction for results. Defaults to desc. + + page_token : typing.Optional[str] + Base64 encoded page token for pagination + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[TraceSpan] + Returns filtered spans with attributes + + Examples + -------- + import asyncio + + from truefoundry_sdk import AsyncTrueFoundry + + client = AsyncTrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + response = await client.traces.query_spans( + start_time="startTime", + tracing_project_fqn="tracingProjectFqn", + ) + async for item in response: + yield item + + # alternatively, you can paginate page-by-page + async for page in response.iter_pages(): + yield page + + + asyncio.run(main()) + """ + return await self._raw_client.query_spans( + start_time=start_time, + tracing_project_fqn=tracing_project_fqn, + end_time=end_time, + trace_ids=trace_ids, + span_ids=span_ids, + parent_span_ids=parent_span_ids, + created_by_subject_types=created_by_subject_types, + created_by_subject_slugs=created_by_subject_slugs, + application_names=application_names, + limit=limit, + sort_direction=sort_direction, + page_token=page_token, + request_options=request_options, + ) diff --git a/src/truefoundry_sdk/traces/raw_client.py b/src/truefoundry_sdk/traces/raw_client.py new file mode 100644 index 00000000..2db1bd8a --- /dev/null +++ b/src/truefoundry_sdk/traces/raw_client.py @@ -0,0 +1,280 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..types.query_spans_response import QuerySpansResponse +from ..types.sort_direction import SortDirection +from ..types.trace_span import TraceSpan +from ..types.traces_subject_type import TracesSubjectType + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawTracesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def query_spans( + self, + *, + start_time: str, + tracing_project_fqn: str, + end_time: typing.Optional[str] = OMIT, + trace_ids: typing.Optional[typing.Sequence[str]] = OMIT, + span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + parent_span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + created_by_subject_types: typing.Optional[typing.Sequence[TracesSubjectType]] = OMIT, + created_by_subject_slugs: typing.Optional[typing.Sequence[str]] = OMIT, + application_names: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + sort_direction: typing.Optional[SortDirection] = OMIT, + page_token: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SyncPager[TraceSpan]: + """ + Parameters + ---------- + start_time : str + Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z) + + tracing_project_fqn : str + Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default) + + end_time : typing.Optional[str] + End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided. + + trace_ids : typing.Optional[typing.Sequence[str]] + Array of trace IDs to filter by + + span_ids : typing.Optional[typing.Sequence[str]] + Array of span IDs to filter by + + parent_span_ids : typing.Optional[typing.Sequence[str]] + Array of parent span IDs to filter by + + created_by_subject_types : typing.Optional[typing.Sequence[TracesSubjectType]] + Array of subject types to filter by + + created_by_subject_slugs : typing.Optional[typing.Sequence[str]] + Array of subject slugs to filter by + + application_names : typing.Optional[typing.Sequence[str]] + Array of application names to filter by + + limit : typing.Optional[int] + The maximum number of spans to return per page. Defaults to 200 if not provided. + + sort_direction : typing.Optional[SortDirection] + Sort direction for results. Defaults to desc. + + page_token : typing.Optional[str] + Base64 encoded page token for pagination + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SyncPager[TraceSpan] + Returns filtered spans with attributes + """ + _response = self._client_wrapper.httpx_client.request( + "api/svc/v1/spans/query", + method="POST", + json={ + "startTime": start_time, + "endTime": end_time, + "traceIds": trace_ids, + "spanIds": span_ids, + "parentSpanIds": parent_span_ids, + "createdBySubjectTypes": created_by_subject_types, + "createdBySubjectSlugs": created_by_subject_slugs, + "applicationNames": application_names, + "limit": limit, + "sortDirection": sort_direction, + "pageToken": page_token, + "tracingProjectFqn": tracing_project_fqn, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + QuerySpansResponse, + parse_obj_as( + type_=QuerySpansResponse, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.data + _has_next = False + _get_next = None + if _parsed_response.pagination is not None: + _parsed_next = _parsed_response.pagination.next_page_token + _has_next = _parsed_next is not None and _parsed_next != "" + _get_next = lambda: self.query_spans( + start_time=start_time, + tracing_project_fqn=tracing_project_fqn, + end_time=end_time, + trace_ids=trace_ids, + span_ids=span_ids, + parent_span_ids=parent_span_ids, + created_by_subject_types=created_by_subject_types, + created_by_subject_slugs=created_by_subject_slugs, + application_names=application_names, + limit=limit, + sort_direction=sort_direction, + page_token=_parsed_next, + request_options=request_options, + ) + return SyncPager( + has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawTracesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def query_spans( + self, + *, + start_time: str, + tracing_project_fqn: str, + end_time: typing.Optional[str] = OMIT, + trace_ids: typing.Optional[typing.Sequence[str]] = OMIT, + span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + parent_span_ids: typing.Optional[typing.Sequence[str]] = OMIT, + created_by_subject_types: typing.Optional[typing.Sequence[TracesSubjectType]] = OMIT, + created_by_subject_slugs: typing.Optional[typing.Sequence[str]] = OMIT, + application_names: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + sort_direction: typing.Optional[SortDirection] = OMIT, + page_token: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncPager[TraceSpan]: + """ + Parameters + ---------- + start_time : str + Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z) + + tracing_project_fqn : str + Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default) + + end_time : typing.Optional[str] + End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided. + + trace_ids : typing.Optional[typing.Sequence[str]] + Array of trace IDs to filter by + + span_ids : typing.Optional[typing.Sequence[str]] + Array of span IDs to filter by + + parent_span_ids : typing.Optional[typing.Sequence[str]] + Array of parent span IDs to filter by + + created_by_subject_types : typing.Optional[typing.Sequence[TracesSubjectType]] + Array of subject types to filter by + + created_by_subject_slugs : typing.Optional[typing.Sequence[str]] + Array of subject slugs to filter by + + application_names : typing.Optional[typing.Sequence[str]] + Array of application names to filter by + + limit : typing.Optional[int] + The maximum number of spans to return per page. Defaults to 200 if not provided. + + sort_direction : typing.Optional[SortDirection] + Sort direction for results. Defaults to desc. + + page_token : typing.Optional[str] + Base64 encoded page token for pagination + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPager[TraceSpan] + Returns filtered spans with attributes + """ + _response = await self._client_wrapper.httpx_client.request( + "api/svc/v1/spans/query", + method="POST", + json={ + "startTime": start_time, + "endTime": end_time, + "traceIds": trace_ids, + "spanIds": span_ids, + "parentSpanIds": parent_span_ids, + "createdBySubjectTypes": created_by_subject_types, + "createdBySubjectSlugs": created_by_subject_slugs, + "applicationNames": application_names, + "limit": limit, + "sortDirection": sort_direction, + "pageToken": page_token, + "tracingProjectFqn": tracing_project_fqn, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _parsed_response = typing.cast( + QuerySpansResponse, + parse_obj_as( + type_=QuerySpansResponse, # type: ignore + object_=_response.json(), + ), + ) + _items = _parsed_response.data + _has_next = False + _get_next = None + if _parsed_response.pagination is not None: + _parsed_next = _parsed_response.pagination.next_page_token + _has_next = _parsed_next is not None and _parsed_next != "" + + async def _get_next(): + return await self.query_spans( + start_time=start_time, + tracing_project_fqn=tracing_project_fqn, + end_time=end_time, + trace_ids=trace_ids, + span_ids=span_ids, + parent_span_ids=parent_span_ids, + created_by_subject_types=created_by_subject_types, + created_by_subject_slugs=created_by_subject_slugs, + application_names=application_names, + limit=limit, + sort_direction=sort_direction, + page_token=_parsed_next, + request_options=request_options, + ) + + return AsyncPager( + has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/truefoundry_sdk/types/__init__.py b/src/truefoundry_sdk/types/__init__.py index d38a9b4a..59cd6754 100644 --- a/src/truefoundry_sdk/types/__init__.py +++ b/src/truefoundry_sdk/types/__init__.py @@ -2,776 +2,1530 @@ # isort: skip_file -from .resources import Resources -from .resources_devices_item import ResourcesDevicesItem -from .resources_node import ResourcesNode -from .activate_user_response import ActivateUserResponse -from .add_on_component_source import AddOnComponentSource -from .addon_component import AddonComponent -from .addon_component_name import AddonComponentName -from .addon_component_status import AddonComponentStatus -from .ai21integrations import Ai21Integrations -from .ai21key_auth import Ai21KeyAuth -from .ai21model import Ai21Model -from .ai21provider_account import Ai21ProviderAccount -from .ai_features_settings import AiFeaturesSettings -from .alert import Alert -from .alert_config import AlertConfig -from .alert_config_resource import AlertConfigResource -from .alert_config_resource_type import AlertConfigResourceType -from .alert_severity import AlertSeverity -from .alert_status import AlertStatus -from .amqp_input_config import AmqpInputConfig -from .amqp_metric_config import AmqpMetricConfig -from .amqp_output_config import AmqpOutputConfig -from .anthropic_integrations import AnthropicIntegrations -from .anthropic_key_auth import AnthropicKeyAuth -from .anthropic_model import AnthropicModel -from .anthropic_provider_account import AnthropicProviderAccount -from .application import Application -from .application_debug_info import ApplicationDebugInfo -from .application_lifecycle_stage import ApplicationLifecycleStage -from .application_metadata import ApplicationMetadata -from .application_problem import ApplicationProblem -from .application_set import ApplicationSet -from .application_set_components_item import ApplicationSetComponentsItem -from .application_type import ApplicationType -from .apply_ml_entity_response import ApplyMlEntityResponse -from .apply_ml_entity_response_data import ApplyMlEntityResponseData -from .artifact import Artifact -from .artifact_manifest import ArtifactManifest -from .artifact_manifest_source import ArtifactManifestSource -from .artifact_path import ArtifactPath -from .artifact_type import ArtifactType -from .artifact_version import ArtifactVersion -from .artifacts_cache_volume import ArtifactsCacheVolume -from .artifacts_download import ArtifactsDownload -from .artifacts_download_artifacts_item import ArtifactsDownloadArtifactsItem -from .assistant_message import AssistantMessage -from .assistant_message_content import AssistantMessageContent -from .assistant_message_content_item import AssistantMessageContentItem -from .async_processor_sidecar import AsyncProcessorSidecar -from .async_service import AsyncService -from .async_service_autoscaling import AsyncServiceAutoscaling -from .async_service_autoscaling_metrics import AsyncServiceAutoscalingMetrics -from .async_service_replicas import AsyncServiceReplicas -from .auto_rotate import AutoRotate -from .autoshutdown import Autoshutdown -from .aws_access_key_auth import AwsAccessKeyAuth -from .aws_access_key_based_auth import AwsAccessKeyBasedAuth -from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth -from .aws_bedrock_guardrail_config import AwsBedrockGuardrailConfig -from .aws_bedrock_guardrail_config_auth_data import AwsBedrockGuardrailConfigAuthData -from .aws_bedrock_guardrail_config_operation import AwsBedrockGuardrailConfigOperation -from .aws_bedrock_provider_account import AwsBedrockProviderAccount -from .aws_bedrock_provider_account_auth_data import AwsBedrockProviderAccountAuthData -from .aws_ecr import AwsEcr -from .aws_ecr_auth_data import AwsEcrAuthData -from .aws_eks_integration import AwsEksIntegration -from .aws_eks_integration_auth_data import AwsEksIntegrationAuthData -from .aws_inferentia import AwsInferentia -from .aws_integrations import AwsIntegrations -from .aws_parameter_store import AwsParameterStore -from .aws_parameter_store_auth_data import AwsParameterStoreAuthData -from .aws_provider_account import AwsProviderAccount -from .aws_provider_account_auth_data import AwsProviderAccountAuthData -from .aws_region import AwsRegion -from .aws_s3 import AwsS3 -from .aws_s3auth_data import AwsS3AuthData -from .aws_sagemaker_provider_account import AwsSagemakerProviderAccount -from .aws_sagemaker_provider_account_auth_data import AwsSagemakerProviderAccountAuthData -from .aws_secrets_manager import AwsSecretsManager -from .aws_secrets_manager_auth_data import AwsSecretsManagerAuthData -from .azure_ai_inference_model import AzureAiInferenceModel -from .azure_ai_inference_model_deployment_details import AzureAiInferenceModelDeploymentDetails -from .azure_ai_managed_deployment import AzureAiManagedDeployment -from .azure_ai_serverless_deployment import AzureAiServerlessDeployment -from .azure_aks_integration import AzureAksIntegration -from .azure_basic_auth import AzureBasicAuth -from .azure_blob_storage import AzureBlobStorage -from .azure_connection_string_auth import AzureConnectionStringAuth -from .azure_container_registry import AzureContainerRegistry -from .azure_content_safety_category import AzureContentSafetyCategory -from .azure_content_safety_guardrail_config import AzureContentSafetyGuardrailConfig -from .azure_foundry_model import AzureFoundryModel -from .azure_foundry_model_v2 import AzureFoundryModelV2 -from .azure_foundry_provider_account import AzureFoundryProviderAccount -from .azure_integrations import AzureIntegrations -from .azure_key_auth import AzureKeyAuth -from .azure_o_auth import AzureOAuth -from .azure_open_ai_model import AzureOpenAiModel -from .azure_open_ai_model_v2 import AzureOpenAiModelV2 -from .azure_open_ai_provider_account import AzureOpenAiProviderAccount -from .azure_pii_category import AzurePiiCategory -from .azure_pii_guardrail_config import AzurePiiGuardrailConfig -from .azure_pii_guardrail_config_domain import AzurePiiGuardrailConfigDomain -from .azure_provider_account import AzureProviderAccount -from .azure_repos_integration import AzureReposIntegration -from .azure_vault import AzureVault -from .base_artifact_version import BaseArtifactVersion -from .base_artifact_version_manifest import BaseArtifactVersionManifest -from .base_autoscaling import BaseAutoscaling -from .base_o_auth2login import BaseOAuth2Login -from .base_o_auth2login_jwt_source import BaseOAuth2LoginJwtSource -from .base_service import BaseService -from .base_service_image import BaseServiceImage -from .base_service_mounts_item import BaseServiceMountsItem -from .base_workbench_input import BaseWorkbenchInput -from .base_workbench_input_mounts_item import BaseWorkbenchInputMountsItem -from .basic_auth_creds import BasicAuthCreds -from .bedrock_key_auth import BedrockKeyAuth -from .bedrock_model import BedrockModel -from .bedrock_model_auth_data import BedrockModelAuthData -from .bedrock_model_v2 import BedrockModelV2 -from .bitbucket_integration import BitbucketIntegration -from .bitbucket_provider_account import BitbucketProviderAccount -from .blob_storage_reference import BlobStorageReference -from .blue_green import BlueGreen -from .budget_config import BudgetConfig -from .budget_limit_unit import BudgetLimitUnit -from .budget_rule import BudgetRule -from .budget_when import BudgetWhen -from .build import Build -from .build_build_source import BuildBuildSource -from .build_build_spec import BuildBuildSpec -from .build_info import BuildInfo -from .build_status import BuildStatus -from .canary import Canary -from .canary_step import CanaryStep -from .cerebras_integrations import CerebrasIntegrations -from .cerebras_key_auth import CerebrasKeyAuth -from .cerebras_model import CerebrasModel -from .cerebras_provider_account import CerebrasProviderAccount -from .change_password_response import ChangePasswordResponse -from .chat_prompt_manifest import ChatPromptManifest -from .chat_prompt_manifest_mcp_servers_item import ChatPromptManifestMcpServersItem -from .chat_prompt_manifest_messages_item import ChatPromptManifestMessagesItem -from .chat_prompt_manifest_response_format import ChatPromptManifestResponseFormat -from .chat_prompt_manifest_routing_config import ChatPromptManifestRoutingConfig -from .cluster import Cluster -from .cluster_gateway import ClusterGateway -from .cluster_manifest import ClusterManifest -from .cluster_manifest_cluster_type import ClusterManifestClusterType -from .cluster_manifest_monitoring import ClusterManifestMonitoring -from .cluster_manifest_node_label_keys import ClusterManifestNodeLabelKeys -from .cluster_manifest_workbench_config import ClusterManifestWorkbenchConfig -from .cluster_type import ClusterType -from .codeserver import Codeserver -from .cohere_integrations import CohereIntegrations -from .cohere_key_auth import CohereKeyAuth -from .cohere_model import CohereModel -from .cohere_provider_account import CohereProviderAccount -from .collaborator import Collaborator -from .common_tools_settings import CommonToolsSettings -from .config import Config -from .container_task_config import ContainerTaskConfig -from .container_task_config_image import ContainerTaskConfigImage -from .container_task_config_mounts_item import ContainerTaskConfigMountsItem -from .core_nats_output_config import CoreNatsOutputConfig -from .cpu_utilization_metric import CpuUtilizationMetric -from .create_multi_part_upload_request import CreateMultiPartUploadRequest -from .create_personal_access_token_response import CreatePersonalAccessTokenResponse -from .cron_metric import CronMetric -from .custom_basic_auth import CustomBasicAuth -from .custom_bearer_auth import CustomBearerAuth -from .custom_blob_storage import CustomBlobStorage -from .custom_guardrail_config import CustomGuardrailConfig -from .custom_guardrail_config_auth_data import CustomGuardrailConfigAuthData -from .custom_guardrail_config_operation import CustomGuardrailConfigOperation -from .custom_guardrail_config_target import CustomGuardrailConfigTarget -from .custom_helm_repo import CustomHelmRepo -from .custom_integrations import CustomIntegrations -from .custom_jwt_auth_integration import CustomJwtAuthIntegration -from .custom_model import CustomModel -from .custom_model_auth_data import CustomModelAuthData -from .custom_model_model_server import CustomModelModelServer -from .custom_provider_account import CustomProviderAccount -from .custom_tls_settings import CustomTlsSettings -from .custom_username_password_artifacts_registry import CustomUsernamePasswordArtifactsRegistry -from .data_directory import DataDirectory -from .data_directory_manifest import DataDirectoryManifest -from .data_directory_manifest_source import DataDirectoryManifestSource -from .databricks_api_key_auth import DatabricksApiKeyAuth -from .databricks_integrations import DatabricksIntegrations -from .databricks_model import DatabricksModel -from .databricks_provider_account import DatabricksProviderAccount -from .databricks_provider_account_auth_data import DatabricksProviderAccountAuthData -from .databricks_service_principal_auth import DatabricksServicePrincipalAuth -from .deactivate_user_response import DeactivateUserResponse -from .deepinfra_integrations import DeepinfraIntegrations -from .deepinfra_key_auth import DeepinfraKeyAuth -from .deepinfra_model import DeepinfraModel -from .deepinfra_provider_account import DeepinfraProviderAccount -from .delete_application_response import DeleteApplicationResponse -from .delete_job_run_response import DeleteJobRunResponse -from .delete_personal_access_token_response import DeletePersonalAccessTokenResponse -from .delete_secret_group_response import DeleteSecretGroupResponse -from .delete_team_response import DeleteTeamResponse -from .delete_user_response import DeleteUserResponse -from .delete_virtual_account_response import DeleteVirtualAccountResponse -from .deployment import Deployment -from .deployment_build import DeploymentBuild -from .deployment_manifest import DeploymentManifest -from .deployment_status import DeploymentStatus -from .deployment_status_value import DeploymentStatusValue -from .deployment_transition import DeploymentTransition -from .developer_message import DeveloperMessage -from .developer_message_content import DeveloperMessageContent -from .docker_file_build import DockerFileBuild -from .docker_file_build_command import DockerFileBuildCommand -from .dockerhub_basic_auth import DockerhubBasicAuth -from .dockerhub_integrations import DockerhubIntegrations -from .dockerhub_provider_account import DockerhubProviderAccount -from .dockerhub_registry import DockerhubRegistry -from .duration_filter import DurationFilter -from .duration_filter_operation import DurationFilterOperation -from .duration_filter_value import DurationFilterValue -from .dynamic_volume_config import DynamicVolumeConfig -from .email import Email -from .email_notification_channel import EmailNotificationChannel -from .empty_response import EmptyResponse -from .endpoint import Endpoint -from .enkrypt_ai_guardrail_config import EnkryptAiGuardrailConfig -from .enkrypt_ai_guardrail_config_operation import EnkryptAiGuardrailConfigOperation -from .enkrypt_ai_key_auth import EnkryptAiKeyAuth -from .environment import Environment -from .environment_color import EnvironmentColor -from .environment_manifest import EnvironmentManifest -from .environment_optimize_for import EnvironmentOptimizeFor -from .event import Event -from .event_chart import EventChart -from .event_chart_category import EventChartCategory -from .event_involved_object import EventInvolvedObject -from .external_blob_storage_source import ExternalBlobStorageSource -from .fallback_config import FallbackConfig -from .fallback_model import FallbackModel -from .fallback_rule import FallbackRule -from .fallback_when import FallbackWhen -from .fast_ai_framework import FastAiFramework -from .fiddler_guard_type import FiddlerGuardType -from .fiddler_guardrail_config import FiddlerGuardrailConfig -from .fiddler_key_auth import FiddlerKeyAuth -from .file_info import FileInfo -from .filter import Filter -from .flyte_launch_plan import FlyteLaunchPlan -from .flyte_launch_plan_id import FlyteLaunchPlanId -from .flyte_launch_plan_spec import FlyteLaunchPlanSpec -from .flyte_task import FlyteTask -from .flyte_task_custom import FlyteTaskCustom -from .flyte_task_custom_truefoundry import FlyteTaskCustomTruefoundry -from .flyte_task_id import FlyteTaskId -from .flyte_task_template import FlyteTaskTemplate -from .flyte_workflow import FlyteWorkflow -from .flyte_workflow_id import FlyteWorkflowId -from .flyte_workflow_template import FlyteWorkflowTemplate -from .forward_action import ForwardAction -from .function import Function -from .function_schema import FunctionSchema -from .gateway_config import GatewayConfig -from .gateway_configuration import GatewayConfiguration -from .gcp_api_key_auth import GcpApiKeyAuth -from .gcp_gcr import GcpGcr -from .gcp_gcs import GcpGcs -from .gcp_gke_integration import GcpGkeIntegration -from .gcp_gsm import GcpGsm -from .gcp_integrations import GcpIntegrations -from .gcp_key_file_auth import GcpKeyFileAuth -from .gcp_provider_account import GcpProviderAccount -from .gcp_provider_account_auth_data import GcpProviderAccountAuthData -from .gcp_region import GcpRegion -from .gcp_tpu import GcpTpu -from .gemini_model_v2 import GeminiModelV2 -from .get_alerts_response import GetAlertsResponse -from .get_application_deployment_response import GetApplicationDeploymentResponse -from .get_application_response import GetApplicationResponse -from .get_artifact_response import GetArtifactResponse -from .get_artifact_version_response import GetArtifactVersionResponse -from .get_authenticated_vcsurl_response import GetAuthenticatedVcsurlResponse -from .get_auto_provisioning_state_response import GetAutoProvisioningStateResponse -from .get_charts_response import GetChartsResponse -from .get_cluster_response import GetClusterResponse -from .get_data_directory_response import GetDataDirectoryResponse -from .get_environment_response import GetEnvironmentResponse -from .get_events_response import GetEventsResponse -from .get_job_run_response import GetJobRunResponse -from .get_logs_response import GetLogsResponse -from .get_ml_repo_response import GetMlRepoResponse -from .get_model_response import GetModelResponse -from .get_model_version_response import GetModelVersionResponse -from .get_or_create_personal_access_token_response import GetOrCreatePersonalAccessTokenResponse -from .get_prompt_response import GetPromptResponse -from .get_prompt_version_response import GetPromptVersionResponse -from .get_secret_group_response import GetSecretGroupResponse -from .get_secret_response import GetSecretResponse -from .get_signed_ur_ls_request import GetSignedUrLsRequest -from .get_signed_ur_ls_response import GetSignedUrLsResponse -from .get_suggested_deployment_endpoint_response import GetSuggestedDeploymentEndpointResponse -from .get_team_response import GetTeamResponse -from .get_user_resources_response import GetUserResourcesResponse -from .get_user_response import GetUserResponse -from .get_user_teams_response import GetUserTeamsResponse -from .get_virtual_account_response import GetVirtualAccountResponse -from .get_workspace_response import GetWorkspaceResponse -from .git_helm_repo import GitHelmRepo -from .git_repository_exists_response import GitRepositoryExistsResponse -from .git_source import GitSource -from .github_integration import GithubIntegration -from .github_provider_account import GithubProviderAccount -from .gitlab_integration import GitlabIntegration -from .gitlab_provider_account import GitlabProviderAccount -from .gluon_framework import GluonFramework -from .google_gemini_provider_account import GoogleGeminiProviderAccount -from .google_model import GoogleModel -from .google_vertex_provider_account import GoogleVertexProviderAccount -from .graph import Graph -from .graph_chart_type import GraphChartType -from .groq_integrations import GroqIntegrations -from .groq_key_auth import GroqKeyAuth -from .groq_model import GroqModel -from .groq_provider_account import GroqProviderAccount -from .guardrail_config_group import GuardrailConfigGroup -from .guardrail_config_integrations import GuardrailConfigIntegrations -from .guardrail_meters_response_dto import GuardrailMetersResponseDto -from .guardrail_metric_chart import GuardrailMetricChart -from .guardrail_metrics_charts_response_dto import GuardrailMetricsChartsResponseDto -from .guardrail_metrics_filters_response_dto import GuardrailMetricsFiltersResponseDto -from .guardrails import Guardrails -from .guardrails_config import GuardrailsConfig -from .guardrails_rule import GuardrailsRule -from .guardrails_when import GuardrailsWhen -from .h2o_framework import H2OFramework -from .header_latency_based_load_balancing_rule import HeaderLatencyBasedLoadBalancingRule -from .header_match import HeaderMatch -from .header_priority_based_load_balancing_rule import HeaderPriorityBasedLoadBalancingRule -from .header_weight_based_load_balancing_rule import HeaderWeightBasedLoadBalancingRule -from .health_probe import HealthProbe -from .helm import Helm -from .helm_repo import HelmRepo -from .helm_source import HelmSource -from .http_error import HttpError -from .http_error_code import HttpErrorCode -from .http_probe import HttpProbe -from .http_status_code_filter import HttpStatusCodeFilter -from .http_status_code_filter_operation import HttpStatusCodeFilterOperation -from .http_status_code_filter_value import HttpStatusCodeFilterValue -from .http_validation_error import HttpValidationError -from .huggingface_artifact_source import HuggingfaceArtifactSource -from .i_change import IChange -from .i_change_operation import IChangeOperation -from .image import Image -from .image_command import ImageCommand -from .image_content_part import ImageContentPart -from .image_url import ImageUrl -from .image_url_url import ImageUrlUrl -from .in_filter import InFilter -from .in_filter_operation import InFilterOperation -from .infer_method_name import InferMethodName -from .infra_provider_account import InfraProviderAccount -from .ingress_controller_config import IngressControllerConfig -from .input_output_based_cost_metric_value import InputOutputBasedCostMetricValue -from .intercept import Intercept -from .intercept_rules_item import InterceptRulesItem -from .intercept_rules_item_action import InterceptRulesItemAction -from .internal_artifact_version import InternalArtifactVersion -from .internal_list_artifact_versions_response import InternalListArtifactVersionsResponse -from .internal_list_artifact_versions_response_data_item import InternalListArtifactVersionsResponseDataItem -from .internal_model_version import InternalModelVersion -from .invite_user_response import InviteUserResponse -from .is_cluster_connected_response import IsClusterConnectedResponse -from .j_frog_integrations import JFrogIntegrations -from .jfrog_artifacts_registry import JfrogArtifactsRegistry -from .jfrog_basic_auth import JfrogBasicAuth -from .jfrog_provider_account import JfrogProviderAccount -from .job import Job -from .job_alert import JobAlert -from .job_image import JobImage -from .job_mounts_item import JobMountsItem -from .job_run import JobRun -from .job_run_status import JobRunStatus -from .job_runs_sort_by import JobRunsSortBy -from .job_runs_sort_direction import JobRunsSortDirection -from .job_trigger import JobTrigger -from .job_trigger_input import JobTriggerInput -from .job_trigger_input_command import JobTriggerInputCommand -from .json_object_response_format import JsonObjectResponseFormat -from .json_schema import JsonSchema -from .json_schema_response_format import JsonSchemaResponseFormat -from .jwt_auth_config import JwtAuthConfig -from .jwt_auth_config_claims_item import JwtAuthConfigClaimsItem -from .kafka_input_config import KafkaInputConfig -from .kafka_metric_config import KafkaMetricConfig -from .kafka_output_config import KafkaOutputConfig -from .kafka_sasl_auth import KafkaSaslAuth -from .keras_framework import KerasFramework -from .kustomize import Kustomize -from .latency_based_load_balance_target import LatencyBasedLoadBalanceTarget -from .latency_based_load_balancing_rule import LatencyBasedLoadBalancingRule -from .library_name import LibraryName -from .light_gbm_framework import LightGbmFramework -from .like_filter import LikeFilter -from .list_application_deployments_response import ListApplicationDeploymentsResponse -from .list_applications_response import ListApplicationsResponse -from .list_artifact_versions_response import ListArtifactVersionsResponse -from .list_artifacts_response import ListArtifactsResponse -from .list_cluster_addons_response import ListClusterAddonsResponse -from .list_clusters_response import ListClustersResponse -from .list_data_directories_response import ListDataDirectoriesResponse -from .list_environments_response import ListEnvironmentsResponse -from .list_files_request import ListFilesRequest -from .list_files_response import ListFilesResponse -from .list_job_run_response import ListJobRunResponse -from .list_ml_repos_response import ListMlReposResponse -from .list_model_versions_response import ListModelVersionsResponse -from .list_models_response import ListModelsResponse -from .list_personal_access_token_response import ListPersonalAccessTokenResponse -from .list_prompt_versions_response import ListPromptVersionsResponse -from .list_prompts_response import ListPromptsResponse -from .list_secret_group_response import ListSecretGroupResponse -from .list_secrets_response import ListSecretsResponse -from .list_teams_response import ListTeamsResponse -from .list_users_response import ListUsersResponse -from .list_virtual_account_response import ListVirtualAccountResponse -from .list_workspaces_response import ListWorkspacesResponse -from .load_balance_target import LoadBalanceTarget -from .load_balancing_config import LoadBalancingConfig -from .load_balancing_rule import LoadBalancingRule -from .load_balancing_when import LoadBalancingWhen -from .local_artifact_source import LocalArtifactSource -from .local_model_source import LocalModelSource -from .local_source import LocalSource -from .log import Log -from .logs_search_filter_type import LogsSearchFilterType -from .logs_search_operator_type import LogsSearchOperatorType -from .logs_sorting_direction import LogsSortingDirection -from .manual import Manual -from .mcp_meters_response_dto import McpMetersResponseDto -from .mcp_metric_chart import McpMetricChart -from .mcp_metrics_charts_response_dto import McpMetricsChartsResponseDto -from .mcp_metrics_filters_response_dto import McpMetricsFiltersResponseDto -from .mcp_server_auth import McpServerAuth -from .mcp_server_header_auth import McpServerHeaderAuth -from .mcp_server_header_override_auth import McpServerHeaderOverrideAuth -from .mcp_server_integration import McpServerIntegration -from .mcp_server_integrations import McpServerIntegrations -from .mcp_server_o_auth2 import McpServerOAuth2 -from .mcp_server_o_auth2dcr import McpServerOAuth2Dcr -from .mcp_server_o_auth2jwt_source import McpServerOAuth2JwtSource -from .mcp_server_passthrough import McpServerPassthrough -from .mcp_server_provider_account import McpServerProviderAccount -from .mcp_server_tool_details import McpServerToolDetails -from .mcp_server_with_fqn import McpServerWithFqn -from .mcp_server_with_url import McpServerWithUrl -from .mcp_tool import McpTool -from .metadata import Metadata -from .metadata_item import MetadataItem -from .metric import Metric -from .mime_type import MimeType -from .mirror_action import MirrorAction -from .mistral_ai_integrations import MistralAiIntegrations -from .mistral_ai_key_auth import MistralAiKeyAuth -from .mistral_ai_model import MistralAiModel -from .mistral_ai_provider_account import MistralAiProviderAccount -from .ml_repo import MlRepo -from .ml_repo_manifest import MlRepoManifest -from .model import Model -from .model_configuration import ModelConfiguration -from .model_cost_metric import ModelCostMetric -from .model_manifest import ModelManifest -from .model_manifest_framework import ModelManifestFramework -from .model_manifest_source import ModelManifestSource -from .model_provider_account import ModelProviderAccount -from .model_type import ModelType -from .model_version import ModelVersion -from .model_version_environment import ModelVersionEnvironment -from .multi_part_upload import MultiPartUpload -from .multi_part_upload_response import MultiPartUploadResponse -from .multi_part_upload_storage_provider import MultiPartUploadStorageProvider -from .nats_input_config import NatsInputConfig -from .nats_metric_config import NatsMetricConfig -from .nats_output_config import NatsOutputConfig -from .nats_user_password_auth import NatsUserPasswordAuth -from .node_selector import NodeSelector -from .node_selector_capacity_type import NodeSelectorCapacityType -from .nodepool import Nodepool -from .nodepool_selector import NodepoolSelector -from .nomic_integrations import NomicIntegrations -from .nomic_key_auth import NomicKeyAuth -from .nomic_model import NomicModel -from .nomic_provider_account import NomicProviderAccount -from .notebook import Notebook -from .notebook_config import NotebookConfig -from .notification_target import NotificationTarget -from .notification_target_for_alert_rule import NotificationTargetForAlertRule -from .nvidia_gpu import NvidiaGpu -from .nvidia_miggpu import NvidiaMiggpu -from .nvidia_miggpu_profile import NvidiaMiggpuProfile -from .nvidia_timeslicing_gpu import NvidiaTimeslicingGpu -from .o_auth2login_provider import OAuth2LoginProvider -from .oci_repo import OciRepo -from .ollama_integrations import OllamaIntegrations -from .ollama_key_auth import OllamaKeyAuth -from .ollama_model import OllamaModel -from .ollama_provider_account import OllamaProviderAccount -from .onnx_framework import OnnxFramework -from .open_ai_integrations import OpenAiIntegrations -from .open_ai_model import OpenAiModel -from .open_ai_moderations_guardrail_config import OpenAiModerationsGuardrailConfig -from .open_ai_moderations_guardrail_config_category_thresholds_value import ( - OpenAiModerationsGuardrailConfigCategoryThresholdsValue, -) -from .open_ai_moderations_guardrail_config_category_thresholds_value_harassment import ( - OpenAiModerationsGuardrailConfigCategoryThresholdsValueHarassment, -) -from .open_router_api_key_auth import OpenRouterApiKeyAuth -from .open_router_integrations import OpenRouterIntegrations -from .open_router_model import OpenRouterModel -from .open_router_provider_account import OpenRouterProviderAccount -from .openai_api_key_auth import OpenaiApiKeyAuth -from .openai_provider_account import OpenaiProviderAccount -from .operation import Operation -from .paddle_framework import PaddleFramework -from .pager_duty import PagerDuty -from .pager_duty_integration import PagerDutyIntegration -from .pager_duty_integration_key_auth import PagerDutyIntegrationKeyAuth -from .pager_duty_integrations import PagerDutyIntegrations -from .pager_duty_provider_account import PagerDutyProviderAccount -from .pagination import Pagination -from .palm_integrations import PalmIntegrations -from .palm_key_auth import PalmKeyAuth -from .palm_model import PalmModel -from .palm_provider_account import PalmProviderAccount -from .palo_alto_prisma_airs_guardrail_config import PaloAltoPrismaAirsGuardrailConfig -from .palo_alto_prisma_airs_key_auth import PaloAltoPrismaAirsKeyAuth -from .pangea_guard_type import PangeaGuardType -from .pangea_guardrail_config import PangeaGuardrailConfig -from .pangea_key_auth import PangeaKeyAuth -from .param import Param -from .param_param_type import ParamParamType -from .parameters import Parameters -from .parameters_stop import ParametersStop -from .patronus_answer_relevance_criteria import PatronusAnswerRelevanceCriteria -from .patronus_answer_relevance_evaluator import PatronusAnswerRelevanceEvaluator -from .patronus_evaluator import PatronusEvaluator -from .patronus_glider_criteria import PatronusGliderCriteria -from .patronus_glider_evaluator import PatronusGliderEvaluator -from .patronus_guardrail_config import PatronusGuardrailConfig -from .patronus_guardrail_config_target import PatronusGuardrailConfigTarget -from .patronus_judge_criteria import PatronusJudgeCriteria -from .patronus_judge_evaluator import PatronusJudgeEvaluator -from .patronus_key_auth import PatronusKeyAuth -from .patronus_phi_criteria import PatronusPhiCriteria -from .patronus_phi_evaluator import PatronusPhiEvaluator -from .patronus_pii_criteria import PatronusPiiCriteria -from .patronus_pii_evaluator import PatronusPiiEvaluator -from .patronus_toxicity_criteria import PatronusToxicityCriteria -from .patronus_toxicity_evaluator import PatronusToxicityEvaluator -from .per_thousand_embedding_tokens_cost_metric import PerThousandEmbeddingTokensCostMetric -from .per_thousand_tokens_cost_metric import PerThousandTokensCostMetric -from .permissions import Permissions -from .perplexity_ai_key_auth import PerplexityAiKeyAuth -from .perplexity_ai_model import PerplexityAiModel -from .perplexity_ai_provider_account import PerplexityAiProviderAccount -from .perplexity_integrations import PerplexityIntegrations -from .personal_access_token_manifest import PersonalAccessTokenManifest -from .pip import Pip -from .poetry import Poetry -from .policy_actions import PolicyActions -from .policy_entity_types import PolicyEntityTypes -from .policy_filters import PolicyFilters -from .policy_manifest import PolicyManifest -from .policy_manifest_mode import PolicyManifestMode -from .policy_manifest_operation import PolicyManifestOperation -from .policy_mutation_operation import PolicyMutationOperation -from .policy_validation_operation import PolicyValidationOperation -from .port import Port -from .port_app_protocol import PortAppProtocol -from .port_auth import PortAuth -from .port_protocol import PortProtocol -from .presigned_url_object import PresignedUrlObject -from .priority_based_load_balance_target import PriorityBasedLoadBalanceTarget -from .priority_based_load_balancing_rule import PriorityBasedLoadBalancingRule -from .prometheus_alert_rule import PrometheusAlertRule -from .prompt import Prompt -from .prompt_foo_guard_type import PromptFooGuardType -from .prompt_foo_guardrail_config import PromptFooGuardrailConfig -from .prompt_version import PromptVersion -from .provider_accounts import ProviderAccounts -from .public_cost_metric import PublicCostMetric -from .py_spark_task_config import PySparkTaskConfig -from .py_torch_framework import PyTorchFramework -from .python_build import PythonBuild -from .python_build_command import PythonBuildCommand -from .python_build_python_dependencies import PythonBuildPythonDependencies -from .python_task_config import PythonTaskConfig -from .python_task_config_image import PythonTaskConfigImage -from .python_task_config_mounts_item import PythonTaskConfigMountsItem -from .quay_artifacts_registry import QuayArtifactsRegistry -from .quay_basic_auth import QuayBasicAuth -from .quay_integrations import QuayIntegrations -from .quay_provider_account import QuayProviderAccount -from .r_studio import RStudio -from .rate_limit_config import RateLimitConfig -from .rate_limit_rule import RateLimitRule -from .rate_limit_unit import RateLimitUnit -from .rate_limit_when import RateLimitWhen -from .recommendation import Recommendation -from .refusal_content_part import RefusalContentPart -from .register_users_response import RegisterUsersResponse -from .remote_source import RemoteSource -from .retry_config import RetryConfig -from .revoke_all_personal_access_token_response import RevokeAllPersonalAccessTokenResponse -from .rolling import Rolling -from .rps_metric import RpsMetric -from .sagemaker_model import SagemakerModel -from .samba_nova_integrations import SambaNovaIntegrations -from .samba_nova_key_auth import SambaNovaKeyAuth -from .samba_nova_model import SambaNovaModel -from .samba_nova_provider_account import SambaNovaProviderAccount -from .schedule import Schedule -from .schedule_concurrency_policy import ScheduleConcurrencyPolicy -from .secret import Secret -from .secret_group import SecretGroup -from .secret_input import SecretInput -from .secret_mount import SecretMount -from .secret_version import SecretVersion -from .self_hosted_model import SelfHostedModel -from .self_hosted_model_auth_data import SelfHostedModelAuthData -from .self_hosted_model_integrations import SelfHostedModelIntegrations -from .self_hosted_model_model_server import SelfHostedModelModelServer -from .self_hosted_model_provider_account import SelfHostedModelProviderAccount -from .service import Service -from .service_autoscaling import ServiceAutoscaling -from .service_autoscaling_metrics import ServiceAutoscalingMetrics -from .service_replicas import ServiceReplicas -from .service_rollout_strategy import ServiceRolloutStrategy -from .session import Session -from .signed_url import SignedUrl -from .sklearn_framework import SklearnFramework -from .sklearn_model_schema import SklearnModelSchema -from .sklearn_serialization_format import SklearnSerializationFormat -from .slack_bot import SlackBot -from .slack_bot_auth import SlackBotAuth -from .slack_bot_integration import SlackBotIntegration -from .slack_integrations import SlackIntegrations -from .slack_provider_account import SlackProviderAccount -from .slack_webhook import SlackWebhook -from .slack_webhook_auth import SlackWebhookAuth -from .slack_webhook_integration import SlackWebhookIntegration -from .smtp_credentials import SmtpCredentials -from .spa_cy_framework import SpaCyFramework -from .spark_build import SparkBuild -from .spark_config import SparkConfig -from .spark_driver_config import SparkDriverConfig -from .spark_executor_config import SparkExecutorConfig -from .spark_executor_config_instances import SparkExecutorConfigInstances -from .spark_executor_dynamic_scaling import SparkExecutorDynamicScaling -from .spark_executor_fixed_instances import SparkExecutorFixedInstances -from .spark_image import SparkImage -from .spark_image_build import SparkImageBuild -from .spark_image_build_build_source import SparkImageBuildBuildSource -from .spark_job import SparkJob -from .spark_job_entrypoint import SparkJobEntrypoint -from .spark_job_image import SparkJobImage -from .spark_job_java_entrypoint import SparkJobJavaEntrypoint -from .spark_job_python_entrypoint import SparkJobPythonEntrypoint -from .spark_job_python_notebook_entrypoint import SparkJobPythonNotebookEntrypoint -from .spark_job_scala_entrypoint import SparkJobScalaEntrypoint -from .spark_job_scala_notebook_entrypoint import SparkJobScalaNotebookEntrypoint -from .spark_job_trigger_input import SparkJobTriggerInput -from .sqs_input_config import SqsInputConfig -from .sqs_output_config import SqsOutputConfig -from .sqs_queue_metric_config import SqsQueueMetricConfig -from .ssh_server import SshServer -from .ssh_server_config import SshServerConfig -from .sso_team_manifest import SsoTeamManifest -from .stage_artifact_response import StageArtifactResponse -from .static_volume_config import StaticVolumeConfig -from .stats_models_framework import StatsModelsFramework -from .string_data_mount import StringDataMount -from .subject import Subject -from .subject_type import SubjectType -from .system_message import SystemMessage -from .system_message_content import SystemMessageContent -from .task_docker_file_build import TaskDockerFileBuild -from .task_py_spark_build import TaskPySparkBuild -from .task_python_build import TaskPythonBuild -from .team import Team -from .team_manifest import TeamManifest -from .tensor_flow_framework import TensorFlowFramework -from .terminate_job_response import TerminateJobResponse -from .text_content_part import TextContentPart -from .text_content_part_text import TextContentPartText -from .together_ai_integrations import TogetherAiIntegrations -from .together_ai_key_auth import TogetherAiKeyAuth -from .together_ai_model import TogetherAiModel -from .together_ai_provider_account import TogetherAiProviderAccount -from .token_pagination import TokenPagination -from .tool_call import ToolCall -from .tool_message import ToolMessage -from .tool_message_content import ToolMessageContent -from .tool_schema import ToolSchema -from .tracing_project import TracingProject -from .tracing_project_manifest import TracingProjectManifest -from .transformers_framework import TransformersFramework -from .trigger_job_run_response import TriggerJobRunResponse -from .true_foundry_apply_request_manifest import TrueFoundryApplyRequestManifest -from .true_foundry_apply_response import TrueFoundryApplyResponse -from .true_foundry_apply_response_action import TrueFoundryApplyResponseAction -from .true_foundry_apply_response_existing_manifest import TrueFoundryApplyResponseExistingManifest -from .true_foundry_artifact_source import TrueFoundryArtifactSource -from .true_foundry_dbssm import TrueFoundryDbssm -from .true_foundry_delete_request_manifest import TrueFoundryDeleteRequestManifest -from .true_foundry_integrations import TrueFoundryIntegrations -from .true_foundry_interactive_login import TrueFoundryInteractiveLogin -from .true_foundry_managed_source import TrueFoundryManagedSource -from .true_foundry_provider_account import TrueFoundryProviderAccount -from .ttl_integrations import TtlIntegrations -from .ttl_provider_account import TtlProviderAccount -from .ttl_registry import TtlRegistry -from .update_secret_input import UpdateSecretInput -from .update_user_roles_response import UpdateUserRolesResponse -from .upgrade_data import UpgradeData -from .usage_code_snippet import UsageCodeSnippet -from .user import User -from .user_message import UserMessage -from .user_message_content import UserMessageContent -from .user_message_content_item import UserMessageContentItem -from .user_metadata import UserMetadata -from .user_metadata_tenant_role_managed_by import UserMetadataTenantRoleManagedBy -from .user_resource import UserResource -from .uv import Uv -from .validation_error import ValidationError -from .validation_error_loc_item import ValidationErrorLocItem -from .vertex_model import VertexModel -from .vertex_model_v2 import VertexModelV2 -from .virtual_account import VirtualAccount -from .virtual_account_manifest import VirtualAccountManifest -from .virtual_mcp_server_integration import VirtualMcpServerIntegration -from .virtual_mcp_server_source import VirtualMcpServerSource -from .volume import Volume -from .volume_browser import VolumeBrowser -from .volume_config import VolumeConfig -from .volume_mount import VolumeMount -from .webhook_basic_auth import WebhookBasicAuth -from .webhook_bearer_auth import WebhookBearerAuth -from .webhook_integration import WebhookIntegration -from .webhook_integration_auth_data import WebhookIntegrationAuthData -from .webhook_integrations import WebhookIntegrations -from .webhook_provider_account import WebhookProviderAccount -from .weight_based_load_balancing_rule import WeightBasedLoadBalancingRule -from .workbench_image import WorkbenchImage -from .worker_config import WorkerConfig -from .worker_config_input_config import WorkerConfigInputConfig -from .worker_config_output_config import WorkerConfigOutputConfig -from .workflow import Workflow -from .workflow_alert import WorkflowAlert -from .workflow_flyte_entities_item import WorkflowFlyteEntitiesItem -from .workflow_source import WorkflowSource -from .workspace import Workspace -from .workspace_manifest import WorkspaceManifest -from .xg_boost_framework import XgBoostFramework -from .xg_boost_model_schema import XgBoostModelSchema -from .xg_boost_serialization_format import XgBoostSerializationFormat +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .resources import Resources + from .resources_devices_item import ResourcesDevicesItem + from .resources_node import ResourcesNode + from .activate_user_response import ActivateUserResponse + from .add_on_component_source import AddOnComponentSource + from .addon_component import AddonComponent + from .addon_component_name import AddonComponentName + from .addon_component_status import AddonComponentStatus + from .ai21integrations import Ai21Integrations + from .ai21key_auth import Ai21KeyAuth + from .ai21model import Ai21Model + from .ai21provider_account import Ai21ProviderAccount + from .ai_features_settings import AiFeaturesSettings + from .alert import Alert + from .alert_config import AlertConfig + from .alert_config_resource import AlertConfigResource + from .alert_config_resource_type import AlertConfigResourceType + from .alert_severity import AlertSeverity + from .amqp_input_config import AmqpInputConfig + from .amqp_metric_config import AmqpMetricConfig + from .amqp_output_config import AmqpOutputConfig + from .anthropic_integrations import AnthropicIntegrations + from .anthropic_key_auth import AnthropicKeyAuth + from .anthropic_model import AnthropicModel + from .anthropic_provider_account import AnthropicProviderAccount + from .application import Application + from .application_debug_info import ApplicationDebugInfo + from .application_lifecycle_stage import ApplicationLifecycleStage + from .application_metadata import ApplicationMetadata + from .application_problem import ApplicationProblem + from .application_set import ApplicationSet + from .application_set_components_item import ApplicationSetComponentsItem + from .application_type import ApplicationType + from .apply_ml_entity_response import ApplyMlEntityResponse + from .apply_ml_entity_response_data import ApplyMlEntityResponseData + from .artifact import Artifact + from .artifact_manifest import ArtifactManifest + from .artifact_manifest_source import ArtifactManifestSource + from .artifact_path import ArtifactPath + from .artifact_type import ArtifactType + from .artifact_version import ArtifactVersion + from .artifacts_cache_volume import ArtifactsCacheVolume + from .artifacts_download import ArtifactsDownload + from .artifacts_download_artifacts_item import ArtifactsDownloadArtifactsItem + from .assistant_message import AssistantMessage + from .assistant_message_content import AssistantMessageContent + from .assistant_message_content_item import AssistantMessageContentItem + from .async_processor_sidecar import AsyncProcessorSidecar + from .async_service import AsyncService + from .async_service_autoscaling import AsyncServiceAutoscaling + from .async_service_autoscaling_metrics import AsyncServiceAutoscalingMetrics + from .async_service_replicas import AsyncServiceReplicas + from .auto_rotate import AutoRotate + from .autoshutdown import Autoshutdown + from .aws_access_key_auth import AwsAccessKeyAuth + from .aws_access_key_based_auth import AwsAccessKeyBasedAuth + from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth + from .aws_bedrock_guardrail_config import AwsBedrockGuardrailConfig + from .aws_bedrock_guardrail_config_auth_data import AwsBedrockGuardrailConfigAuthData + from .aws_bedrock_guardrail_config_operation import AwsBedrockGuardrailConfigOperation + from .aws_bedrock_provider_account import AwsBedrockProviderAccount + from .aws_bedrock_provider_account_auth_data import AwsBedrockProviderAccountAuthData + from .aws_ecr import AwsEcr + from .aws_ecr_auth_data import AwsEcrAuthData + from .aws_eks_integration import AwsEksIntegration + from .aws_eks_integration_auth_data import AwsEksIntegrationAuthData + from .aws_inferentia import AwsInferentia + from .aws_integrations import AwsIntegrations + from .aws_parameter_store import AwsParameterStore + from .aws_parameter_store_auth_data import AwsParameterStoreAuthData + from .aws_provider_account import AwsProviderAccount + from .aws_provider_account_auth_data import AwsProviderAccountAuthData + from .aws_region import AwsRegion + from .aws_s3 import AwsS3 + from .aws_s3auth_data import AwsS3AuthData + from .aws_sagemaker_provider_account import AwsSagemakerProviderAccount + from .aws_sagemaker_provider_account_auth_data import AwsSagemakerProviderAccountAuthData + from .aws_secrets_manager import AwsSecretsManager + from .aws_secrets_manager_auth_data import AwsSecretsManagerAuthData + from .azure_ai_inference_model import AzureAiInferenceModel + from .azure_ai_inference_model_deployment_details import AzureAiInferenceModelDeploymentDetails + from .azure_ai_managed_deployment import AzureAiManagedDeployment + from .azure_ai_serverless_deployment import AzureAiServerlessDeployment + from .azure_aks_integration import AzureAksIntegration + from .azure_basic_auth import AzureBasicAuth + from .azure_blob_storage import AzureBlobStorage + from .azure_connection_string_auth import AzureConnectionStringAuth + from .azure_container_registry import AzureContainerRegistry + from .azure_content_safety_category import AzureContentSafetyCategory + from .azure_content_safety_guardrail_config import AzureContentSafetyGuardrailConfig + from .azure_foundry_model import AzureFoundryModel + from .azure_foundry_model_v2 import AzureFoundryModelV2 + from .azure_foundry_provider_account import AzureFoundryProviderAccount + from .azure_integrations import AzureIntegrations + from .azure_key_auth import AzureKeyAuth + from .azure_o_auth import AzureOAuth + from .azure_open_ai_model import AzureOpenAiModel + from .azure_open_ai_model_v2 import AzureOpenAiModelV2 + from .azure_open_ai_provider_account import AzureOpenAiProviderAccount + from .azure_pii_category import AzurePiiCategory + from .azure_pii_guardrail_config import AzurePiiGuardrailConfig + from .azure_pii_guardrail_config_domain import AzurePiiGuardrailConfigDomain + from .azure_provider_account import AzureProviderAccount + from .azure_repos_integration import AzureReposIntegration + from .azure_vault import AzureVault + from .base_artifact_version import BaseArtifactVersion + from .base_artifact_version_manifest import BaseArtifactVersionManifest + from .base_autoscaling import BaseAutoscaling + from .base_o_auth2login import BaseOAuth2Login + from .base_o_auth2login_jwt_source import BaseOAuth2LoginJwtSource + from .base_service import BaseService + from .base_service_image import BaseServiceImage + from .base_service_mounts_item import BaseServiceMountsItem + from .base_workbench_input import BaseWorkbenchInput + from .base_workbench_input_mounts_item import BaseWorkbenchInputMountsItem + from .basic_auth_creds import BasicAuthCreds + from .bedrock_key_auth import BedrockKeyAuth + from .bedrock_model import BedrockModel + from .bedrock_model_auth_data import BedrockModelAuthData + from .bedrock_model_v2 import BedrockModelV2 + from .bitbucket_integration import BitbucketIntegration + from .bitbucket_provider_account import BitbucketProviderAccount + from .blob_storage_reference import BlobStorageReference + from .blue_green import BlueGreen + from .budget_config import BudgetConfig + from .budget_limit_unit import BudgetLimitUnit + from .budget_rule import BudgetRule + from .budget_when import BudgetWhen + from .build import Build + from .build_build_source import BuildBuildSource + from .build_build_spec import BuildBuildSpec + from .build_info import BuildInfo + from .build_status import BuildStatus + from .canary import Canary + from .canary_step import CanaryStep + from .cerebras_integrations import CerebrasIntegrations + from .cerebras_key_auth import CerebrasKeyAuth + from .cerebras_model import CerebrasModel + from .cerebras_provider_account import CerebrasProviderAccount + from .change_password_response import ChangePasswordResponse + from .chat_prompt_manifest import ChatPromptManifest + from .chat_prompt_manifest_mcp_servers_item import ChatPromptManifestMcpServersItem + from .chat_prompt_manifest_messages_item import ChatPromptManifestMessagesItem + from .chat_prompt_manifest_response_format import ChatPromptManifestResponseFormat + from .chat_prompt_manifest_routing_config import ChatPromptManifestRoutingConfig + from .cluster import Cluster + from .cluster_gateway import ClusterGateway + from .cluster_manifest import ClusterManifest + from .cluster_manifest_cluster_type import ClusterManifestClusterType + from .cluster_manifest_monitoring import ClusterManifestMonitoring + from .cluster_manifest_node_label_keys import ClusterManifestNodeLabelKeys + from .cluster_manifest_workbench_config import ClusterManifestWorkbenchConfig + from .cluster_type import ClusterType + from .codeserver import Codeserver + from .cohere_integrations import CohereIntegrations + from .cohere_key_auth import CohereKeyAuth + from .cohere_model import CohereModel + from .cohere_provider_account import CohereProviderAccount + from .collaborator import Collaborator + from .common_tools_settings import CommonToolsSettings + from .config import Config + from .container_task_config import ContainerTaskConfig + from .container_task_config_image import ContainerTaskConfigImage + from .container_task_config_mounts_item import ContainerTaskConfigMountsItem + from .core_nats_output_config import CoreNatsOutputConfig + from .cpu_utilization_metric import CpuUtilizationMetric + from .create_multi_part_upload_request import CreateMultiPartUploadRequest + from .create_personal_access_token_response import CreatePersonalAccessTokenResponse + from .cron_metric import CronMetric + from .custom_basic_auth import CustomBasicAuth + from .custom_bearer_auth import CustomBearerAuth + from .custom_blob_storage import CustomBlobStorage + from .custom_guardrail_config import CustomGuardrailConfig + from .custom_guardrail_config_auth_data import CustomGuardrailConfigAuthData + from .custom_guardrail_config_operation import CustomGuardrailConfigOperation + from .custom_guardrail_config_target import CustomGuardrailConfigTarget + from .custom_helm_repo import CustomHelmRepo + from .custom_integrations import CustomIntegrations + from .custom_jwt_auth_integration import CustomJwtAuthIntegration + from .custom_model import CustomModel + from .custom_model_auth_data import CustomModelAuthData + from .custom_model_model_server import CustomModelModelServer + from .custom_provider_account import CustomProviderAccount + from .custom_tls_settings import CustomTlsSettings + from .custom_username_password_artifacts_registry import CustomUsernamePasswordArtifactsRegistry + from .data_directory import DataDirectory + from .data_directory_manifest import DataDirectoryManifest + from .data_directory_manifest_source import DataDirectoryManifestSource + from .databricks_api_key_auth import DatabricksApiKeyAuth + from .databricks_integrations import DatabricksIntegrations + from .databricks_model import DatabricksModel + from .databricks_provider_account import DatabricksProviderAccount + from .databricks_provider_account_auth_data import DatabricksProviderAccountAuthData + from .databricks_service_principal_auth import DatabricksServicePrincipalAuth + from .deactivate_user_response import DeactivateUserResponse + from .deepinfra_integrations import DeepinfraIntegrations + from .deepinfra_key_auth import DeepinfraKeyAuth + from .deepinfra_model import DeepinfraModel + from .deepinfra_provider_account import DeepinfraProviderAccount + from .delete_application_response import DeleteApplicationResponse + from .delete_job_run_response import DeleteJobRunResponse + from .delete_personal_access_token_response import DeletePersonalAccessTokenResponse + from .delete_secret_group_response import DeleteSecretGroupResponse + from .delete_team_response import DeleteTeamResponse + from .delete_user_response import DeleteUserResponse + from .delete_virtual_account_response import DeleteVirtualAccountResponse + from .deployment import Deployment + from .deployment_build import DeploymentBuild + from .deployment_manifest import DeploymentManifest + from .deployment_status import DeploymentStatus + from .deployment_status_value import DeploymentStatusValue + from .deployment_transition import DeploymentTransition + from .developer_message import DeveloperMessage + from .developer_message_content import DeveloperMessageContent + from .docker_file_build import DockerFileBuild + from .docker_file_build_command import DockerFileBuildCommand + from .dockerhub_basic_auth import DockerhubBasicAuth + from .dockerhub_integrations import DockerhubIntegrations + from .dockerhub_provider_account import DockerhubProviderAccount + from .dockerhub_registry import DockerhubRegistry + from .dynamic_volume_config import DynamicVolumeConfig + from .email import Email + from .email_notification_channel import EmailNotificationChannel + from .empty_response import EmptyResponse + from .endpoint import Endpoint + from .enkrypt_ai_guardrail_config import EnkryptAiGuardrailConfig + from .enkrypt_ai_guardrail_config_operation import EnkryptAiGuardrailConfigOperation + from .enkrypt_ai_key_auth import EnkryptAiKeyAuth + from .environment import Environment + from .environment_color import EnvironmentColor + from .environment_manifest import EnvironmentManifest + from .environment_optimize_for import EnvironmentOptimizeFor + from .external_blob_storage_source import ExternalBlobStorageSource + from .fallback_config import FallbackConfig + from .fallback_model import FallbackModel + from .fallback_rule import FallbackRule + from .fallback_when import FallbackWhen + from .fast_ai_framework import FastAiFramework + from .fiddler_guard_type import FiddlerGuardType + from .fiddler_guardrail_config import FiddlerGuardrailConfig + from .fiddler_key_auth import FiddlerKeyAuth + from .file_info import FileInfo + from .flyte_launch_plan import FlyteLaunchPlan + from .flyte_launch_plan_id import FlyteLaunchPlanId + from .flyte_launch_plan_spec import FlyteLaunchPlanSpec + from .flyte_task import FlyteTask + from .flyte_task_custom import FlyteTaskCustom + from .flyte_task_custom_truefoundry import FlyteTaskCustomTruefoundry + from .flyte_task_id import FlyteTaskId + from .flyte_task_template import FlyteTaskTemplate + from .flyte_workflow import FlyteWorkflow + from .flyte_workflow_id import FlyteWorkflowId + from .flyte_workflow_template import FlyteWorkflowTemplate + from .forward_action import ForwardAction + from .function import Function + from .function_schema import FunctionSchema + from .gateway_config import GatewayConfig + from .gateway_configuration import GatewayConfiguration + from .gcp_api_key_auth import GcpApiKeyAuth + from .gcp_gcr import GcpGcr + from .gcp_gcs import GcpGcs + from .gcp_gke_integration import GcpGkeIntegration + from .gcp_gsm import GcpGsm + from .gcp_integrations import GcpIntegrations + from .gcp_key_file_auth import GcpKeyFileAuth + from .gcp_provider_account import GcpProviderAccount + from .gcp_provider_account_auth_data import GcpProviderAccountAuthData + from .gcp_region import GcpRegion + from .gcp_tpu import GcpTpu + from .gemini_model_v2 import GeminiModelV2 + from .get_application_deployment_response import GetApplicationDeploymentResponse + from .get_application_response import GetApplicationResponse + from .get_artifact_response import GetArtifactResponse + from .get_artifact_version_response import GetArtifactVersionResponse + from .get_authenticated_vcsurl_response import GetAuthenticatedVcsurlResponse + from .get_auto_provisioning_state_response import GetAutoProvisioningStateResponse + from .get_charts_response import GetChartsResponse + from .get_cluster_response import GetClusterResponse + from .get_data_directory_response import GetDataDirectoryResponse + from .get_environment_response import GetEnvironmentResponse + from .get_job_run_response import GetJobRunResponse + from .get_logs_response import GetLogsResponse + from .get_ml_repo_response import GetMlRepoResponse + from .get_model_response import GetModelResponse + from .get_model_version_response import GetModelVersionResponse + from .get_or_create_personal_access_token_response import GetOrCreatePersonalAccessTokenResponse + from .get_prompt_response import GetPromptResponse + from .get_prompt_version_response import GetPromptVersionResponse + from .get_secret_group_response import GetSecretGroupResponse + from .get_secret_response import GetSecretResponse + from .get_signed_ur_ls_request import GetSignedUrLsRequest + from .get_signed_ur_ls_response import GetSignedUrLsResponse + from .get_suggested_deployment_endpoint_response import GetSuggestedDeploymentEndpointResponse + from .get_team_response import GetTeamResponse + from .get_token_for_virtual_account_response import GetTokenForVirtualAccountResponse + from .get_user_resources_response import GetUserResourcesResponse + from .get_user_response import GetUserResponse + from .get_user_teams_response import GetUserTeamsResponse + from .get_virtual_account_response import GetVirtualAccountResponse + from .get_workspace_response import GetWorkspaceResponse + from .git_helm_repo import GitHelmRepo + from .git_repository_exists_response import GitRepositoryExistsResponse + from .git_source import GitSource + from .github_integration import GithubIntegration + from .github_provider_account import GithubProviderAccount + from .gitlab_integration import GitlabIntegration + from .gitlab_provider_account import GitlabProviderAccount + from .gluon_framework import GluonFramework + from .google_gemini_provider_account import GoogleGeminiProviderAccount + from .google_model import GoogleModel + from .google_vertex_provider_account import GoogleVertexProviderAccount + from .graph import Graph + from .graph_chart_type import GraphChartType + from .groq_integrations import GroqIntegrations + from .groq_key_auth import GroqKeyAuth + from .groq_model import GroqModel + from .groq_provider_account import GroqProviderAccount + from .guardrail_config_group import GuardrailConfigGroup + from .guardrail_config_integrations import GuardrailConfigIntegrations + from .guardrails import Guardrails + from .guardrails_config import GuardrailsConfig + from .guardrails_rule import GuardrailsRule + from .guardrails_when import GuardrailsWhen + from .h2o_framework import H2OFramework + from .header_match import HeaderMatch + from .health_probe import HealthProbe + from .helm import Helm + from .helm_repo import HelmRepo + from .helm_source import HelmSource + from .http_error import HttpError + from .http_error_code import HttpErrorCode + from .http_probe import HttpProbe + from .http_validation_error import HttpValidationError + from .huggingface_artifact_source import HuggingfaceArtifactSource + from .i_change import IChange + from .i_change_operation import IChangeOperation + from .image import Image + from .image_command import ImageCommand + from .image_content_part import ImageContentPart + from .image_url import ImageUrl + from .image_url_url import ImageUrlUrl + from .infer_method_name import InferMethodName + from .infra_provider_account import InfraProviderAccount + from .ingress_controller_config import IngressControllerConfig + from .input_output_based_cost_metric_value import InputOutputBasedCostMetricValue + from .intercept import Intercept + from .intercept_rules_item import InterceptRulesItem + from .intercept_rules_item_action import InterceptRulesItemAction + from .internal_artifact_version import InternalArtifactVersion + from .internal_list_artifact_versions_response import InternalListArtifactVersionsResponse + from .internal_list_artifact_versions_response_data_item import InternalListArtifactVersionsResponseDataItem + from .internal_model_version import InternalModelVersion + from .invite_user_response import InviteUserResponse + from .is_cluster_connected_response import IsClusterConnectedResponse + from .j_frog_integrations import JFrogIntegrations + from .jfrog_artifacts_registry import JfrogArtifactsRegistry + from .jfrog_basic_auth import JfrogBasicAuth + from .jfrog_provider_account import JfrogProviderAccount + from .job import Job + from .job_alert import JobAlert + from .job_image import JobImage + from .job_mounts_item import JobMountsItem + from .job_run import JobRun + from .job_run_status import JobRunStatus + from .job_runs_sort_by import JobRunsSortBy + from .job_trigger import JobTrigger + from .job_trigger_input import JobTriggerInput + from .job_trigger_input_command import JobTriggerInputCommand + from .json_object_response_format import JsonObjectResponseFormat + from .json_schema import JsonSchema + from .json_schema_response_format import JsonSchemaResponseFormat + from .jwt import Jwt + from .jwt_auth_config import JwtAuthConfig + from .jwt_auth_config_claims_item import JwtAuthConfigClaimsItem + from .kafka_input_config import KafkaInputConfig + from .kafka_metric_config import KafkaMetricConfig + from .kafka_output_config import KafkaOutputConfig + from .kafka_sasl_auth import KafkaSaslAuth + from .keras_framework import KerasFramework + from .kustomize import Kustomize + from .latency_based_load_balance_target import LatencyBasedLoadBalanceTarget + from .latency_based_load_balancing import LatencyBasedLoadBalancing + from .latency_based_load_balancing_rule import LatencyBasedLoadBalancingRule + from .library_name import LibraryName + from .light_gbm_framework import LightGbmFramework + from .list_application_deployments_response import ListApplicationDeploymentsResponse + from .list_applications_response import ListApplicationsResponse + from .list_artifact_versions_response import ListArtifactVersionsResponse + from .list_artifacts_response import ListArtifactsResponse + from .list_cluster_addons_response import ListClusterAddonsResponse + from .list_clusters_response import ListClustersResponse + from .list_data_directories_response import ListDataDirectoriesResponse + from .list_environments_response import ListEnvironmentsResponse + from .list_files_request import ListFilesRequest + from .list_files_response import ListFilesResponse + from .list_job_run_response import ListJobRunResponse + from .list_ml_repos_response import ListMlReposResponse + from .list_model_versions_response import ListModelVersionsResponse + from .list_models_response import ListModelsResponse + from .list_personal_access_token_response import ListPersonalAccessTokenResponse + from .list_prompt_versions_response import ListPromptVersionsResponse + from .list_prompts_response import ListPromptsResponse + from .list_secret_group_response import ListSecretGroupResponse + from .list_secrets_response import ListSecretsResponse + from .list_teams_response import ListTeamsResponse + from .list_users_response import ListUsersResponse + from .list_virtual_account_response import ListVirtualAccountResponse + from .list_workspaces_response import ListWorkspacesResponse + from .load_balance_target import LoadBalanceTarget + from .load_balancing_config import LoadBalancingConfig + from .load_balancing_rule import LoadBalancingRule + from .load_balancing_when import LoadBalancingWhen + from .local_artifact_source import LocalArtifactSource + from .local_model_source import LocalModelSource + from .local_source import LocalSource + from .log import Log + from .logs_search_filter_type import LogsSearchFilterType + from .logs_search_operator_type import LogsSearchOperatorType + from .logs_sorting_direction import LogsSortingDirection + from .manual import Manual + from .mcp_server_auth import McpServerAuth + from .mcp_server_header_auth import McpServerHeaderAuth + from .mcp_server_header_override_auth import McpServerHeaderOverrideAuth + from .mcp_server_integration import McpServerIntegration + from .mcp_server_integrations import McpServerIntegrations + from .mcp_server_o_auth2 import McpServerOAuth2 + from .mcp_server_o_auth2dcr import McpServerOAuth2Dcr + from .mcp_server_o_auth2jwt_source import McpServerOAuth2JwtSource + from .mcp_server_passthrough import McpServerPassthrough + from .mcp_server_provider_account import McpServerProviderAccount + from .mcp_server_tool_details import McpServerToolDetails + from .mcp_server_with_fqn import McpServerWithFqn + from .mcp_server_with_url import McpServerWithUrl + from .mcp_tool import McpTool + from .metadata import Metadata + from .metric import Metric + from .mime_type import MimeType + from .mirror_action import MirrorAction + from .mistral_ai_integrations import MistralAiIntegrations + from .mistral_ai_key_auth import MistralAiKeyAuth + from .mistral_ai_model import MistralAiModel + from .mistral_ai_provider_account import MistralAiProviderAccount + from .ml_repo import MlRepo + from .ml_repo_manifest import MlRepoManifest + from .model import Model + from .model_configuration import ModelConfiguration + from .model_cost_metric import ModelCostMetric + from .model_manifest import ModelManifest + from .model_manifest_framework import ModelManifestFramework + from .model_manifest_source import ModelManifestSource + from .model_provider_account import ModelProviderAccount + from .model_type import ModelType + from .model_version import ModelVersion + from .model_version_environment import ModelVersionEnvironment + from .multi_part_upload import MultiPartUpload + from .multi_part_upload_response import MultiPartUploadResponse + from .multi_part_upload_storage_provider import MultiPartUploadStorageProvider + from .nats_input_config import NatsInputConfig + from .nats_metric_config import NatsMetricConfig + from .nats_output_config import NatsOutputConfig + from .nats_user_password_auth import NatsUserPasswordAuth + from .node_selector import NodeSelector + from .node_selector_capacity_type import NodeSelectorCapacityType + from .nodepool import Nodepool + from .nodepool_selector import NodepoolSelector + from .nomic_integrations import NomicIntegrations + from .nomic_key_auth import NomicKeyAuth + from .nomic_model import NomicModel + from .nomic_provider_account import NomicProviderAccount + from .notebook import Notebook + from .notebook_config import NotebookConfig + from .notification_target import NotificationTarget + from .notification_target_for_alert_rule import NotificationTargetForAlertRule + from .nvidia_gpu import NvidiaGpu + from .nvidia_miggpu import NvidiaMiggpu + from .nvidia_miggpu_profile import NvidiaMiggpuProfile + from .nvidia_timeslicing_gpu import NvidiaTimeslicingGpu + from .o_auth2login_provider import OAuth2LoginProvider + from .oci_repo import OciRepo + from .ollama_integrations import OllamaIntegrations + from .ollama_key_auth import OllamaKeyAuth + from .ollama_model import OllamaModel + from .ollama_provider_account import OllamaProviderAccount + from .onnx_framework import OnnxFramework + from .open_ai_integrations import OpenAiIntegrations + from .open_ai_model import OpenAiModel + from .open_ai_moderations_guardrail_config import OpenAiModerationsGuardrailConfig + from .open_ai_moderations_guardrail_config_category_thresholds_value import ( + OpenAiModerationsGuardrailConfigCategoryThresholdsValue, + ) + from .open_ai_moderations_guardrail_config_category_thresholds_value_harassment import ( + OpenAiModerationsGuardrailConfigCategoryThresholdsValueHarassment, + ) + from .open_router_api_key_auth import OpenRouterApiKeyAuth + from .open_router_integrations import OpenRouterIntegrations + from .open_router_model import OpenRouterModel + from .open_router_provider_account import OpenRouterProviderAccount + from .openai_api_key_auth import OpenaiApiKeyAuth + from .openai_provider_account import OpenaiProviderAccount + from .operation import Operation + from .paddle_framework import PaddleFramework + from .pager_duty import PagerDuty + from .pager_duty_integration import PagerDutyIntegration + from .pager_duty_integration_key_auth import PagerDutyIntegrationKeyAuth + from .pager_duty_integrations import PagerDutyIntegrations + from .pager_duty_provider_account import PagerDutyProviderAccount + from .pagination import Pagination + from .palm_integrations import PalmIntegrations + from .palm_key_auth import PalmKeyAuth + from .palm_model import PalmModel + from .palm_provider_account import PalmProviderAccount + from .palo_alto_prisma_airs_guardrail_config import PaloAltoPrismaAirsGuardrailConfig + from .palo_alto_prisma_airs_guardrail_config_mode import PaloAltoPrismaAirsGuardrailConfigMode + from .palo_alto_prisma_airs_key_auth import PaloAltoPrismaAirsKeyAuth + from .pangea_guard_type import PangeaGuardType + from .pangea_guardrail_config import PangeaGuardrailConfig + from .pangea_key_auth import PangeaKeyAuth + from .param import Param + from .param_param_type import ParamParamType + from .parameters import Parameters + from .parameters_stop import ParametersStop + from .patronus_answer_relevance_criteria import PatronusAnswerRelevanceCriteria + from .patronus_answer_relevance_evaluator import PatronusAnswerRelevanceEvaluator + from .patronus_evaluator import PatronusEvaluator + from .patronus_glider_criteria import PatronusGliderCriteria + from .patronus_glider_evaluator import PatronusGliderEvaluator + from .patronus_guardrail_config import PatronusGuardrailConfig + from .patronus_guardrail_config_target import PatronusGuardrailConfigTarget + from .patronus_judge_criteria import PatronusJudgeCriteria + from .patronus_judge_evaluator import PatronusJudgeEvaluator + from .patronus_key_auth import PatronusKeyAuth + from .patronus_phi_criteria import PatronusPhiCriteria + from .patronus_phi_evaluator import PatronusPhiEvaluator + from .patronus_pii_criteria import PatronusPiiCriteria + from .patronus_pii_evaluator import PatronusPiiEvaluator + from .patronus_toxicity_criteria import PatronusToxicityCriteria + from .patronus_toxicity_evaluator import PatronusToxicityEvaluator + from .per_thousand_embedding_tokens_cost_metric import PerThousandEmbeddingTokensCostMetric + from .per_thousand_tokens_cost_metric import PerThousandTokensCostMetric + from .permissions import Permissions + from .perplexity_ai_key_auth import PerplexityAiKeyAuth + from .perplexity_ai_model import PerplexityAiModel + from .perplexity_ai_provider_account import PerplexityAiProviderAccount + from .perplexity_integrations import PerplexityIntegrations + from .personal_access_token_manifest import PersonalAccessTokenManifest + from .pip import Pip + from .poetry import Poetry + from .policy_actions import PolicyActions + from .policy_entity_types import PolicyEntityTypes + from .policy_filters import PolicyFilters + from .policy_manifest import PolicyManifest + from .policy_manifest_mode import PolicyManifestMode + from .policy_manifest_operation import PolicyManifestOperation + from .policy_mutation_operation import PolicyMutationOperation + from .policy_validation_operation import PolicyValidationOperation + from .port import Port + from .port_app_protocol import PortAppProtocol + from .port_auth import PortAuth + from .port_protocol import PortProtocol + from .presigned_url_object import PresignedUrlObject + from .priority_based_load_balance_target import PriorityBasedLoadBalanceTarget + from .priority_based_load_balancing import PriorityBasedLoadBalancing + from .priority_based_load_balancing_rule import PriorityBasedLoadBalancingRule + from .prometheus_alert_rule import PrometheusAlertRule + from .prompt import Prompt + from .prompt_foo_guard_type import PromptFooGuardType + from .prompt_foo_guardrail_config import PromptFooGuardrailConfig + from .prompt_version import PromptVersion + from .provider_accounts import ProviderAccounts + from .public_cost_metric import PublicCostMetric + from .py_spark_task_config import PySparkTaskConfig + from .py_torch_framework import PyTorchFramework + from .python_build import PythonBuild + from .python_build_command import PythonBuildCommand + from .python_build_python_dependencies import PythonBuildPythonDependencies + from .python_task_config import PythonTaskConfig + from .python_task_config_image import PythonTaskConfigImage + from .python_task_config_mounts_item import PythonTaskConfigMountsItem + from .quay_artifacts_registry import QuayArtifactsRegistry + from .quay_basic_auth import QuayBasicAuth + from .quay_integrations import QuayIntegrations + from .quay_provider_account import QuayProviderAccount + from .query_spans_response import QuerySpansResponse + from .r_studio import RStudio + from .rate_limit_config import RateLimitConfig + from .rate_limit_rule import RateLimitRule + from .rate_limit_unit import RateLimitUnit + from .rate_limit_when import RateLimitWhen + from .recommendation import Recommendation + from .refusal_content_part import RefusalContentPart + from .register_users_response import RegisterUsersResponse + from .remote_source import RemoteSource + from .retry_config import RetryConfig + from .revoke_all_personal_access_token_response import RevokeAllPersonalAccessTokenResponse + from .rolling import Rolling + from .rps_metric import RpsMetric + from .sagemaker_model import SagemakerModel + from .samba_nova_integrations import SambaNovaIntegrations + from .samba_nova_key_auth import SambaNovaKeyAuth + from .samba_nova_model import SambaNovaModel + from .samba_nova_provider_account import SambaNovaProviderAccount + from .schedule import Schedule + from .schedule_concurrency_policy import ScheduleConcurrencyPolicy + from .secret import Secret + from .secret_group import SecretGroup + from .secret_input import SecretInput + from .secret_mount import SecretMount + from .secret_version import SecretVersion + from .self_hosted_model import SelfHostedModel + from .self_hosted_model_auth_data import SelfHostedModelAuthData + from .self_hosted_model_integrations import SelfHostedModelIntegrations + from .self_hosted_model_model_server import SelfHostedModelModelServer + from .self_hosted_model_provider_account import SelfHostedModelProviderAccount + from .service import Service + from .service_autoscaling import ServiceAutoscaling + from .service_autoscaling_metrics import ServiceAutoscalingMetrics + from .service_replicas import ServiceReplicas + from .service_rollout_strategy import ServiceRolloutStrategy + from .session import Session + from .signed_url import SignedUrl + from .sklearn_framework import SklearnFramework + from .sklearn_model_schema import SklearnModelSchema + from .sklearn_serialization_format import SklearnSerializationFormat + from .slack_bot import SlackBot + from .slack_bot_auth import SlackBotAuth + from .slack_bot_integration import SlackBotIntegration + from .slack_integrations import SlackIntegrations + from .slack_provider_account import SlackProviderAccount + from .slack_webhook import SlackWebhook + from .slack_webhook_auth import SlackWebhookAuth + from .slack_webhook_integration import SlackWebhookIntegration + from .smtp_credentials import SmtpCredentials + from .sort_direction import SortDirection + from .spa_cy_framework import SpaCyFramework + from .spark_build import SparkBuild + from .spark_config import SparkConfig + from .spark_driver_config import SparkDriverConfig + from .spark_executor_config import SparkExecutorConfig + from .spark_executor_config_instances import SparkExecutorConfigInstances + from .spark_executor_dynamic_scaling import SparkExecutorDynamicScaling + from .spark_executor_fixed_instances import SparkExecutorFixedInstances + from .spark_image import SparkImage + from .spark_image_build import SparkImageBuild + from .spark_image_build_build_source import SparkImageBuildBuildSource + from .spark_job import SparkJob + from .spark_job_entrypoint import SparkJobEntrypoint + from .spark_job_image import SparkJobImage + from .spark_job_java_entrypoint import SparkJobJavaEntrypoint + from .spark_job_python_entrypoint import SparkJobPythonEntrypoint + from .spark_job_python_notebook_entrypoint import SparkJobPythonNotebookEntrypoint + from .spark_job_scala_entrypoint import SparkJobScalaEntrypoint + from .spark_job_scala_notebook_entrypoint import SparkJobScalaNotebookEntrypoint + from .spark_job_trigger_input import SparkJobTriggerInput + from .sqs_input_config import SqsInputConfig + from .sqs_output_config import SqsOutputConfig + from .sqs_queue_metric_config import SqsQueueMetricConfig + from .ssh_server import SshServer + from .ssh_server_config import SshServerConfig + from .sso_team_manifest import SsoTeamManifest + from .stage_artifact_response import StageArtifactResponse + from .static_volume_config import StaticVolumeConfig + from .stats_models_framework import StatsModelsFramework + from .string_data_mount import StringDataMount + from .subject import Subject + from .subject_type import SubjectType + from .system_message import SystemMessage + from .system_message_content import SystemMessageContent + from .task_docker_file_build import TaskDockerFileBuild + from .task_py_spark_build import TaskPySparkBuild + from .task_python_build import TaskPythonBuild + from .team import Team + from .team_manifest import TeamManifest + from .tensor_flow_framework import TensorFlowFramework + from .terminate_job_response import TerminateJobResponse + from .text_content_part import TextContentPart + from .text_content_part_text import TextContentPartText + from .together_ai_integrations import TogetherAiIntegrations + from .together_ai_key_auth import TogetherAiKeyAuth + from .together_ai_model import TogetherAiModel + from .together_ai_provider_account import TogetherAiProviderAccount + from .token_pagination import TokenPagination + from .tool_call import ToolCall + from .tool_message import ToolMessage + from .tool_message_content import ToolMessageContent + from .tool_schema import ToolSchema + from .trace_span import TraceSpan + from .traces_subject_type import TracesSubjectType + from .tracing_project import TracingProject + from .tracing_project_manifest import TracingProjectManifest + from .transformers_framework import TransformersFramework + from .trigger_job_run_response import TriggerJobRunResponse + from .true_foundry_apply_request_manifest import TrueFoundryApplyRequestManifest + from .true_foundry_apply_response import TrueFoundryApplyResponse + from .true_foundry_apply_response_action import TrueFoundryApplyResponseAction + from .true_foundry_apply_response_existing_manifest import TrueFoundryApplyResponseExistingManifest + from .true_foundry_artifact_source import TrueFoundryArtifactSource + from .true_foundry_dbssm import TrueFoundryDbssm + from .true_foundry_delete_request_manifest import TrueFoundryDeleteRequestManifest + from .true_foundry_integrations import TrueFoundryIntegrations + from .true_foundry_interactive_login import TrueFoundryInteractiveLogin + from .true_foundry_managed_source import TrueFoundryManagedSource + from .true_foundry_provider_account import TrueFoundryProviderAccount + from .ttl_integrations import TtlIntegrations + from .ttl_provider_account import TtlProviderAccount + from .ttl_registry import TtlRegistry + from .update_secret_input import UpdateSecretInput + from .update_user_roles_response import UpdateUserRolesResponse + from .upgrade_data import UpgradeData + from .usage_code_snippet import UsageCodeSnippet + from .user import User + from .user_message import UserMessage + from .user_message_content import UserMessageContent + from .user_message_content_item import UserMessageContentItem + from .user_metadata import UserMetadata + from .user_metadata_tenant_role_managed_by import UserMetadataTenantRoleManagedBy + from .user_resource import UserResource + from .uv import Uv + from .validation_error import ValidationError + from .validation_error_loc_item import ValidationErrorLocItem + from .vertex_model import VertexModel + from .vertex_model_v2 import VertexModelV2 + from .virtual_account import VirtualAccount + from .virtual_account_manifest import VirtualAccountManifest + from .virtual_mcp_server_integration import VirtualMcpServerIntegration + from .virtual_mcp_server_source import VirtualMcpServerSource + from .volume import Volume + from .volume_browser import VolumeBrowser + from .volume_config import VolumeConfig + from .volume_mount import VolumeMount + from .webhook_basic_auth import WebhookBasicAuth + from .webhook_bearer_auth import WebhookBearerAuth + from .webhook_integration import WebhookIntegration + from .webhook_integration_auth_data import WebhookIntegrationAuthData + from .webhook_integrations import WebhookIntegrations + from .webhook_provider_account import WebhookProviderAccount + from .weight_based_load_balancing import WeightBasedLoadBalancing + from .weight_based_load_balancing_rule import WeightBasedLoadBalancingRule + from .workbench_image import WorkbenchImage + from .worker_config import WorkerConfig + from .worker_config_input_config import WorkerConfigInputConfig + from .worker_config_output_config import WorkerConfigOutputConfig + from .workflow import Workflow + from .workflow_alert import WorkflowAlert + from .workflow_flyte_entities_item import WorkflowFlyteEntitiesItem + from .workflow_source import WorkflowSource + from .workspace import Workspace + from .workspace_manifest import WorkspaceManifest + from .xg_boost_framework import XgBoostFramework + from .xg_boost_model_schema import XgBoostModelSchema + from .xg_boost_serialization_format import XgBoostSerializationFormat +_dynamic_imports: typing.Dict[str, str] = { + "ActivateUserResponse": ".activate_user_response", + "AddOnComponentSource": ".add_on_component_source", + "AddonComponent": ".addon_component", + "AddonComponentName": ".addon_component_name", + "AddonComponentStatus": ".addon_component_status", + "Ai21Integrations": ".ai21integrations", + "Ai21KeyAuth": ".ai21key_auth", + "Ai21Model": ".ai21model", + "Ai21ProviderAccount": ".ai21provider_account", + "AiFeaturesSettings": ".ai_features_settings", + "Alert": ".alert", + "AlertConfig": ".alert_config", + "AlertConfigResource": ".alert_config_resource", + "AlertConfigResourceType": ".alert_config_resource_type", + "AlertSeverity": ".alert_severity", + "AmqpInputConfig": ".amqp_input_config", + "AmqpMetricConfig": ".amqp_metric_config", + "AmqpOutputConfig": ".amqp_output_config", + "AnthropicIntegrations": ".anthropic_integrations", + "AnthropicKeyAuth": ".anthropic_key_auth", + "AnthropicModel": ".anthropic_model", + "AnthropicProviderAccount": ".anthropic_provider_account", + "Application": ".application", + "ApplicationDebugInfo": ".application_debug_info", + "ApplicationLifecycleStage": ".application_lifecycle_stage", + "ApplicationMetadata": ".application_metadata", + "ApplicationProblem": ".application_problem", + "ApplicationSet": ".application_set", + "ApplicationSetComponentsItem": ".application_set_components_item", + "ApplicationType": ".application_type", + "ApplyMlEntityResponse": ".apply_ml_entity_response", + "ApplyMlEntityResponseData": ".apply_ml_entity_response_data", + "Artifact": ".artifact", + "ArtifactManifest": ".artifact_manifest", + "ArtifactManifestSource": ".artifact_manifest_source", + "ArtifactPath": ".artifact_path", + "ArtifactType": ".artifact_type", + "ArtifactVersion": ".artifact_version", + "ArtifactsCacheVolume": ".artifacts_cache_volume", + "ArtifactsDownload": ".artifacts_download", + "ArtifactsDownloadArtifactsItem": ".artifacts_download_artifacts_item", + "AssistantMessage": ".assistant_message", + "AssistantMessageContent": ".assistant_message_content", + "AssistantMessageContentItem": ".assistant_message_content_item", + "AsyncProcessorSidecar": ".async_processor_sidecar", + "AsyncService": ".async_service", + "AsyncServiceAutoscaling": ".async_service_autoscaling", + "AsyncServiceAutoscalingMetrics": ".async_service_autoscaling_metrics", + "AsyncServiceReplicas": ".async_service_replicas", + "AutoRotate": ".auto_rotate", + "Autoshutdown": ".autoshutdown", + "AwsAccessKeyAuth": ".aws_access_key_auth", + "AwsAccessKeyBasedAuth": ".aws_access_key_based_auth", + "AwsAssumedRoleBasedAuth": ".aws_assumed_role_based_auth", + "AwsBedrockGuardrailConfig": ".aws_bedrock_guardrail_config", + "AwsBedrockGuardrailConfigAuthData": ".aws_bedrock_guardrail_config_auth_data", + "AwsBedrockGuardrailConfigOperation": ".aws_bedrock_guardrail_config_operation", + "AwsBedrockProviderAccount": ".aws_bedrock_provider_account", + "AwsBedrockProviderAccountAuthData": ".aws_bedrock_provider_account_auth_data", + "AwsEcr": ".aws_ecr", + "AwsEcrAuthData": ".aws_ecr_auth_data", + "AwsEksIntegration": ".aws_eks_integration", + "AwsEksIntegrationAuthData": ".aws_eks_integration_auth_data", + "AwsInferentia": ".aws_inferentia", + "AwsIntegrations": ".aws_integrations", + "AwsParameterStore": ".aws_parameter_store", + "AwsParameterStoreAuthData": ".aws_parameter_store_auth_data", + "AwsProviderAccount": ".aws_provider_account", + "AwsProviderAccountAuthData": ".aws_provider_account_auth_data", + "AwsRegion": ".aws_region", + "AwsS3": ".aws_s3", + "AwsS3AuthData": ".aws_s3auth_data", + "AwsSagemakerProviderAccount": ".aws_sagemaker_provider_account", + "AwsSagemakerProviderAccountAuthData": ".aws_sagemaker_provider_account_auth_data", + "AwsSecretsManager": ".aws_secrets_manager", + "AwsSecretsManagerAuthData": ".aws_secrets_manager_auth_data", + "AzureAiInferenceModel": ".azure_ai_inference_model", + "AzureAiInferenceModelDeploymentDetails": ".azure_ai_inference_model_deployment_details", + "AzureAiManagedDeployment": ".azure_ai_managed_deployment", + "AzureAiServerlessDeployment": ".azure_ai_serverless_deployment", + "AzureAksIntegration": ".azure_aks_integration", + "AzureBasicAuth": ".azure_basic_auth", + "AzureBlobStorage": ".azure_blob_storage", + "AzureConnectionStringAuth": ".azure_connection_string_auth", + "AzureContainerRegistry": ".azure_container_registry", + "AzureContentSafetyCategory": ".azure_content_safety_category", + "AzureContentSafetyGuardrailConfig": ".azure_content_safety_guardrail_config", + "AzureFoundryModel": ".azure_foundry_model", + "AzureFoundryModelV2": ".azure_foundry_model_v2", + "AzureFoundryProviderAccount": ".azure_foundry_provider_account", + "AzureIntegrations": ".azure_integrations", + "AzureKeyAuth": ".azure_key_auth", + "AzureOAuth": ".azure_o_auth", + "AzureOpenAiModel": ".azure_open_ai_model", + "AzureOpenAiModelV2": ".azure_open_ai_model_v2", + "AzureOpenAiProviderAccount": ".azure_open_ai_provider_account", + "AzurePiiCategory": ".azure_pii_category", + "AzurePiiGuardrailConfig": ".azure_pii_guardrail_config", + "AzurePiiGuardrailConfigDomain": ".azure_pii_guardrail_config_domain", + "AzureProviderAccount": ".azure_provider_account", + "AzureReposIntegration": ".azure_repos_integration", + "AzureVault": ".azure_vault", + "BaseArtifactVersion": ".base_artifact_version", + "BaseArtifactVersionManifest": ".base_artifact_version_manifest", + "BaseAutoscaling": ".base_autoscaling", + "BaseOAuth2Login": ".base_o_auth2login", + "BaseOAuth2LoginJwtSource": ".base_o_auth2login_jwt_source", + "BaseService": ".base_service", + "BaseServiceImage": ".base_service_image", + "BaseServiceMountsItem": ".base_service_mounts_item", + "BaseWorkbenchInput": ".base_workbench_input", + "BaseWorkbenchInputMountsItem": ".base_workbench_input_mounts_item", + "BasicAuthCreds": ".basic_auth_creds", + "BedrockKeyAuth": ".bedrock_key_auth", + "BedrockModel": ".bedrock_model", + "BedrockModelAuthData": ".bedrock_model_auth_data", + "BedrockModelV2": ".bedrock_model_v2", + "BitbucketIntegration": ".bitbucket_integration", + "BitbucketProviderAccount": ".bitbucket_provider_account", + "BlobStorageReference": ".blob_storage_reference", + "BlueGreen": ".blue_green", + "BudgetConfig": ".budget_config", + "BudgetLimitUnit": ".budget_limit_unit", + "BudgetRule": ".budget_rule", + "BudgetWhen": ".budget_when", + "Build": ".build", + "BuildBuildSource": ".build_build_source", + "BuildBuildSpec": ".build_build_spec", + "BuildInfo": ".build_info", + "BuildStatus": ".build_status", + "Canary": ".canary", + "CanaryStep": ".canary_step", + "CerebrasIntegrations": ".cerebras_integrations", + "CerebrasKeyAuth": ".cerebras_key_auth", + "CerebrasModel": ".cerebras_model", + "CerebrasProviderAccount": ".cerebras_provider_account", + "ChangePasswordResponse": ".change_password_response", + "ChatPromptManifest": ".chat_prompt_manifest", + "ChatPromptManifestMcpServersItem": ".chat_prompt_manifest_mcp_servers_item", + "ChatPromptManifestMessagesItem": ".chat_prompt_manifest_messages_item", + "ChatPromptManifestResponseFormat": ".chat_prompt_manifest_response_format", + "ChatPromptManifestRoutingConfig": ".chat_prompt_manifest_routing_config", + "Cluster": ".cluster", + "ClusterGateway": ".cluster_gateway", + "ClusterManifest": ".cluster_manifest", + "ClusterManifestClusterType": ".cluster_manifest_cluster_type", + "ClusterManifestMonitoring": ".cluster_manifest_monitoring", + "ClusterManifestNodeLabelKeys": ".cluster_manifest_node_label_keys", + "ClusterManifestWorkbenchConfig": ".cluster_manifest_workbench_config", + "ClusterType": ".cluster_type", + "Codeserver": ".codeserver", + "CohereIntegrations": ".cohere_integrations", + "CohereKeyAuth": ".cohere_key_auth", + "CohereModel": ".cohere_model", + "CohereProviderAccount": ".cohere_provider_account", + "Collaborator": ".collaborator", + "CommonToolsSettings": ".common_tools_settings", + "Config": ".config", + "ContainerTaskConfig": ".container_task_config", + "ContainerTaskConfigImage": ".container_task_config_image", + "ContainerTaskConfigMountsItem": ".container_task_config_mounts_item", + "CoreNatsOutputConfig": ".core_nats_output_config", + "CpuUtilizationMetric": ".cpu_utilization_metric", + "CreateMultiPartUploadRequest": ".create_multi_part_upload_request", + "CreatePersonalAccessTokenResponse": ".create_personal_access_token_response", + "CronMetric": ".cron_metric", + "CustomBasicAuth": ".custom_basic_auth", + "CustomBearerAuth": ".custom_bearer_auth", + "CustomBlobStorage": ".custom_blob_storage", + "CustomGuardrailConfig": ".custom_guardrail_config", + "CustomGuardrailConfigAuthData": ".custom_guardrail_config_auth_data", + "CustomGuardrailConfigOperation": ".custom_guardrail_config_operation", + "CustomGuardrailConfigTarget": ".custom_guardrail_config_target", + "CustomHelmRepo": ".custom_helm_repo", + "CustomIntegrations": ".custom_integrations", + "CustomJwtAuthIntegration": ".custom_jwt_auth_integration", + "CustomModel": ".custom_model", + "CustomModelAuthData": ".custom_model_auth_data", + "CustomModelModelServer": ".custom_model_model_server", + "CustomProviderAccount": ".custom_provider_account", + "CustomTlsSettings": ".custom_tls_settings", + "CustomUsernamePasswordArtifactsRegistry": ".custom_username_password_artifacts_registry", + "DataDirectory": ".data_directory", + "DataDirectoryManifest": ".data_directory_manifest", + "DataDirectoryManifestSource": ".data_directory_manifest_source", + "DatabricksApiKeyAuth": ".databricks_api_key_auth", + "DatabricksIntegrations": ".databricks_integrations", + "DatabricksModel": ".databricks_model", + "DatabricksProviderAccount": ".databricks_provider_account", + "DatabricksProviderAccountAuthData": ".databricks_provider_account_auth_data", + "DatabricksServicePrincipalAuth": ".databricks_service_principal_auth", + "DeactivateUserResponse": ".deactivate_user_response", + "DeepinfraIntegrations": ".deepinfra_integrations", + "DeepinfraKeyAuth": ".deepinfra_key_auth", + "DeepinfraModel": ".deepinfra_model", + "DeepinfraProviderAccount": ".deepinfra_provider_account", + "DeleteApplicationResponse": ".delete_application_response", + "DeleteJobRunResponse": ".delete_job_run_response", + "DeletePersonalAccessTokenResponse": ".delete_personal_access_token_response", + "DeleteSecretGroupResponse": ".delete_secret_group_response", + "DeleteTeamResponse": ".delete_team_response", + "DeleteUserResponse": ".delete_user_response", + "DeleteVirtualAccountResponse": ".delete_virtual_account_response", + "Deployment": ".deployment", + "DeploymentBuild": ".deployment_build", + "DeploymentManifest": ".deployment_manifest", + "DeploymentStatus": ".deployment_status", + "DeploymentStatusValue": ".deployment_status_value", + "DeploymentTransition": ".deployment_transition", + "DeveloperMessage": ".developer_message", + "DeveloperMessageContent": ".developer_message_content", + "DockerFileBuild": ".docker_file_build", + "DockerFileBuildCommand": ".docker_file_build_command", + "DockerhubBasicAuth": ".dockerhub_basic_auth", + "DockerhubIntegrations": ".dockerhub_integrations", + "DockerhubProviderAccount": ".dockerhub_provider_account", + "DockerhubRegistry": ".dockerhub_registry", + "DynamicVolumeConfig": ".dynamic_volume_config", + "Email": ".email", + "EmailNotificationChannel": ".email_notification_channel", + "EmptyResponse": ".empty_response", + "Endpoint": ".endpoint", + "EnkryptAiGuardrailConfig": ".enkrypt_ai_guardrail_config", + "EnkryptAiGuardrailConfigOperation": ".enkrypt_ai_guardrail_config_operation", + "EnkryptAiKeyAuth": ".enkrypt_ai_key_auth", + "Environment": ".environment", + "EnvironmentColor": ".environment_color", + "EnvironmentManifest": ".environment_manifest", + "EnvironmentOptimizeFor": ".environment_optimize_for", + "ExternalBlobStorageSource": ".external_blob_storage_source", + "FallbackConfig": ".fallback_config", + "FallbackModel": ".fallback_model", + "FallbackRule": ".fallback_rule", + "FallbackWhen": ".fallback_when", + "FastAiFramework": ".fast_ai_framework", + "FiddlerGuardType": ".fiddler_guard_type", + "FiddlerGuardrailConfig": ".fiddler_guardrail_config", + "FiddlerKeyAuth": ".fiddler_key_auth", + "FileInfo": ".file_info", + "FlyteLaunchPlan": ".flyte_launch_plan", + "FlyteLaunchPlanId": ".flyte_launch_plan_id", + "FlyteLaunchPlanSpec": ".flyte_launch_plan_spec", + "FlyteTask": ".flyte_task", + "FlyteTaskCustom": ".flyte_task_custom", + "FlyteTaskCustomTruefoundry": ".flyte_task_custom_truefoundry", + "FlyteTaskId": ".flyte_task_id", + "FlyteTaskTemplate": ".flyte_task_template", + "FlyteWorkflow": ".flyte_workflow", + "FlyteWorkflowId": ".flyte_workflow_id", + "FlyteWorkflowTemplate": ".flyte_workflow_template", + "ForwardAction": ".forward_action", + "Function": ".function", + "FunctionSchema": ".function_schema", + "GatewayConfig": ".gateway_config", + "GatewayConfiguration": ".gateway_configuration", + "GcpApiKeyAuth": ".gcp_api_key_auth", + "GcpGcr": ".gcp_gcr", + "GcpGcs": ".gcp_gcs", + "GcpGkeIntegration": ".gcp_gke_integration", + "GcpGsm": ".gcp_gsm", + "GcpIntegrations": ".gcp_integrations", + "GcpKeyFileAuth": ".gcp_key_file_auth", + "GcpProviderAccount": ".gcp_provider_account", + "GcpProviderAccountAuthData": ".gcp_provider_account_auth_data", + "GcpRegion": ".gcp_region", + "GcpTpu": ".gcp_tpu", + "GeminiModelV2": ".gemini_model_v2", + "GetApplicationDeploymentResponse": ".get_application_deployment_response", + "GetApplicationResponse": ".get_application_response", + "GetArtifactResponse": ".get_artifact_response", + "GetArtifactVersionResponse": ".get_artifact_version_response", + "GetAuthenticatedVcsurlResponse": ".get_authenticated_vcsurl_response", + "GetAutoProvisioningStateResponse": ".get_auto_provisioning_state_response", + "GetChartsResponse": ".get_charts_response", + "GetClusterResponse": ".get_cluster_response", + "GetDataDirectoryResponse": ".get_data_directory_response", + "GetEnvironmentResponse": ".get_environment_response", + "GetJobRunResponse": ".get_job_run_response", + "GetLogsResponse": ".get_logs_response", + "GetMlRepoResponse": ".get_ml_repo_response", + "GetModelResponse": ".get_model_response", + "GetModelVersionResponse": ".get_model_version_response", + "GetOrCreatePersonalAccessTokenResponse": ".get_or_create_personal_access_token_response", + "GetPromptResponse": ".get_prompt_response", + "GetPromptVersionResponse": ".get_prompt_version_response", + "GetSecretGroupResponse": ".get_secret_group_response", + "GetSecretResponse": ".get_secret_response", + "GetSignedUrLsRequest": ".get_signed_ur_ls_request", + "GetSignedUrLsResponse": ".get_signed_ur_ls_response", + "GetSuggestedDeploymentEndpointResponse": ".get_suggested_deployment_endpoint_response", + "GetTeamResponse": ".get_team_response", + "GetTokenForVirtualAccountResponse": ".get_token_for_virtual_account_response", + "GetUserResourcesResponse": ".get_user_resources_response", + "GetUserResponse": ".get_user_response", + "GetUserTeamsResponse": ".get_user_teams_response", + "GetVirtualAccountResponse": ".get_virtual_account_response", + "GetWorkspaceResponse": ".get_workspace_response", + "GitHelmRepo": ".git_helm_repo", + "GitRepositoryExistsResponse": ".git_repository_exists_response", + "GitSource": ".git_source", + "GithubIntegration": ".github_integration", + "GithubProviderAccount": ".github_provider_account", + "GitlabIntegration": ".gitlab_integration", + "GitlabProviderAccount": ".gitlab_provider_account", + "GluonFramework": ".gluon_framework", + "GoogleGeminiProviderAccount": ".google_gemini_provider_account", + "GoogleModel": ".google_model", + "GoogleVertexProviderAccount": ".google_vertex_provider_account", + "Graph": ".graph", + "GraphChartType": ".graph_chart_type", + "GroqIntegrations": ".groq_integrations", + "GroqKeyAuth": ".groq_key_auth", + "GroqModel": ".groq_model", + "GroqProviderAccount": ".groq_provider_account", + "GuardrailConfigGroup": ".guardrail_config_group", + "GuardrailConfigIntegrations": ".guardrail_config_integrations", + "Guardrails": ".guardrails", + "GuardrailsConfig": ".guardrails_config", + "GuardrailsRule": ".guardrails_rule", + "GuardrailsWhen": ".guardrails_when", + "H2OFramework": ".h2o_framework", + "HeaderMatch": ".header_match", + "HealthProbe": ".health_probe", + "Helm": ".helm", + "HelmRepo": ".helm_repo", + "HelmSource": ".helm_source", + "HttpError": ".http_error", + "HttpErrorCode": ".http_error_code", + "HttpProbe": ".http_probe", + "HttpValidationError": ".http_validation_error", + "HuggingfaceArtifactSource": ".huggingface_artifact_source", + "IChange": ".i_change", + "IChangeOperation": ".i_change_operation", + "Image": ".image", + "ImageCommand": ".image_command", + "ImageContentPart": ".image_content_part", + "ImageUrl": ".image_url", + "ImageUrlUrl": ".image_url_url", + "InferMethodName": ".infer_method_name", + "InfraProviderAccount": ".infra_provider_account", + "IngressControllerConfig": ".ingress_controller_config", + "InputOutputBasedCostMetricValue": ".input_output_based_cost_metric_value", + "Intercept": ".intercept", + "InterceptRulesItem": ".intercept_rules_item", + "InterceptRulesItemAction": ".intercept_rules_item_action", + "InternalArtifactVersion": ".internal_artifact_version", + "InternalListArtifactVersionsResponse": ".internal_list_artifact_versions_response", + "InternalListArtifactVersionsResponseDataItem": ".internal_list_artifact_versions_response_data_item", + "InternalModelVersion": ".internal_model_version", + "InviteUserResponse": ".invite_user_response", + "IsClusterConnectedResponse": ".is_cluster_connected_response", + "JFrogIntegrations": ".j_frog_integrations", + "JfrogArtifactsRegistry": ".jfrog_artifacts_registry", + "JfrogBasicAuth": ".jfrog_basic_auth", + "JfrogProviderAccount": ".jfrog_provider_account", + "Job": ".job", + "JobAlert": ".job_alert", + "JobImage": ".job_image", + "JobMountsItem": ".job_mounts_item", + "JobRun": ".job_run", + "JobRunStatus": ".job_run_status", + "JobRunsSortBy": ".job_runs_sort_by", + "JobTrigger": ".job_trigger", + "JobTriggerInput": ".job_trigger_input", + "JobTriggerInputCommand": ".job_trigger_input_command", + "JsonObjectResponseFormat": ".json_object_response_format", + "JsonSchema": ".json_schema", + "JsonSchemaResponseFormat": ".json_schema_response_format", + "Jwt": ".jwt", + "JwtAuthConfig": ".jwt_auth_config", + "JwtAuthConfigClaimsItem": ".jwt_auth_config_claims_item", + "KafkaInputConfig": ".kafka_input_config", + "KafkaMetricConfig": ".kafka_metric_config", + "KafkaOutputConfig": ".kafka_output_config", + "KafkaSaslAuth": ".kafka_sasl_auth", + "KerasFramework": ".keras_framework", + "Kustomize": ".kustomize", + "LatencyBasedLoadBalanceTarget": ".latency_based_load_balance_target", + "LatencyBasedLoadBalancing": ".latency_based_load_balancing", + "LatencyBasedLoadBalancingRule": ".latency_based_load_balancing_rule", + "LibraryName": ".library_name", + "LightGbmFramework": ".light_gbm_framework", + "ListApplicationDeploymentsResponse": ".list_application_deployments_response", + "ListApplicationsResponse": ".list_applications_response", + "ListArtifactVersionsResponse": ".list_artifact_versions_response", + "ListArtifactsResponse": ".list_artifacts_response", + "ListClusterAddonsResponse": ".list_cluster_addons_response", + "ListClustersResponse": ".list_clusters_response", + "ListDataDirectoriesResponse": ".list_data_directories_response", + "ListEnvironmentsResponse": ".list_environments_response", + "ListFilesRequest": ".list_files_request", + "ListFilesResponse": ".list_files_response", + "ListJobRunResponse": ".list_job_run_response", + "ListMlReposResponse": ".list_ml_repos_response", + "ListModelVersionsResponse": ".list_model_versions_response", + "ListModelsResponse": ".list_models_response", + "ListPersonalAccessTokenResponse": ".list_personal_access_token_response", + "ListPromptVersionsResponse": ".list_prompt_versions_response", + "ListPromptsResponse": ".list_prompts_response", + "ListSecretGroupResponse": ".list_secret_group_response", + "ListSecretsResponse": ".list_secrets_response", + "ListTeamsResponse": ".list_teams_response", + "ListUsersResponse": ".list_users_response", + "ListVirtualAccountResponse": ".list_virtual_account_response", + "ListWorkspacesResponse": ".list_workspaces_response", + "LoadBalanceTarget": ".load_balance_target", + "LoadBalancingConfig": ".load_balancing_config", + "LoadBalancingRule": ".load_balancing_rule", + "LoadBalancingWhen": ".load_balancing_when", + "LocalArtifactSource": ".local_artifact_source", + "LocalModelSource": ".local_model_source", + "LocalSource": ".local_source", + "Log": ".log", + "LogsSearchFilterType": ".logs_search_filter_type", + "LogsSearchOperatorType": ".logs_search_operator_type", + "LogsSortingDirection": ".logs_sorting_direction", + "Manual": ".manual", + "McpServerAuth": ".mcp_server_auth", + "McpServerHeaderAuth": ".mcp_server_header_auth", + "McpServerHeaderOverrideAuth": ".mcp_server_header_override_auth", + "McpServerIntegration": ".mcp_server_integration", + "McpServerIntegrations": ".mcp_server_integrations", + "McpServerOAuth2": ".mcp_server_o_auth2", + "McpServerOAuth2Dcr": ".mcp_server_o_auth2dcr", + "McpServerOAuth2JwtSource": ".mcp_server_o_auth2jwt_source", + "McpServerPassthrough": ".mcp_server_passthrough", + "McpServerProviderAccount": ".mcp_server_provider_account", + "McpServerToolDetails": ".mcp_server_tool_details", + "McpServerWithFqn": ".mcp_server_with_fqn", + "McpServerWithUrl": ".mcp_server_with_url", + "McpTool": ".mcp_tool", + "Metadata": ".metadata", + "Metric": ".metric", + "MimeType": ".mime_type", + "MirrorAction": ".mirror_action", + "MistralAiIntegrations": ".mistral_ai_integrations", + "MistralAiKeyAuth": ".mistral_ai_key_auth", + "MistralAiModel": ".mistral_ai_model", + "MistralAiProviderAccount": ".mistral_ai_provider_account", + "MlRepo": ".ml_repo", + "MlRepoManifest": ".ml_repo_manifest", + "Model": ".model", + "ModelConfiguration": ".model_configuration", + "ModelCostMetric": ".model_cost_metric", + "ModelManifest": ".model_manifest", + "ModelManifestFramework": ".model_manifest_framework", + "ModelManifestSource": ".model_manifest_source", + "ModelProviderAccount": ".model_provider_account", + "ModelType": ".model_type", + "ModelVersion": ".model_version", + "ModelVersionEnvironment": ".model_version_environment", + "MultiPartUpload": ".multi_part_upload", + "MultiPartUploadResponse": ".multi_part_upload_response", + "MultiPartUploadStorageProvider": ".multi_part_upload_storage_provider", + "NatsInputConfig": ".nats_input_config", + "NatsMetricConfig": ".nats_metric_config", + "NatsOutputConfig": ".nats_output_config", + "NatsUserPasswordAuth": ".nats_user_password_auth", + "NodeSelector": ".node_selector", + "NodeSelectorCapacityType": ".node_selector_capacity_type", + "Nodepool": ".nodepool", + "NodepoolSelector": ".nodepool_selector", + "NomicIntegrations": ".nomic_integrations", + "NomicKeyAuth": ".nomic_key_auth", + "NomicModel": ".nomic_model", + "NomicProviderAccount": ".nomic_provider_account", + "Notebook": ".notebook", + "NotebookConfig": ".notebook_config", + "NotificationTarget": ".notification_target", + "NotificationTargetForAlertRule": ".notification_target_for_alert_rule", + "NvidiaGpu": ".nvidia_gpu", + "NvidiaMiggpu": ".nvidia_miggpu", + "NvidiaMiggpuProfile": ".nvidia_miggpu_profile", + "NvidiaTimeslicingGpu": ".nvidia_timeslicing_gpu", + "OAuth2LoginProvider": ".o_auth2login_provider", + "OciRepo": ".oci_repo", + "OllamaIntegrations": ".ollama_integrations", + "OllamaKeyAuth": ".ollama_key_auth", + "OllamaModel": ".ollama_model", + "OllamaProviderAccount": ".ollama_provider_account", + "OnnxFramework": ".onnx_framework", + "OpenAiIntegrations": ".open_ai_integrations", + "OpenAiModel": ".open_ai_model", + "OpenAiModerationsGuardrailConfig": ".open_ai_moderations_guardrail_config", + "OpenAiModerationsGuardrailConfigCategoryThresholdsValue": ".open_ai_moderations_guardrail_config_category_thresholds_value", + "OpenAiModerationsGuardrailConfigCategoryThresholdsValueHarassment": ".open_ai_moderations_guardrail_config_category_thresholds_value_harassment", + "OpenRouterApiKeyAuth": ".open_router_api_key_auth", + "OpenRouterIntegrations": ".open_router_integrations", + "OpenRouterModel": ".open_router_model", + "OpenRouterProviderAccount": ".open_router_provider_account", + "OpenaiApiKeyAuth": ".openai_api_key_auth", + "OpenaiProviderAccount": ".openai_provider_account", + "Operation": ".operation", + "PaddleFramework": ".paddle_framework", + "PagerDuty": ".pager_duty", + "PagerDutyIntegration": ".pager_duty_integration", + "PagerDutyIntegrationKeyAuth": ".pager_duty_integration_key_auth", + "PagerDutyIntegrations": ".pager_duty_integrations", + "PagerDutyProviderAccount": ".pager_duty_provider_account", + "Pagination": ".pagination", + "PalmIntegrations": ".palm_integrations", + "PalmKeyAuth": ".palm_key_auth", + "PalmModel": ".palm_model", + "PalmProviderAccount": ".palm_provider_account", + "PaloAltoPrismaAirsGuardrailConfig": ".palo_alto_prisma_airs_guardrail_config", + "PaloAltoPrismaAirsGuardrailConfigMode": ".palo_alto_prisma_airs_guardrail_config_mode", + "PaloAltoPrismaAirsKeyAuth": ".palo_alto_prisma_airs_key_auth", + "PangeaGuardType": ".pangea_guard_type", + "PangeaGuardrailConfig": ".pangea_guardrail_config", + "PangeaKeyAuth": ".pangea_key_auth", + "Param": ".param", + "ParamParamType": ".param_param_type", + "Parameters": ".parameters", + "ParametersStop": ".parameters_stop", + "PatronusAnswerRelevanceCriteria": ".patronus_answer_relevance_criteria", + "PatronusAnswerRelevanceEvaluator": ".patronus_answer_relevance_evaluator", + "PatronusEvaluator": ".patronus_evaluator", + "PatronusGliderCriteria": ".patronus_glider_criteria", + "PatronusGliderEvaluator": ".patronus_glider_evaluator", + "PatronusGuardrailConfig": ".patronus_guardrail_config", + "PatronusGuardrailConfigTarget": ".patronus_guardrail_config_target", + "PatronusJudgeCriteria": ".patronus_judge_criteria", + "PatronusJudgeEvaluator": ".patronus_judge_evaluator", + "PatronusKeyAuth": ".patronus_key_auth", + "PatronusPhiCriteria": ".patronus_phi_criteria", + "PatronusPhiEvaluator": ".patronus_phi_evaluator", + "PatronusPiiCriteria": ".patronus_pii_criteria", + "PatronusPiiEvaluator": ".patronus_pii_evaluator", + "PatronusToxicityCriteria": ".patronus_toxicity_criteria", + "PatronusToxicityEvaluator": ".patronus_toxicity_evaluator", + "PerThousandEmbeddingTokensCostMetric": ".per_thousand_embedding_tokens_cost_metric", + "PerThousandTokensCostMetric": ".per_thousand_tokens_cost_metric", + "Permissions": ".permissions", + "PerplexityAiKeyAuth": ".perplexity_ai_key_auth", + "PerplexityAiModel": ".perplexity_ai_model", + "PerplexityAiProviderAccount": ".perplexity_ai_provider_account", + "PerplexityIntegrations": ".perplexity_integrations", + "PersonalAccessTokenManifest": ".personal_access_token_manifest", + "Pip": ".pip", + "Poetry": ".poetry", + "PolicyActions": ".policy_actions", + "PolicyEntityTypes": ".policy_entity_types", + "PolicyFilters": ".policy_filters", + "PolicyManifest": ".policy_manifest", + "PolicyManifestMode": ".policy_manifest_mode", + "PolicyManifestOperation": ".policy_manifest_operation", + "PolicyMutationOperation": ".policy_mutation_operation", + "PolicyValidationOperation": ".policy_validation_operation", + "Port": ".port", + "PortAppProtocol": ".port_app_protocol", + "PortAuth": ".port_auth", + "PortProtocol": ".port_protocol", + "PresignedUrlObject": ".presigned_url_object", + "PriorityBasedLoadBalanceTarget": ".priority_based_load_balance_target", + "PriorityBasedLoadBalancing": ".priority_based_load_balancing", + "PriorityBasedLoadBalancingRule": ".priority_based_load_balancing_rule", + "PrometheusAlertRule": ".prometheus_alert_rule", + "Prompt": ".prompt", + "PromptFooGuardType": ".prompt_foo_guard_type", + "PromptFooGuardrailConfig": ".prompt_foo_guardrail_config", + "PromptVersion": ".prompt_version", + "ProviderAccounts": ".provider_accounts", + "PublicCostMetric": ".public_cost_metric", + "PySparkTaskConfig": ".py_spark_task_config", + "PyTorchFramework": ".py_torch_framework", + "PythonBuild": ".python_build", + "PythonBuildCommand": ".python_build_command", + "PythonBuildPythonDependencies": ".python_build_python_dependencies", + "PythonTaskConfig": ".python_task_config", + "PythonTaskConfigImage": ".python_task_config_image", + "PythonTaskConfigMountsItem": ".python_task_config_mounts_item", + "QuayArtifactsRegistry": ".quay_artifacts_registry", + "QuayBasicAuth": ".quay_basic_auth", + "QuayIntegrations": ".quay_integrations", + "QuayProviderAccount": ".quay_provider_account", + "QuerySpansResponse": ".query_spans_response", + "RStudio": ".r_studio", + "RateLimitConfig": ".rate_limit_config", + "RateLimitRule": ".rate_limit_rule", + "RateLimitUnit": ".rate_limit_unit", + "RateLimitWhen": ".rate_limit_when", + "Recommendation": ".recommendation", + "RefusalContentPart": ".refusal_content_part", + "RegisterUsersResponse": ".register_users_response", + "RemoteSource": ".remote_source", + "Resources": ".resources", + "ResourcesDevicesItem": ".resources_devices_item", + "ResourcesNode": ".resources_node", + "RetryConfig": ".retry_config", + "RevokeAllPersonalAccessTokenResponse": ".revoke_all_personal_access_token_response", + "Rolling": ".rolling", + "RpsMetric": ".rps_metric", + "SagemakerModel": ".sagemaker_model", + "SambaNovaIntegrations": ".samba_nova_integrations", + "SambaNovaKeyAuth": ".samba_nova_key_auth", + "SambaNovaModel": ".samba_nova_model", + "SambaNovaProviderAccount": ".samba_nova_provider_account", + "Schedule": ".schedule", + "ScheduleConcurrencyPolicy": ".schedule_concurrency_policy", + "Secret": ".secret", + "SecretGroup": ".secret_group", + "SecretInput": ".secret_input", + "SecretMount": ".secret_mount", + "SecretVersion": ".secret_version", + "SelfHostedModel": ".self_hosted_model", + "SelfHostedModelAuthData": ".self_hosted_model_auth_data", + "SelfHostedModelIntegrations": ".self_hosted_model_integrations", + "SelfHostedModelModelServer": ".self_hosted_model_model_server", + "SelfHostedModelProviderAccount": ".self_hosted_model_provider_account", + "Service": ".service", + "ServiceAutoscaling": ".service_autoscaling", + "ServiceAutoscalingMetrics": ".service_autoscaling_metrics", + "ServiceReplicas": ".service_replicas", + "ServiceRolloutStrategy": ".service_rollout_strategy", + "Session": ".session", + "SignedUrl": ".signed_url", + "SklearnFramework": ".sklearn_framework", + "SklearnModelSchema": ".sklearn_model_schema", + "SklearnSerializationFormat": ".sklearn_serialization_format", + "SlackBot": ".slack_bot", + "SlackBotAuth": ".slack_bot_auth", + "SlackBotIntegration": ".slack_bot_integration", + "SlackIntegrations": ".slack_integrations", + "SlackProviderAccount": ".slack_provider_account", + "SlackWebhook": ".slack_webhook", + "SlackWebhookAuth": ".slack_webhook_auth", + "SlackWebhookIntegration": ".slack_webhook_integration", + "SmtpCredentials": ".smtp_credentials", + "SortDirection": ".sort_direction", + "SpaCyFramework": ".spa_cy_framework", + "SparkBuild": ".spark_build", + "SparkConfig": ".spark_config", + "SparkDriverConfig": ".spark_driver_config", + "SparkExecutorConfig": ".spark_executor_config", + "SparkExecutorConfigInstances": ".spark_executor_config_instances", + "SparkExecutorDynamicScaling": ".spark_executor_dynamic_scaling", + "SparkExecutorFixedInstances": ".spark_executor_fixed_instances", + "SparkImage": ".spark_image", + "SparkImageBuild": ".spark_image_build", + "SparkImageBuildBuildSource": ".spark_image_build_build_source", + "SparkJob": ".spark_job", + "SparkJobEntrypoint": ".spark_job_entrypoint", + "SparkJobImage": ".spark_job_image", + "SparkJobJavaEntrypoint": ".spark_job_java_entrypoint", + "SparkJobPythonEntrypoint": ".spark_job_python_entrypoint", + "SparkJobPythonNotebookEntrypoint": ".spark_job_python_notebook_entrypoint", + "SparkJobScalaEntrypoint": ".spark_job_scala_entrypoint", + "SparkJobScalaNotebookEntrypoint": ".spark_job_scala_notebook_entrypoint", + "SparkJobTriggerInput": ".spark_job_trigger_input", + "SqsInputConfig": ".sqs_input_config", + "SqsOutputConfig": ".sqs_output_config", + "SqsQueueMetricConfig": ".sqs_queue_metric_config", + "SshServer": ".ssh_server", + "SshServerConfig": ".ssh_server_config", + "SsoTeamManifest": ".sso_team_manifest", + "StageArtifactResponse": ".stage_artifact_response", + "StaticVolumeConfig": ".static_volume_config", + "StatsModelsFramework": ".stats_models_framework", + "StringDataMount": ".string_data_mount", + "Subject": ".subject", + "SubjectType": ".subject_type", + "SystemMessage": ".system_message", + "SystemMessageContent": ".system_message_content", + "TaskDockerFileBuild": ".task_docker_file_build", + "TaskPySparkBuild": ".task_py_spark_build", + "TaskPythonBuild": ".task_python_build", + "Team": ".team", + "TeamManifest": ".team_manifest", + "TensorFlowFramework": ".tensor_flow_framework", + "TerminateJobResponse": ".terminate_job_response", + "TextContentPart": ".text_content_part", + "TextContentPartText": ".text_content_part_text", + "TogetherAiIntegrations": ".together_ai_integrations", + "TogetherAiKeyAuth": ".together_ai_key_auth", + "TogetherAiModel": ".together_ai_model", + "TogetherAiProviderAccount": ".together_ai_provider_account", + "TokenPagination": ".token_pagination", + "ToolCall": ".tool_call", + "ToolMessage": ".tool_message", + "ToolMessageContent": ".tool_message_content", + "ToolSchema": ".tool_schema", + "TraceSpan": ".trace_span", + "TracesSubjectType": ".traces_subject_type", + "TracingProject": ".tracing_project", + "TracingProjectManifest": ".tracing_project_manifest", + "TransformersFramework": ".transformers_framework", + "TriggerJobRunResponse": ".trigger_job_run_response", + "TrueFoundryApplyRequestManifest": ".true_foundry_apply_request_manifest", + "TrueFoundryApplyResponse": ".true_foundry_apply_response", + "TrueFoundryApplyResponseAction": ".true_foundry_apply_response_action", + "TrueFoundryApplyResponseExistingManifest": ".true_foundry_apply_response_existing_manifest", + "TrueFoundryArtifactSource": ".true_foundry_artifact_source", + "TrueFoundryDbssm": ".true_foundry_dbssm", + "TrueFoundryDeleteRequestManifest": ".true_foundry_delete_request_manifest", + "TrueFoundryIntegrations": ".true_foundry_integrations", + "TrueFoundryInteractiveLogin": ".true_foundry_interactive_login", + "TrueFoundryManagedSource": ".true_foundry_managed_source", + "TrueFoundryProviderAccount": ".true_foundry_provider_account", + "TtlIntegrations": ".ttl_integrations", + "TtlProviderAccount": ".ttl_provider_account", + "TtlRegistry": ".ttl_registry", + "UpdateSecretInput": ".update_secret_input", + "UpdateUserRolesResponse": ".update_user_roles_response", + "UpgradeData": ".upgrade_data", + "UsageCodeSnippet": ".usage_code_snippet", + "User": ".user", + "UserMessage": ".user_message", + "UserMessageContent": ".user_message_content", + "UserMessageContentItem": ".user_message_content_item", + "UserMetadata": ".user_metadata", + "UserMetadataTenantRoleManagedBy": ".user_metadata_tenant_role_managed_by", + "UserResource": ".user_resource", + "Uv": ".uv", + "ValidationError": ".validation_error", + "ValidationErrorLocItem": ".validation_error_loc_item", + "VertexModel": ".vertex_model", + "VertexModelV2": ".vertex_model_v2", + "VirtualAccount": ".virtual_account", + "VirtualAccountManifest": ".virtual_account_manifest", + "VirtualMcpServerIntegration": ".virtual_mcp_server_integration", + "VirtualMcpServerSource": ".virtual_mcp_server_source", + "Volume": ".volume", + "VolumeBrowser": ".volume_browser", + "VolumeConfig": ".volume_config", + "VolumeMount": ".volume_mount", + "WebhookBasicAuth": ".webhook_basic_auth", + "WebhookBearerAuth": ".webhook_bearer_auth", + "WebhookIntegration": ".webhook_integration", + "WebhookIntegrationAuthData": ".webhook_integration_auth_data", + "WebhookIntegrations": ".webhook_integrations", + "WebhookProviderAccount": ".webhook_provider_account", + "WeightBasedLoadBalancing": ".weight_based_load_balancing", + "WeightBasedLoadBalancingRule": ".weight_based_load_balancing_rule", + "WorkbenchImage": ".workbench_image", + "WorkerConfig": ".worker_config", + "WorkerConfigInputConfig": ".worker_config_input_config", + "WorkerConfigOutputConfig": ".worker_config_output_config", + "Workflow": ".workflow", + "WorkflowAlert": ".workflow_alert", + "WorkflowFlyteEntitiesItem": ".workflow_flyte_entities_item", + "WorkflowSource": ".workflow_source", + "Workspace": ".workspace", + "WorkspaceManifest": ".workspace_manifest", + "XgBoostFramework": ".xg_boost_framework", + "XgBoostModelSchema": ".xg_boost_model_schema", + "XgBoostSerializationFormat": ".xg_boost_serialization_format", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ActivateUserResponse", @@ -789,7 +1543,6 @@ "AlertConfigResource", "AlertConfigResourceType", "AlertSeverity", - "AlertStatus", "AmqpInputConfig", "AmqpMetricConfig", "AmqpOutputConfig", @@ -992,9 +1745,6 @@ "DockerhubIntegrations", "DockerhubProviderAccount", "DockerhubRegistry", - "DurationFilter", - "DurationFilterOperation", - "DurationFilterValue", "DynamicVolumeConfig", "Email", "EmailNotificationChannel", @@ -1007,10 +1757,6 @@ "EnvironmentColor", "EnvironmentManifest", "EnvironmentOptimizeFor", - "Event", - "EventChart", - "EventChartCategory", - "EventInvolvedObject", "ExternalBlobStorageSource", "FallbackConfig", "FallbackModel", @@ -1021,7 +1767,6 @@ "FiddlerGuardrailConfig", "FiddlerKeyAuth", "FileInfo", - "Filter", "FlyteLaunchPlan", "FlyteLaunchPlanId", "FlyteLaunchPlanSpec", @@ -1050,7 +1795,6 @@ "GcpRegion", "GcpTpu", "GeminiModelV2", - "GetAlertsResponse", "GetApplicationDeploymentResponse", "GetApplicationResponse", "GetArtifactResponse", @@ -1061,7 +1805,6 @@ "GetClusterResponse", "GetDataDirectoryResponse", "GetEnvironmentResponse", - "GetEventsResponse", "GetJobRunResponse", "GetLogsResponse", "GetMlRepoResponse", @@ -1076,6 +1819,7 @@ "GetSignedUrLsResponse", "GetSuggestedDeploymentEndpointResponse", "GetTeamResponse", + "GetTokenForVirtualAccountResponse", "GetUserResourcesResponse", "GetUserResponse", "GetUserTeamsResponse", @@ -1100,19 +1844,12 @@ "GroqProviderAccount", "GuardrailConfigGroup", "GuardrailConfigIntegrations", - "GuardrailMetersResponseDto", - "GuardrailMetricChart", - "GuardrailMetricsChartsResponseDto", - "GuardrailMetricsFiltersResponseDto", "Guardrails", "GuardrailsConfig", "GuardrailsRule", "GuardrailsWhen", "H2OFramework", - "HeaderLatencyBasedLoadBalancingRule", "HeaderMatch", - "HeaderPriorityBasedLoadBalancingRule", - "HeaderWeightBasedLoadBalancingRule", "HealthProbe", "Helm", "HelmRepo", @@ -1120,9 +1857,6 @@ "HttpError", "HttpErrorCode", "HttpProbe", - "HttpStatusCodeFilter", - "HttpStatusCodeFilterOperation", - "HttpStatusCodeFilterValue", "HttpValidationError", "HuggingfaceArtifactSource", "IChange", @@ -1132,8 +1866,6 @@ "ImageContentPart", "ImageUrl", "ImageUrlUrl", - "InFilter", - "InFilterOperation", "InferMethodName", "InfraProviderAccount", "IngressControllerConfig", @@ -1158,13 +1890,13 @@ "JobRun", "JobRunStatus", "JobRunsSortBy", - "JobRunsSortDirection", "JobTrigger", "JobTriggerInput", "JobTriggerInputCommand", "JsonObjectResponseFormat", "JsonSchema", "JsonSchemaResponseFormat", + "Jwt", "JwtAuthConfig", "JwtAuthConfigClaimsItem", "KafkaInputConfig", @@ -1174,10 +1906,10 @@ "KerasFramework", "Kustomize", "LatencyBasedLoadBalanceTarget", + "LatencyBasedLoadBalancing", "LatencyBasedLoadBalancingRule", "LibraryName", "LightGbmFramework", - "LikeFilter", "ListApplicationDeploymentsResponse", "ListApplicationsResponse", "ListArtifactVersionsResponse", @@ -1213,10 +1945,6 @@ "LogsSearchOperatorType", "LogsSortingDirection", "Manual", - "McpMetersResponseDto", - "McpMetricChart", - "McpMetricsChartsResponseDto", - "McpMetricsFiltersResponseDto", "McpServerAuth", "McpServerHeaderAuth", "McpServerHeaderOverrideAuth", @@ -1232,7 +1960,6 @@ "McpServerWithUrl", "McpTool", "Metadata", - "MetadataItem", "Metric", "MimeType", "MirrorAction", @@ -1306,6 +2033,7 @@ "PalmModel", "PalmProviderAccount", "PaloAltoPrismaAirsGuardrailConfig", + "PaloAltoPrismaAirsGuardrailConfigMode", "PaloAltoPrismaAirsKeyAuth", "PangeaGuardType", "PangeaGuardrailConfig", @@ -1354,6 +2082,7 @@ "PortProtocol", "PresignedUrlObject", "PriorityBasedLoadBalanceTarget", + "PriorityBasedLoadBalancing", "PriorityBasedLoadBalancingRule", "PrometheusAlertRule", "Prompt", @@ -1374,6 +2103,7 @@ "QuayBasicAuth", "QuayIntegrations", "QuayProviderAccount", + "QuerySpansResponse", "RStudio", "RateLimitConfig", "RateLimitRule", @@ -1426,6 +2156,7 @@ "SlackWebhookAuth", "SlackWebhookIntegration", "SmtpCredentials", + "SortDirection", "SpaCyFramework", "SparkBuild", "SparkConfig", @@ -1478,6 +2209,8 @@ "ToolMessage", "ToolMessageContent", "ToolSchema", + "TraceSpan", + "TracesSubjectType", "TracingProject", "TracingProjectManifest", "TransformersFramework", @@ -1526,6 +2259,7 @@ "WebhookIntegrationAuthData", "WebhookIntegrations", "WebhookProviderAccount", + "WeightBasedLoadBalancing", "WeightBasedLoadBalancingRule", "WorkbenchImage", "WorkerConfig", diff --git a/src/truefoundry_sdk/types/alert_status.py b/src/truefoundry_sdk/types/alert_status.py deleted file mode 100644 index 2f90c127..00000000 --- a/src/truefoundry_sdk/types/alert_status.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class AlertStatus(str, enum.Enum): - FIRING = "firing" - RESOLVED = "resolved" - - def visit(self, firing: typing.Callable[[], T_Result], resolved: typing.Callable[[], T_Result]) -> T_Result: - if self is AlertStatus.FIRING: - return firing() - if self is AlertStatus.RESOLVED: - return resolved() diff --git a/src/truefoundry_sdk/types/async_service.py b/src/truefoundry_sdk/types/async_service.py index 99a1d840..bf817da1 100644 --- a/src/truefoundry_sdk/types/async_service.py +++ b/src/truefoundry_sdk/types/async_service.py @@ -16,12 +16,12 @@ class AsyncService(BaseService): +docs=Describes the configuration for the async-service """ - type: typing.Optional[typing.Literal["async-service"]] = pydantic.Field(default=None) + type: typing.Literal["async-service"] = pydantic.Field(default="async-service") """ +value=async-service """ - replicas: typing.Optional[AsyncServiceReplicas] = pydantic.Field(default=None) + replicas: AsyncServiceReplicas = pydantic.Field() """ +label=Replicas +usage=Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing. @@ -29,7 +29,7 @@ class AsyncService(BaseService): """ rollout_strategy: typing.Optional[Rolling] = None - worker_config: typing.Optional[WorkerConfig] = None + worker_config: WorkerConfig sidecar: typing.Optional[AsyncProcessorSidecar] = None if IS_PYDANTIC_V2: diff --git a/src/truefoundry_sdk/types/async_service_autoscaling.py b/src/truefoundry_sdk/types/async_service_autoscaling.py index d6cc9b3e..1af2280e 100644 --- a/src/truefoundry_sdk/types/async_service_autoscaling.py +++ b/src/truefoundry_sdk/types/async_service_autoscaling.py @@ -9,7 +9,7 @@ class AsyncServiceAutoscaling(BaseAutoscaling): - metrics: typing.Optional[AsyncServiceAutoscalingMetrics] = pydantic.Field(default=None) + metrics: AsyncServiceAutoscalingMetrics = pydantic.Field() """ +label=Autoscaling metrics +usage=Metrics to use for the autoscaler diff --git a/src/truefoundry_sdk/types/auto_rotate.py b/src/truefoundry_sdk/types/auto_rotate.py index 41972b3e..65bedd4e 100644 --- a/src/truefoundry_sdk/types/auto_rotate.py +++ b/src/truefoundry_sdk/types/auto_rotate.py @@ -7,16 +7,26 @@ class AutoRotate(UniversalBaseModel): - auto_rotate_period: int = pydantic.Field(default=30) """ - +label=Auto Rotate Period - +usage=Auto Rotate Period in days after which the token will be rotated. Minimum value is 30. + +label=Enable Auto Rotation + +sort=4 + +usage=Enable Auto Rotation to automatically rotate the token + +message=Enable Auto Rotation to automatically rotate the token + +uiProps={"disableEdit":true} """ - grace_period: int = pydantic.Field(default=1) + auto_rotate_interval: int = pydantic.Field(default=360) """ - +label=Grace Period - +usage=Grace Period in days for which the token will be valid after auto rotate period. Minimum value is 1. + +label=Rotation Interval in days + +sort=1 + +usage=Rotation Interval in days after which the token will be rotated. Minimum value is 30. + """ + + grace_period: int = pydantic.Field(default=30) + """ + +label=Grace Period in days + +sort=2 + +usage=Grace Period in days for which the token will be valid after rotation interval. Minimum value is 1. """ if IS_PYDANTIC_V2: diff --git a/src/truefoundry_sdk/types/chat_prompt_manifest.py b/src/truefoundry_sdk/types/chat_prompt_manifest.py index 665fae5c..70064dfa 100644 --- a/src/truefoundry_sdk/types/chat_prompt_manifest.py +++ b/src/truefoundry_sdk/types/chat_prompt_manifest.py @@ -73,7 +73,11 @@ class ChatPromptManifest(UniversalBaseModel): Response format configuration for structured outputs """ - routing_config: typing.Optional[ChatPromptManifestRoutingConfig] = None + routing_config: typing.Optional[ChatPromptManifestRoutingConfig] = pydantic.Field(default=None) + """ + Configuration for routing requests to different model targets + """ + tool_call_to_mcp_mapping: typing.Optional[typing.Dict[str, McpServerToolDetails]] = pydantic.Field(default=None) """ Mapping of tool calls to MCP server integration IDs and tool names diff --git a/src/truefoundry_sdk/types/chat_prompt_manifest_routing_config.py b/src/truefoundry_sdk/types/chat_prompt_manifest_routing_config.py index da0acd3a..07c00a55 100644 --- a/src/truefoundry_sdk/types/chat_prompt_manifest_routing_config.py +++ b/src/truefoundry_sdk/types/chat_prompt_manifest_routing_config.py @@ -2,10 +2,10 @@ import typing -from .header_latency_based_load_balancing_rule import HeaderLatencyBasedLoadBalancingRule -from .header_priority_based_load_balancing_rule import HeaderPriorityBasedLoadBalancingRule -from .header_weight_based_load_balancing_rule import HeaderWeightBasedLoadBalancingRule +from .latency_based_load_balancing import LatencyBasedLoadBalancing +from .priority_based_load_balancing import PriorityBasedLoadBalancing +from .weight_based_load_balancing import WeightBasedLoadBalancing ChatPromptManifestRoutingConfig = typing.Union[ - HeaderWeightBasedLoadBalancingRule, HeaderLatencyBasedLoadBalancingRule, HeaderPriorityBasedLoadBalancingRule + WeightBasedLoadBalancing, LatencyBasedLoadBalancing, PriorityBasedLoadBalancing ] diff --git a/src/truefoundry_sdk/types/codeserver.py b/src/truefoundry_sdk/types/codeserver.py index 5a8c3381..f261e458 100644 --- a/src/truefoundry_sdk/types/codeserver.py +++ b/src/truefoundry_sdk/types/codeserver.py @@ -13,12 +13,12 @@ class Codeserver(BaseWorkbenchInput): +docs=Describes the configuration for the code server """ - type: typing.Optional[typing.Literal["codeserver"]] = pydantic.Field(default=None) + type: typing.Literal["codeserver"] = pydantic.Field(default="codeserver") """ +value=codeserver """ - image: typing.Optional[WorkbenchImage] = None + image: WorkbenchImage if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/duration_filter.py b/src/truefoundry_sdk/types/duration_filter.py deleted file mode 100644 index 0190fc71..00000000 --- a/src/truefoundry_sdk/types/duration_filter.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .duration_filter_operation import DurationFilterOperation -from .duration_filter_value import DurationFilterValue - - -class DurationFilter(UniversalBaseModel): - operation: DurationFilterOperation = pydantic.Field() - """ - Operation type for duration filter - """ - - value: DurationFilterValue = pydantic.Field() - """ - Duration value in milliseconds - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/duration_filter_operation.py b/src/truefoundry_sdk/types/duration_filter_operation.py deleted file mode 100644 index 5c259142..00000000 --- a/src/truefoundry_sdk/types/duration_filter_operation.py +++ /dev/null @@ -1,41 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class DurationFilterOperation(str, enum.Enum): - """ - Operation type for duration filter - """ - - GREATER_THAN = ">" - LESS_THAN = "<" - EQUAL_TO = "=" - GREATER_THAN_OR_EQUAL_TO = ">=" - LESS_THAN_OR_EQUAL_TO = "<=" - BETWEEN = "BETWEEN" - - def visit( - self, - greater_than: typing.Callable[[], T_Result], - less_than: typing.Callable[[], T_Result], - equal_to: typing.Callable[[], T_Result], - greater_than_or_equal_to: typing.Callable[[], T_Result], - less_than_or_equal_to: typing.Callable[[], T_Result], - between: typing.Callable[[], T_Result], - ) -> T_Result: - if self is DurationFilterOperation.GREATER_THAN: - return greater_than() - if self is DurationFilterOperation.LESS_THAN: - return less_than() - if self is DurationFilterOperation.EQUAL_TO: - return equal_to() - if self is DurationFilterOperation.GREATER_THAN_OR_EQUAL_TO: - return greater_than_or_equal_to() - if self is DurationFilterOperation.LESS_THAN_OR_EQUAL_TO: - return less_than_or_equal_to() - if self is DurationFilterOperation.BETWEEN: - return between() diff --git a/src/truefoundry_sdk/types/duration_filter_value.py b/src/truefoundry_sdk/types/duration_filter_value.py deleted file mode 100644 index 0119d514..00000000 --- a/src/truefoundry_sdk/types/duration_filter_value.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DurationFilterValue = typing.Union[float, typing.List[float]] diff --git a/src/truefoundry_sdk/types/event.py b/src/truefoundry_sdk/types/event.py deleted file mode 100644 index c618662e..00000000 --- a/src/truefoundry_sdk/types/event.py +++ /dev/null @@ -1,74 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata -from .event_chart import EventChart -from .event_involved_object import EventInvolvedObject - - -class Event(UniversalBaseModel): - name: typing.Optional[str] = pydantic.Field(default=None) - """ - Name of the event - """ - - first_timestamp: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="firstTimestamp")] = ( - pydantic.Field(default=None) - ) - """ - Timestamp when the event was first observed - """ - - last_timestamp: typing_extensions.Annotated[str, FieldMetadata(alias="lastTimestamp")] = pydantic.Field() - """ - Timestamp when the event was last observed - """ - - involved_object: typing_extensions.Annotated[EventInvolvedObject, FieldMetadata(alias="involvedObject")] = ( - pydantic.Field() - ) - """ - Details of the involved object - """ - - type: str = pydantic.Field() - """ - Type of the event - """ - - count: int = pydantic.Field() - """ - Number of occurrences of the event - """ - - reason: str = pydantic.Field() - """ - Reason for the event - """ - - message: str = pydantic.Field() - """ - Message describing the event - """ - - namespace: typing.Optional[str] = pydantic.Field(default=None) - """ - Namespace of the event - """ - - chart: EventChart = pydantic.Field() - """ - Chart of the event - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/event_chart.py b/src/truefoundry_sdk/types/event_chart.py deleted file mode 100644 index 2a1b1ebd..00000000 --- a/src/truefoundry_sdk/types/event_chart.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .event_chart_category import EventChartCategory - - -class EventChart(UniversalBaseModel): - category: EventChartCategory - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/event_chart_category.py b/src/truefoundry_sdk/types/event_chart_category.py deleted file mode 100644 index 007fe8ac..00000000 --- a/src/truefoundry_sdk/types/event_chart_category.py +++ /dev/null @@ -1,33 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class EventChartCategory(str, enum.Enum): - CONTAINER_TERMINATED = "ContainerTerminated" - CONTAINER_OOM = "ContainerOOM" - POD_TERMINATED = "PodTerminated" - POD_EVICTED = "PodEvicted" - GENERAL = "General" - - def visit( - self, - container_terminated: typing.Callable[[], T_Result], - container_oom: typing.Callable[[], T_Result], - pod_terminated: typing.Callable[[], T_Result], - pod_evicted: typing.Callable[[], T_Result], - general: typing.Callable[[], T_Result], - ) -> T_Result: - if self is EventChartCategory.CONTAINER_TERMINATED: - return container_terminated() - if self is EventChartCategory.CONTAINER_OOM: - return container_oom() - if self is EventChartCategory.POD_TERMINATED: - return pod_terminated() - if self is EventChartCategory.POD_EVICTED: - return pod_evicted() - if self is EventChartCategory.GENERAL: - return general() diff --git a/src/truefoundry_sdk/types/event_involved_object.py b/src/truefoundry_sdk/types/event_involved_object.py deleted file mode 100644 index f26d7e29..00000000 --- a/src/truefoundry_sdk/types/event_involved_object.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata - - -class EventInvolvedObject(UniversalBaseModel): - kind: str - name: str - api_version: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="apiVersion")] = None - namespace: typing.Optional[str] = None - container_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="containerName")] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/filter.py b/src/truefoundry_sdk/types/filter.py deleted file mode 100644 index cde1af33..00000000 --- a/src/truefoundry_sdk/types/filter.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class Filter(UniversalBaseModel): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/get_alerts_response.py b/src/truefoundry_sdk/types/get_alerts_response.py deleted file mode 100644 index 3d5c9bce..00000000 --- a/src/truefoundry_sdk/types/get_alerts_response.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .alert import Alert - - -class GetAlertsResponse(UniversalBaseModel): - data: typing.Dict[str, typing.List[Alert]] = pydantic.Field() - """ - Object containing alert data grouped by alert name - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/get_events_response.py b/src/truefoundry_sdk/types/get_events_response.py deleted file mode 100644 index e3ecefc1..00000000 --- a/src/truefoundry_sdk/types/get_events_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .event import Event - - -class GetEventsResponse(UniversalBaseModel): - data: typing.List[Event] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/mcp_metrics_filters_response_dto.py b/src/truefoundry_sdk/types/get_token_for_virtual_account_response.py similarity index 74% rename from src/truefoundry_sdk/types/mcp_metrics_filters_response_dto.py rename to src/truefoundry_sdk/types/get_token_for_virtual_account_response.py index 89cb5336..abbb4daa 100644 --- a/src/truefoundry_sdk/types/mcp_metrics_filters_response_dto.py +++ b/src/truefoundry_sdk/types/get_token_for_virtual_account_response.py @@ -4,11 +4,13 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .filter import Filter -class McpMetricsFiltersResponseDto(UniversalBaseModel): - filters: typing.List[Filter] +class GetTokenForVirtualAccountResponse(UniversalBaseModel): + token: str = pydantic.Field() + """ + Token for the virtual account + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/guardrail_meters_response_dto.py b/src/truefoundry_sdk/types/guardrail_meters_response_dto.py deleted file mode 100644 index ede742c7..00000000 --- a/src/truefoundry_sdk/types/guardrail_meters_response_dto.py +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata - - -class GuardrailMetersResponseDto(UniversalBaseModel): - aggregated_values: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="aggregatedValues") - ] = pydantic.Field(default=None) - """ - Aggregated values for use in graphs - """ - - meters: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field() - """ - Meter metrics for guardrails - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/guardrail_metric_chart.py b/src/truefoundry_sdk/types/guardrail_metric_chart.py deleted file mode 100644 index fb09f88a..00000000 --- a/src/truefoundry_sdk/types/guardrail_metric_chart.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class GuardrailMetricChart(UniversalBaseModel): - name: str = pydantic.Field() - """ - Name - """ - - display_name: str = pydantic.Field() - """ - DisplayName - """ - - description: str = pydantic.Field() - """ - Description - """ - - chart_type: str = pydantic.Field() - """ - Chart type - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/guardrail_metrics_charts_response_dto.py b/src/truefoundry_sdk/types/guardrail_metrics_charts_response_dto.py deleted file mode 100644 index 16af2b88..00000000 --- a/src/truefoundry_sdk/types/guardrail_metrics_charts_response_dto.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .guardrail_metric_chart import GuardrailMetricChart - - -class GuardrailMetricsChartsResponseDto(UniversalBaseModel): - charts: typing.List[GuardrailMetricChart] = pydantic.Field() - """ - Charts - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/guardrail_metrics_filters_response_dto.py b/src/truefoundry_sdk/types/guardrail_metrics_filters_response_dto.py deleted file mode 100644 index 3c475b77..00000000 --- a/src/truefoundry_sdk/types/guardrail_metrics_filters_response_dto.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .filter import Filter - - -class GuardrailMetricsFiltersResponseDto(UniversalBaseModel): - filters: typing.List[Filter] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/http_status_code_filter.py b/src/truefoundry_sdk/types/http_status_code_filter.py deleted file mode 100644 index e4e0d090..00000000 --- a/src/truefoundry_sdk/types/http_status_code_filter.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .http_status_code_filter_operation import HttpStatusCodeFilterOperation -from .http_status_code_filter_value import HttpStatusCodeFilterValue - - -class HttpStatusCodeFilter(UniversalBaseModel): - operation: HttpStatusCodeFilterOperation = pydantic.Field() - """ - Operation type for http status code filter - """ - - value: HttpStatusCodeFilterValue = pydantic.Field() - """ - Http status code value or array of http status codes - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/http_status_code_filter_operation.py b/src/truefoundry_sdk/types/http_status_code_filter_operation.py deleted file mode 100644 index 746deac3..00000000 --- a/src/truefoundry_sdk/types/http_status_code_filter_operation.py +++ /dev/null @@ -1,49 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class HttpStatusCodeFilterOperation(str, enum.Enum): - """ - Operation type for http status code filter - """ - - IN = "IN" - NOT_IN = "NOT IN" - GREATER_THAN = ">" - LESS_THAN = "<" - EQUAL_TO = "=" - GREATER_THAN_OR_EQUAL_TO = ">=" - LESS_THAN_OR_EQUAL_TO = "<=" - BETWEEN = "BETWEEN" - - def visit( - self, - in_: typing.Callable[[], T_Result], - not_in: typing.Callable[[], T_Result], - greater_than: typing.Callable[[], T_Result], - less_than: typing.Callable[[], T_Result], - equal_to: typing.Callable[[], T_Result], - greater_than_or_equal_to: typing.Callable[[], T_Result], - less_than_or_equal_to: typing.Callable[[], T_Result], - between: typing.Callable[[], T_Result], - ) -> T_Result: - if self is HttpStatusCodeFilterOperation.IN: - return in_() - if self is HttpStatusCodeFilterOperation.NOT_IN: - return not_in() - if self is HttpStatusCodeFilterOperation.GREATER_THAN: - return greater_than() - if self is HttpStatusCodeFilterOperation.LESS_THAN: - return less_than() - if self is HttpStatusCodeFilterOperation.EQUAL_TO: - return equal_to() - if self is HttpStatusCodeFilterOperation.GREATER_THAN_OR_EQUAL_TO: - return greater_than_or_equal_to() - if self is HttpStatusCodeFilterOperation.LESS_THAN_OR_EQUAL_TO: - return less_than_or_equal_to() - if self is HttpStatusCodeFilterOperation.BETWEEN: - return between() diff --git a/src/truefoundry_sdk/types/http_status_code_filter_value.py b/src/truefoundry_sdk/types/http_status_code_filter_value.py deleted file mode 100644 index 2d8e57dd..00000000 --- a/src/truefoundry_sdk/types/http_status_code_filter_value.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -HttpStatusCodeFilterValue = typing.Union[typing.List[float], float] diff --git a/src/truefoundry_sdk/types/in_filter_operation.py b/src/truefoundry_sdk/types/in_filter_operation.py deleted file mode 100644 index 69ba822e..00000000 --- a/src/truefoundry_sdk/types/in_filter_operation.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class InFilterOperation(str, enum.Enum): - """ - Operation type - """ - - IN = "IN" - NOT_IN = "NOT IN" - - def visit(self, in_: typing.Callable[[], T_Result], not_in: typing.Callable[[], T_Result]) -> T_Result: - if self is InFilterOperation.IN: - return in_() - if self is InFilterOperation.NOT_IN: - return not_in() diff --git a/src/truefoundry_sdk/types/jwt.py b/src/truefoundry_sdk/types/jwt.py new file mode 100644 index 00000000..656ee9f3 --- /dev/null +++ b/src/truefoundry_sdk/types/jwt.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata + + +class Jwt(UniversalBaseModel): + id: str + subject_type: typing_extensions.Annotated[str, FieldMetadata(alias="subjectType")] + subject_id: typing_extensions.Annotated[str, FieldMetadata(alias="subjectId")] + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + expiry: dt.datetime + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/header_latency_based_load_balancing_rule.py b/src/truefoundry_sdk/types/latency_based_load_balancing.py similarity index 92% rename from src/truefoundry_sdk/types/header_latency_based_load_balancing_rule.py rename to src/truefoundry_sdk/types/latency_based_load_balancing.py index dac3f8f3..c54d90d0 100644 --- a/src/truefoundry_sdk/types/header_latency_based_load_balancing_rule.py +++ b/src/truefoundry_sdk/types/latency_based_load_balancing.py @@ -7,14 +7,13 @@ from .latency_based_load_balance_target import LatencyBasedLoadBalanceTarget -class HeaderLatencyBasedLoadBalancingRule(UniversalBaseModel): +class LatencyBasedLoadBalancing(UniversalBaseModel): + type: typing.Literal["latency-based-routing"] = "latency-based-routing" load_balance_targets: typing.List[LatencyBasedLoadBalanceTarget] = pydantic.Field() """ List of targets for latency-based load balancing """ - type: typing.Literal["latency-based-routing"] = "latency-based-routing" - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 else: diff --git a/src/truefoundry_sdk/types/latency_based_load_balancing_rule.py b/src/truefoundry_sdk/types/latency_based_load_balancing_rule.py index c957fff9..b5f063ff 100644 --- a/src/truefoundry_sdk/types/latency_based_load_balancing_rule.py +++ b/src/truefoundry_sdk/types/latency_based_load_balancing_rule.py @@ -3,12 +3,12 @@ import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .latency_based_load_balance_target import LatencyBasedLoadBalanceTarget +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from .latency_based_load_balancing import LatencyBasedLoadBalancing from .load_balancing_when import LoadBalancingWhen -class LatencyBasedLoadBalancingRule(UniversalBaseModel): +class LatencyBasedLoadBalancingRule(LatencyBasedLoadBalancing): """ +label=Latency-based Load Balancing Rule """ @@ -17,25 +17,11 @@ class LatencyBasedLoadBalancingRule(UniversalBaseModel): """ +usage=Unique identifier for the rule +uiProps={"descriptionInline":true} - +sort=1 + +sort=2 +label=Rule ID """ when: LoadBalancingWhen - load_balance_targets: typing.List[LatencyBasedLoadBalanceTarget] = pydantic.Field() - """ - +usage=List of targets for latency-based load balancing - +uiProps={"descriptionInline":true} - +sort=3 - +label=Load Balance Targets - """ - - type: typing.Literal["latency-based-routing"] = pydantic.Field(default="latency-based-routing") - """ - +value=latency-based-routing - +sort=4 - +label=Routing Type - """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/like_filter.py b/src/truefoundry_sdk/types/like_filter.py deleted file mode 100644 index c96056a4..00000000 --- a/src/truefoundry_sdk/types/like_filter.py +++ /dev/null @@ -1,26 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class LikeFilter(UniversalBaseModel): - operation: typing.Literal["LIKE"] = pydantic.Field(default="LIKE") - """ - Operation type - """ - - value: str = pydantic.Field() - """ - Value to search for - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/list_files_request.py b/src/truefoundry_sdk/types/list_files_request.py index ea8197d9..9ebbc27a 100644 --- a/src/truefoundry_sdk/types/list_files_request.py +++ b/src/truefoundry_sdk/types/list_files_request.py @@ -3,14 +3,16 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata class ListFilesRequest(UniversalBaseModel): id: str path: typing.Optional[str] = None limit: typing.Optional[int] = None - page_token: typing.Optional[str] = None + page_token: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="pageToken")] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/mcp_meters_response_dto.py b/src/truefoundry_sdk/types/mcp_meters_response_dto.py deleted file mode 100644 index 5d43f23e..00000000 --- a/src/truefoundry_sdk/types/mcp_meters_response_dto.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata - - -class McpMetersResponseDto(UniversalBaseModel): - aggregated_values: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="aggregatedValues") - ] = pydantic.Field(default=None) - """ - Aggregated values for use in graphs - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/mcp_metric_chart.py b/src/truefoundry_sdk/types/mcp_metric_chart.py deleted file mode 100644 index 0b2ac77e..00000000 --- a/src/truefoundry_sdk/types/mcp_metric_chart.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class McpMetricChart(UniversalBaseModel): - name: str = pydantic.Field() - """ - Name - """ - - display_name: str = pydantic.Field() - """ - DisplayName - """ - - description: str = pydantic.Field() - """ - Description - """ - - chart_type: str = pydantic.Field() - """ - Chart type - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/mcp_metrics_charts_response_dto.py b/src/truefoundry_sdk/types/mcp_metrics_charts_response_dto.py deleted file mode 100644 index dbfd1c05..00000000 --- a/src/truefoundry_sdk/types/mcp_metrics_charts_response_dto.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .mcp_metric_chart import McpMetricChart - - -class McpMetricsChartsResponseDto(UniversalBaseModel): - charts: typing.List[McpMetricChart] = pydantic.Field() - """ - Charts - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/metadata_item.py b/src/truefoundry_sdk/types/metadata_item.py deleted file mode 100644 index 90cfc306..00000000 --- a/src/truefoundry_sdk/types/metadata_item.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class MetadataItem(UniversalBaseModel): - key: str - value: str - operator: typing.Optional[str] = pydantic.Field(default=None) - """ - Operator. Examples: "=", "!=", "LIKE" - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/notebook.py b/src/truefoundry_sdk/types/notebook.py index dac30ca3..f4430eec 100644 --- a/src/truefoundry_sdk/types/notebook.py +++ b/src/truefoundry_sdk/types/notebook.py @@ -13,12 +13,12 @@ class Notebook(BaseWorkbenchInput): +docs=Describes the configuration for the service """ - type: typing.Optional[typing.Literal["notebook"]] = pydantic.Field(default=None) + type: typing.Literal["notebook"] = pydantic.Field(default="notebook") """ +value=notebook """ - image: typing.Optional[WorkbenchImage] = None + image: WorkbenchImage cull_timeout: typing.Optional[int] = pydantic.Field(default=30) """ +label=Stop after (minutes of inactivity) diff --git a/src/truefoundry_sdk/types/o_auth2login_provider.py b/src/truefoundry_sdk/types/o_auth2login_provider.py index 943de518..56a02437 100644 --- a/src/truefoundry_sdk/types/o_auth2login_provider.py +++ b/src/truefoundry_sdk/types/o_auth2login_provider.py @@ -8,7 +8,7 @@ class OAuth2LoginProvider(BaseOAuth2Login): - type: typing.Optional[typing.Literal["oauth2"]] = pydantic.Field(default=None) + type: typing.Literal["oauth2"] = pydantic.Field(default="oauth2") """ +value=oauth2 """ diff --git a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py index b7cffafc..709acdaa 100644 --- a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py +++ b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config.py @@ -4,6 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .palo_alto_prisma_airs_guardrail_config_mode import PaloAltoPrismaAirsGuardrailConfigMode from .palo_alto_prisma_airs_key_auth import PaloAltoPrismaAirsKeyAuth @@ -37,6 +38,14 @@ class PaloAltoPrismaAirsGuardrailConfig(UniversalBaseModel): +sort=60 """ + mode: typing.Optional[PaloAltoPrismaAirsGuardrailConfigMode] = pydantic.Field(default=None) + """ + +label=Mode + +usage=Execution mode for the guardrail. Sync waits for the guardrail check to complete before proceeding. Async triggers the check without waiting. Defaults to sync. + +sort=70 + +uiType=Select + """ + auth_data: PaloAltoPrismaAirsKeyAuth if IS_PYDANTIC_V2: diff --git a/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py new file mode 100644 index 00000000..ec192648 --- /dev/null +++ b/src/truefoundry_sdk/types/palo_alto_prisma_airs_guardrail_config_mode.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class PaloAltoPrismaAirsGuardrailConfigMode(str, enum.Enum): + """ + +label=Mode + +usage=Execution mode for the guardrail. Sync waits for the guardrail check to complete before proceeding. Async triggers the check without waiting. Defaults to sync. + +sort=70 + +uiType=Select + """ + + SYNC = "sync" + ASYNC = "async" + + def visit(self, sync: typing.Callable[[], T_Result], async_: typing.Callable[[], T_Result]) -> T_Result: + if self is PaloAltoPrismaAirsGuardrailConfigMode.SYNC: + return sync() + if self is PaloAltoPrismaAirsGuardrailConfigMode.ASYNC: + return async_() diff --git a/src/truefoundry_sdk/types/priority_based_load_balance_target.py b/src/truefoundry_sdk/types/priority_based_load_balance_target.py index 3cfcc0ea..3fefb5e1 100644 --- a/src/truefoundry_sdk/types/priority_based_load_balance_target.py +++ b/src/truefoundry_sdk/types/priority_based_load_balance_target.py @@ -18,6 +18,11 @@ class PriorityBasedLoadBalanceTarget(UniversalBaseModel): Priority for the target, Lower the number, higher the priority (0 is the highest priority) """ + max_inter_token_latency: typing.Optional[int] = pydantic.Field(default=None) + """ + Maximum inter-token latency threshold in milliseconds. If ITL exceeds this value, the target will be marked as unhealthy + """ + retry_config: typing.Optional[RetryConfig] = None fallback_status_codes: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ diff --git a/src/truefoundry_sdk/types/header_priority_based_load_balancing_rule.py b/src/truefoundry_sdk/types/priority_based_load_balancing.py similarity index 91% rename from src/truefoundry_sdk/types/header_priority_based_load_balancing_rule.py rename to src/truefoundry_sdk/types/priority_based_load_balancing.py index c73adea0..1474e5f1 100644 --- a/src/truefoundry_sdk/types/header_priority_based_load_balancing_rule.py +++ b/src/truefoundry_sdk/types/priority_based_load_balancing.py @@ -7,14 +7,13 @@ from .priority_based_load_balance_target import PriorityBasedLoadBalanceTarget -class HeaderPriorityBasedLoadBalancingRule(UniversalBaseModel): +class PriorityBasedLoadBalancing(UniversalBaseModel): + type: typing.Literal["priority-based-routing"] = "priority-based-routing" load_balance_targets: typing.List[PriorityBasedLoadBalanceTarget] = pydantic.Field() """ List of targets for priority-based load balancing """ - type: typing.Literal["priority-based-routing"] = "priority-based-routing" - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 else: diff --git a/src/truefoundry_sdk/types/priority_based_load_balancing_rule.py b/src/truefoundry_sdk/types/priority_based_load_balancing_rule.py index 3cfccff0..721cf87f 100644 --- a/src/truefoundry_sdk/types/priority_based_load_balancing_rule.py +++ b/src/truefoundry_sdk/types/priority_based_load_balancing_rule.py @@ -3,35 +3,25 @@ import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 from .load_balancing_when import LoadBalancingWhen -from .priority_based_load_balance_target import PriorityBasedLoadBalanceTarget +from .priority_based_load_balancing import PriorityBasedLoadBalancing -class PriorityBasedLoadBalancingRule(UniversalBaseModel): +class PriorityBasedLoadBalancingRule(PriorityBasedLoadBalancing): + """ + +label=Priority-based Load Balancing Rule + """ + id: str = pydantic.Field() """ +usage=Unique identifier for the rule +uiProps={"descriptionInline":true} - +sort=1 + +sort=2 +label=Rule ID """ when: LoadBalancingWhen - load_balance_targets: typing.List[PriorityBasedLoadBalanceTarget] = pydantic.Field() - """ - +usage=List of targets for priority-based load balancing - +uiProps={"descriptionInline":true} - +sort=3 - +label=Load Balance Targets - """ - - type: typing.Literal["priority-based-routing"] = pydantic.Field(default="priority-based-routing") - """ - +value=priority-based-routing - +sort=4 - +label=Routing Type - """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/in_filter.py b/src/truefoundry_sdk/types/query_spans_response.py similarity index 62% rename from src/truefoundry_sdk/types/in_filter.py rename to src/truefoundry_sdk/types/query_spans_response.py index b99a67fb..5569f6df 100644 --- a/src/truefoundry_sdk/types/in_filter.py +++ b/src/truefoundry_sdk/types/query_spans_response.py @@ -4,18 +4,19 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .in_filter_operation import InFilterOperation +from .token_pagination import TokenPagination +from .trace_span import TraceSpan -class InFilter(UniversalBaseModel): - operation: InFilterOperation = pydantic.Field() +class QuerySpansResponse(UniversalBaseModel): + data: typing.List[TraceSpan] = pydantic.Field() """ - Operation type + Array of flat spans """ - value: typing.List[str] = pydantic.Field() + pagination: TokenPagination = pydantic.Field() """ - Array of values + Pagination information """ if IS_PYDANTIC_V2: diff --git a/src/truefoundry_sdk/types/r_studio.py b/src/truefoundry_sdk/types/r_studio.py index 3448b1b6..cdd88b97 100644 --- a/src/truefoundry_sdk/types/r_studio.py +++ b/src/truefoundry_sdk/types/r_studio.py @@ -13,12 +13,12 @@ class RStudio(BaseWorkbenchInput): +docs=Describes the configuration for the Rstudio server """ - type: typing.Optional[typing.Literal["rstudio"]] = pydantic.Field(default=None) + type: typing.Literal["rstudio"] = pydantic.Field(default="rstudio") """ +value=rstudio """ - image: typing.Optional[WorkbenchImage] = None + image: WorkbenchImage if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/service.py b/src/truefoundry_sdk/types/service.py index fa030a51..002b4c06 100644 --- a/src/truefoundry_sdk/types/service.py +++ b/src/truefoundry_sdk/types/service.py @@ -15,12 +15,12 @@ class Service(BaseService): +docs=Describes the configuration for the service """ - type: typing.Optional[typing.Literal["service"]] = pydantic.Field(default=None) + type: typing.Literal["service"] = pydantic.Field(default="service") """ +value=service """ - replicas: typing.Optional[ServiceReplicas] = pydantic.Field(default=None) + replicas: ServiceReplicas = pydantic.Field() """ +label=Replicas +usage=Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing. diff --git a/src/truefoundry_sdk/types/service_autoscaling.py b/src/truefoundry_sdk/types/service_autoscaling.py index 0691d0ec..d482a547 100644 --- a/src/truefoundry_sdk/types/service_autoscaling.py +++ b/src/truefoundry_sdk/types/service_autoscaling.py @@ -9,7 +9,7 @@ class ServiceAutoscaling(BaseAutoscaling): - metrics: typing.Optional[ServiceAutoscalingMetrics] = pydantic.Field(default=None) + metrics: ServiceAutoscalingMetrics = pydantic.Field() """ +label=Autoscaling metrics +usage=Metrics to use for the autoscaler diff --git a/src/truefoundry_sdk/types/job_runs_sort_direction.py b/src/truefoundry_sdk/types/sort_direction.py similarity index 70% rename from src/truefoundry_sdk/types/job_runs_sort_direction.py rename to src/truefoundry_sdk/types/sort_direction.py index 628c4f62..0f707a32 100644 --- a/src/truefoundry_sdk/types/job_runs_sort_direction.py +++ b/src/truefoundry_sdk/types/sort_direction.py @@ -6,12 +6,12 @@ T_Result = typing.TypeVar("T_Result") -class JobRunsSortDirection(str, enum.Enum): +class SortDirection(str, enum.Enum): ASC = "asc" DESC = "desc" def visit(self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result]) -> T_Result: - if self is JobRunsSortDirection.ASC: + if self is SortDirection.ASC: return asc() - if self is JobRunsSortDirection.DESC: + if self is SortDirection.DESC: return desc() diff --git a/src/truefoundry_sdk/types/ssh_server.py b/src/truefoundry_sdk/types/ssh_server.py index d681c2cf..8c2e3ce6 100644 --- a/src/truefoundry_sdk/types/ssh_server.py +++ b/src/truefoundry_sdk/types/ssh_server.py @@ -13,13 +13,13 @@ class SshServer(BaseWorkbenchInput): +docs=Describes the configuration for the ssh server """ - type: typing.Optional[typing.Literal["ssh-server"]] = pydantic.Field(default=None) + type: typing.Literal["ssh-server"] = pydantic.Field(default="ssh-server") """ +value=ssh-server """ - image: typing.Optional[WorkbenchImage] = None - ssh_public_key: typing.Optional[str] = pydantic.Field(default=None) + image: WorkbenchImage + ssh_public_key: str = pydantic.Field() """ +label: SSH Public Key +usage=Add Your SSH Public Key, this will be used to authenticate you to the SSH Server. \ diff --git a/src/truefoundry_sdk/types/token_pagination.py b/src/truefoundry_sdk/types/token_pagination.py index da94d948..d650c7c2 100644 --- a/src/truefoundry_sdk/types/token_pagination.py +++ b/src/truefoundry_sdk/types/token_pagination.py @@ -3,13 +3,30 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata class TokenPagination(UniversalBaseModel): - limit: typing.Optional[int] = None - previous_page_token: typing.Optional[str] = None - next_page_token: typing.Optional[str] = None + limit: int = pydantic.Field() + """ + Number of items per page + """ + + next_page_token: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextPageToken")] = ( + pydantic.Field(default=None) + ) + """ + Base64 encoded token for the next page + """ + + previous_page_token: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="previousPageToken")] = ( + pydantic.Field(default=None) + ) + """ + Base64 encoded token for the previous page + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/types/trace_span.py b/src/truefoundry_sdk/types/trace_span.py new file mode 100644 index 00000000..299cb599 --- /dev/null +++ b/src/truefoundry_sdk/types/trace_span.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .subject import Subject + + +class TraceSpan(UniversalBaseModel): + span_id: typing_extensions.Annotated[str, FieldMetadata(alias="spanId")] + trace_id: typing_extensions.Annotated[str, FieldMetadata(alias="traceId")] + parent_span_id: typing_extensions.Annotated[str, FieldMetadata(alias="parentSpanId")] + service_name: typing_extensions.Annotated[str, FieldMetadata(alias="serviceName")] + span_name: typing_extensions.Annotated[str, FieldMetadata(alias="spanName")] + span_kind: typing_extensions.Annotated[str, FieldMetadata(alias="spanKind")] + scope_name: typing_extensions.Annotated[str, FieldMetadata(alias="scopeName")] + scope_version: typing_extensions.Annotated[str, FieldMetadata(alias="scopeVersion")] + timestamp: str = pydantic.Field() + """ + Timestamp in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z). + """ + + duration: float + status_code: typing_extensions.Annotated[str, FieldMetadata(alias="statusCode")] + status_message: typing_extensions.Annotated[str, FieldMetadata(alias="statusMessage")] + span_attributes: typing_extensions.Annotated[ + typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="spanAttributes") + ] + events: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] + created_by_subject: typing_extensions.Annotated[Subject, FieldMetadata(alias="createdBySubject")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/truefoundry_sdk/types/traces_subject_type.py b/src/truefoundry_sdk/types/traces_subject_type.py new file mode 100644 index 00000000..ebf3ad96 --- /dev/null +++ b/src/truefoundry_sdk/types/traces_subject_type.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class TracesSubjectType(str, enum.Enum): + """ + Array of subject types to filter by + """ + + USER = "user" + VIRTUALACCOUNT = "virtualaccount" + + def visit(self, user: typing.Callable[[], T_Result], virtualaccount: typing.Callable[[], T_Result]) -> T_Result: + if self is TracesSubjectType.USER: + return user() + if self is TracesSubjectType.VIRTUALACCOUNT: + return virtualaccount() diff --git a/src/truefoundry_sdk/types/virtual_account.py b/src/truefoundry_sdk/types/virtual_account.py index e977deaa..4a8773f7 100644 --- a/src/truefoundry_sdk/types/virtual_account.py +++ b/src/truefoundry_sdk/types/virtual_account.py @@ -7,6 +7,7 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .jwt import Jwt from .subject import Subject from .virtual_account_manifest import VirtualAccountManifest @@ -21,6 +22,7 @@ class VirtualAccount(UniversalBaseModel): created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] is_expired: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isExpired")] = None + jwts: typing.Optional[typing.List[Jwt]] = None created_by: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdBy")] = None if IS_PYDANTIC_V2: diff --git a/src/truefoundry_sdk/types/header_weight_based_load_balancing_rule.py b/src/truefoundry_sdk/types/weight_based_load_balancing.py similarity index 91% rename from src/truefoundry_sdk/types/header_weight_based_load_balancing_rule.py rename to src/truefoundry_sdk/types/weight_based_load_balancing.py index 4ed69b86..dbee9bd9 100644 --- a/src/truefoundry_sdk/types/header_weight_based_load_balancing_rule.py +++ b/src/truefoundry_sdk/types/weight_based_load_balancing.py @@ -7,14 +7,13 @@ from .load_balance_target import LoadBalanceTarget -class HeaderWeightBasedLoadBalancingRule(UniversalBaseModel): +class WeightBasedLoadBalancing(UniversalBaseModel): + type: typing.Literal["weight-based-routing"] = "weight-based-routing" load_balance_targets: typing.List[LoadBalanceTarget] = pydantic.Field() """ List of targets for load balancing with weights """ - type: typing.Literal["weight-based-routing"] = "weight-based-routing" - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 else: diff --git a/src/truefoundry_sdk/types/weight_based_load_balancing_rule.py b/src/truefoundry_sdk/types/weight_based_load_balancing_rule.py index 4dda9b3d..7e79b612 100644 --- a/src/truefoundry_sdk/types/weight_based_load_balancing_rule.py +++ b/src/truefoundry_sdk/types/weight_based_load_balancing_rule.py @@ -3,12 +3,12 @@ import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .load_balance_target import LoadBalanceTarget +from ..core.pydantic_utilities import IS_PYDANTIC_V2 from .load_balancing_when import LoadBalancingWhen +from .weight_based_load_balancing import WeightBasedLoadBalancing -class WeightBasedLoadBalancingRule(UniversalBaseModel): +class WeightBasedLoadBalancingRule(WeightBasedLoadBalancing): """ +label=Weight-based Load Balancing Rule """ @@ -17,25 +17,11 @@ class WeightBasedLoadBalancingRule(UniversalBaseModel): """ +usage=Unique identifier for the rule +uiProps={"descriptionInline":true} - +sort=1 + +sort=2 +label=Rule ID """ when: LoadBalancingWhen - load_balance_targets: typing.List[LoadBalanceTarget] = pydantic.Field() - """ - +usage=List of targets for load balancing with weights - +uiProps={"descriptionInline":true} - +sort=3 - +label=Load Balance Targets - """ - - type: typing.Literal["weight-based-routing"] = pydantic.Field(default="weight-based-routing") - """ - +value=weight-based-routing - +sort=4 - +label=Routing Type - """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 diff --git a/src/truefoundry_sdk/users/client.py b/src/truefoundry_sdk/users/client.py index 06dac72b..2ea954cf 100644 --- a/src/truefoundry_sdk/users/client.py +++ b/src/truefoundry_sdk/users/client.py @@ -85,6 +85,9 @@ def list( response = client.users.list( limit=10, offset=0, + query="query", + show_invalid_users=True, + include_virtual_accounts="includeVirtualAccounts", ) for item in response: yield item @@ -553,6 +556,9 @@ async def main() -> None: response = await client.users.list( limit=10, offset=0, + query="query", + show_invalid_users=True, + include_virtual_accounts="includeVirtualAccounts", ) async for item in response: yield item diff --git a/src/truefoundry_sdk/virtual_accounts/client.py b/src/truefoundry_sdk/virtual_accounts/client.py index 84a19b0d..c6c2b34f 100644 --- a/src/truefoundry_sdk/virtual_accounts/client.py +++ b/src/truefoundry_sdk/virtual_accounts/client.py @@ -6,6 +6,7 @@ from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions from ..types.delete_virtual_account_response import DeleteVirtualAccountResponse +from ..types.get_token_for_virtual_account_response import GetTokenForVirtualAccountResponse from ..types.get_virtual_account_response import GetVirtualAccountResponse from ..types.virtual_account import VirtualAccount from ..types.virtual_account_manifest import VirtualAccountManifest @@ -194,6 +195,40 @@ def delete( _response = self._raw_client.delete(id, request_options=request_options) return _response.data + def get_token( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetTokenForVirtualAccountResponse: + """ + Get token for a virtual account by id + + Parameters + ---------- + id : str + serviceaccount id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTokenForVirtualAccountResponse + Token for the virtual account + + Examples + -------- + from truefoundry_sdk import TrueFoundry + + client = TrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + client.virtual_accounts.get_token( + id="id", + ) + """ + _response = self._raw_client.get_token(id, request_options=request_options) + return _response.data + class AsyncVirtualAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -412,3 +447,45 @@ async def main() -> None: """ _response = await self._raw_client.delete(id, request_options=request_options) return _response.data + + async def get_token( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetTokenForVirtualAccountResponse: + """ + Get token for a virtual account by id + + Parameters + ---------- + id : str + serviceaccount id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTokenForVirtualAccountResponse + Token for the virtual account + + Examples + -------- + import asyncio + + from truefoundry_sdk import AsyncTrueFoundry + + client = AsyncTrueFoundry( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.virtual_accounts.get_token( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_token(id, request_options=request_options) + return _response.data diff --git a/src/truefoundry_sdk/virtual_accounts/raw_client.py b/src/truefoundry_sdk/virtual_accounts/raw_client.py index 28d6b48f..154aa137 100644 --- a/src/truefoundry_sdk/virtual_accounts/raw_client.py +++ b/src/truefoundry_sdk/virtual_accounts/raw_client.py @@ -15,6 +15,7 @@ from ..errors.not_found_error import NotFoundError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.delete_virtual_account_response import DeleteVirtualAccountResponse +from ..types.get_token_for_virtual_account_response import GetTokenForVirtualAccountResponse from ..types.get_virtual_account_response import GetVirtualAccountResponse from ..types.list_virtual_account_response import ListVirtualAccountResponse from ..types.virtual_account import VirtualAccount @@ -267,6 +268,45 @@ def delete( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def get_token( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetTokenForVirtualAccountResponse]: + """ + Get token for a virtual account by id + + Parameters + ---------- + id : str + serviceaccount id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetTokenForVirtualAccountResponse] + Token for the virtual account + """ + _response = self._client_wrapper.httpx_client.request( + f"api/svc/v1/virtual-accounts/{jsonable_encoder(id)}/token", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTokenForVirtualAccountResponse, + parse_obj_as( + type_=GetTokenForVirtualAccountResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + class AsyncRawVirtualAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -513,3 +553,42 @@ async def delete( except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get_token( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetTokenForVirtualAccountResponse]: + """ + Get token for a virtual account by id + + Parameters + ---------- + id : str + serviceaccount id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetTokenForVirtualAccountResponse] + Token for the virtual account + """ + _response = await self._client_wrapper.httpx_client.request( + f"api/svc/v1/virtual-accounts/{jsonable_encoder(id)}/token", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTokenForVirtualAccountResponse, + parse_obj_as( + type_=GetTokenForVirtualAccountResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/truefoundry_sdk/workspaces/__init__.py b/src/truefoundry_sdk/workspaces/__init__.py index 2c0b99a6..774a4de7 100644 --- a/src/truefoundry_sdk/workspaces/__init__.py +++ b/src/truefoundry_sdk/workspaces/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .types import WorkspacesDeleteResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import WorkspacesDeleteResponse +_dynamic_imports: typing.Dict[str, str] = {"WorkspacesDeleteResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["WorkspacesDeleteResponse"] diff --git a/src/truefoundry_sdk/workspaces/client.py b/src/truefoundry_sdk/workspaces/client.py index c6188fa3..22f653ac 100644 --- a/src/truefoundry_sdk/workspaces/client.py +++ b/src/truefoundry_sdk/workspaces/client.py @@ -79,6 +79,9 @@ def list( response = client.workspaces.list( limit=10, offset=0, + cluster_id="clusterId", + name="name", + fqn="fqn", ) for item in response: yield item @@ -274,6 +277,9 @@ async def main() -> None: response = await client.workspaces.list( limit=10, offset=0, + cluster_id="clusterId", + name="name", + fqn="fqn", ) async for item in response: yield item diff --git a/src/truefoundry_sdk/workspaces/types/__init__.py b/src/truefoundry_sdk/workspaces/types/__init__.py index 5f30ca71..6f712e42 100644 --- a/src/truefoundry_sdk/workspaces/types/__init__.py +++ b/src/truefoundry_sdk/workspaces/types/__init__.py @@ -2,6 +2,33 @@ # isort: skip_file -from .workspaces_delete_response import WorkspacesDeleteResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .workspaces_delete_response import WorkspacesDeleteResponse +_dynamic_imports: typing.Dict[str, str] = {"WorkspacesDeleteResponse": ".workspaces_delete_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["WorkspacesDeleteResponse"] diff --git a/tests/utils/test_query_encoding.py b/tests/utils/test_query_encoding.py index 694a99e6..c6f8e73d 100644 --- a/tests/utils/test_query_encoding.py +++ b/tests/utils/test_query_encoding.py @@ -1,6 +1,5 @@ # This file was auto-generated by Fern from our API Definition. - from truefoundry_sdk.core.query_encoder import encode_query