Skip to content

Commit 8c1004d

Browse files
committed
SDK regeneration
1 parent b5720b2 commit 8c1004d

10 files changed

+130
-20
lines changed

src/truefoundry_sdk/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
AwsAssumedRoleBasedAuth,
6666
AwsBedrockGuardrailConfig,
6767
AwsBedrockGuardrailConfigAuthData,
68+
AwsBedrockGuardrailConfigOperation,
6869
AwsBedrockProviderAccount,
6970
AwsBedrockProviderAccountAuthData,
7071
AwsEcr,
@@ -164,6 +165,8 @@
164165
CustomBlobStorage,
165166
CustomGuardrailConfig,
166167
CustomGuardrailConfigAuthData,
168+
CustomGuardrailConfigOperation,
169+
CustomGuardrailConfigTarget,
167170
CustomHelmRepo,
168171
CustomIntegrations,
169172
CustomJwtAuthIntegration,
@@ -800,6 +803,7 @@
800803
"AwsAssumedRoleBasedAuth",
801804
"AwsBedrockGuardrailConfig",
802805
"AwsBedrockGuardrailConfigAuthData",
806+
"AwsBedrockGuardrailConfigOperation",
803807
"AwsBedrockProviderAccount",
804808
"AwsBedrockProviderAccountAuthData",
805809
"AwsEcr",
@@ -902,6 +906,8 @@
902906
"CustomBlobStorage",
903907
"CustomGuardrailConfig",
904908
"CustomGuardrailConfigAuthData",
909+
"CustomGuardrailConfigOperation",
910+
"CustomGuardrailConfigTarget",
905911
"CustomHelmRepo",
906912
"CustomIntegrations",
907913
"CustomJwtAuthIntegration",

src/truefoundry_sdk/types/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
from .aws_assumed_role_based_auth import AwsAssumedRoleBasedAuth
6868
from .aws_bedrock_guardrail_config import AwsBedrockGuardrailConfig
6969
from .aws_bedrock_guardrail_config_auth_data import AwsBedrockGuardrailConfigAuthData
70+
from .aws_bedrock_guardrail_config_operation import AwsBedrockGuardrailConfigOperation
7071
from .aws_bedrock_provider_account import AwsBedrockProviderAccount
7172
from .aws_bedrock_provider_account_auth_data import AwsBedrockProviderAccountAuthData
7273
from .aws_ecr import AwsEcr
@@ -166,6 +167,8 @@
166167
from .custom_blob_storage import CustomBlobStorage
167168
from .custom_guardrail_config import CustomGuardrailConfig
168169
from .custom_guardrail_config_auth_data import CustomGuardrailConfigAuthData
170+
from .custom_guardrail_config_operation import CustomGuardrailConfigOperation
171+
from .custom_guardrail_config_target import CustomGuardrailConfigTarget
169172
from .custom_helm_repo import CustomHelmRepo
170173
from .custom_integrations import CustomIntegrations
171174
from .custom_jwt_auth_integration import CustomJwtAuthIntegration
@@ -744,6 +747,7 @@
744747
"AwsAssumedRoleBasedAuth",
745748
"AwsBedrockGuardrailConfig",
746749
"AwsBedrockGuardrailConfigAuthData",
750+
"AwsBedrockGuardrailConfigOperation",
747751
"AwsBedrockProviderAccount",
748752
"AwsBedrockProviderAccountAuthData",
749753
"AwsEcr",
@@ -843,6 +847,8 @@
843847
"CustomBlobStorage",
844848
"CustomGuardrailConfig",
845849
"CustomGuardrailConfigAuthData",
850+
"CustomGuardrailConfigOperation",
851+
"CustomGuardrailConfigTarget",
846852
"CustomHelmRepo",
847853
"CustomIntegrations",
848854
"CustomJwtAuthIntegration",

src/truefoundry_sdk/types/aws_bedrock_guardrail_config.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pydantic
66
from ..core.pydantic_utilities import IS_PYDANTIC_V2
77
from .aws_bedrock_guardrail_config_auth_data import AwsBedrockGuardrailConfigAuthData
8+
from .aws_bedrock_guardrail_config_operation import AwsBedrockGuardrailConfigOperation
89
from .aws_region import AwsRegion
910
from .base_guardrail_config import BaseGuardrailConfig
1011

@@ -20,13 +21,21 @@ class AwsBedrockGuardrailConfig(BaseGuardrailConfig):
2021
+value=integration/guardrail-config/aws-bedrock
2122
"""
2223

24+
operation: typing.Optional[AwsBedrockGuardrailConfigOperation] = pydantic.Field(default=None)
25+
"""
26+
+label=Operation
27+
+usage=The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
28+
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
29+
+uiType=Select
30+
+sort=50
31+
"""
32+
2333
auth_data: typing.Optional[AwsBedrockGuardrailConfigAuthData] = pydantic.Field(default=None)
2434
"""
2535
+label=AWS Account Auth Data
2636
+usage=Authentication data for the AWS account
2737
"""
2838

29-
region: typing.Optional[AwsRegion] = None
3039
guardrail_id: typing.Optional[str] = pydantic.Field(default=None)
3140
"""
3241
+label=Guardrail ID
@@ -39,11 +48,7 @@ class AwsBedrockGuardrailConfig(BaseGuardrailConfig):
3948
+usage=The version of the Guardrail to use.
4049
"""
4150

42-
redact_pii: typing.Optional[bool] = pydantic.Field(default=None)
43-
"""
44-
+label=Redact PII
45-
+usage=Whether to redact PII from the response. If this is true, your request will be transformed to redact PII from the response else a validation error will be returned.
46-
"""
51+
region: typing.Optional[AwsRegion] = None
4752

4853
if IS_PYDANTIC_V2:
4954
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import enum
4+
import typing
5+
6+
T_Result = typing.TypeVar("T_Result")
7+
8+
9+
class AwsBedrockGuardrailConfigOperation(str, enum.Enum):
10+
"""
11+
+label=Operation
12+
+usage=The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
13+
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
14+
+uiType=Select
15+
+sort=50
16+
"""
17+
18+
VALIDATE = "validate"
19+
MUTATE = "mutate"
20+
21+
def visit(self, validate: typing.Callable[[], T_Result], mutate: typing.Callable[[], T_Result]) -> T_Result:
22+
if self is AwsBedrockGuardrailConfigOperation.VALIDATE:
23+
return validate()
24+
if self is AwsBedrockGuardrailConfigOperation.MUTATE:
25+
return mutate()

src/truefoundry_sdk/types/custom_guardrail_config.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from ..core.pydantic_utilities import IS_PYDANTIC_V2
77
from .base_guardrail_config import BaseGuardrailConfig
88
from .custom_guardrail_config_auth_data import CustomGuardrailConfigAuthData
9+
from .custom_guardrail_config_operation import CustomGuardrailConfigOperation
10+
from .custom_guardrail_config_target import CustomGuardrailConfigTarget
911

1012

1113
class CustomGuardrailConfig(BaseGuardrailConfig):
@@ -19,33 +21,49 @@ class CustomGuardrailConfig(BaseGuardrailConfig):
1921
+value=integration/guardrail-config/custom
2022
"""
2123

24+
operation: typing.Optional[CustomGuardrailConfigOperation] = pydantic.Field(default=None)
25+
"""
26+
+label=Operation
27+
+usage=The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
28+
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
29+
+uiType=Select
30+
+sort=100
31+
"""
32+
33+
target: typing.Optional[CustomGuardrailConfigTarget] = pydantic.Field(default=None)
34+
"""
35+
+label=Target
36+
+usage=Specify whether the guardrail should be applied to the request or response. Guardrails with target "Request" can be only used in input guardrails and guardrails with target "Response" can only be used in output guardrails.
37+
+uiType=Select
38+
+sort=200
39+
"""
40+
2241
url: typing.Optional[str] = pydantic.Field(default=None)
2342
"""
2443
+label=URL
44+
+sort=300
2545
+usage=The URL of the Guardrail to send a post request to.
2646
"""
2747

2848
auth_data: typing.Optional[CustomGuardrailConfigAuthData] = pydantic.Field(default=None)
2949
"""
3050
+label=Auth Data
51+
+sort=450
3152
+usage=Authentication data for the Guardrail Server.
3253
"""
3354

3455
headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
3556
"""
3657
+label=Headers
58+
+sort=500
3759
+usage=Headers for the Guardrail Server. Forwarded to the Guardrail Server as is. For example: `{"Authorization": "APIKey <token>"}`
3860
"""
3961

40-
redact_pii: typing.Optional[bool] = pydantic.Field(default=None)
41-
"""
42-
+label=Redact PII
43-
+usage=Whether to redact PII from the response. If this is true, your request will be transformed to redact PII from the response else a validation error will be returned.
44-
"""
45-
4662
config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
4763
"""
4864
+label=Config
65+
+sort=600
66+
+uiType=JsonInput
4967
+usage=The config for the Guardrail Server. This is a JSON object that will be sent as a config to Guardrail Server along with the request.
5068
"""
5169

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import enum
4+
import typing
5+
6+
T_Result = typing.TypeVar("T_Result")
7+
8+
9+
class CustomGuardrailConfigOperation(str, enum.Enum):
10+
"""
11+
+label=Operation
12+
+usage=The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests.
13+
Validate guardrails are run in parallel while mutate guardrails are run sequentially.
14+
+uiType=Select
15+
+sort=100
16+
"""
17+
18+
VALIDATE = "validate"
19+
MUTATE = "mutate"
20+
21+
def visit(self, validate: typing.Callable[[], T_Result], mutate: typing.Callable[[], T_Result]) -> T_Result:
22+
if self is CustomGuardrailConfigOperation.VALIDATE:
23+
return validate()
24+
if self is CustomGuardrailConfigOperation.MUTATE:
25+
return mutate()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import enum
4+
import typing
5+
6+
T_Result = typing.TypeVar("T_Result")
7+
8+
9+
class CustomGuardrailConfigTarget(str, enum.Enum):
10+
"""
11+
+label=Target
12+
+usage=Specify whether the guardrail should be applied to the request or response. Guardrails with target "Request" can be only used in input guardrails and guardrails with target "Response" can only be used in output guardrails.
13+
+uiType=Select
14+
+sort=200
15+
"""
16+
17+
REQUEST = "request"
18+
RESPONSE = "response"
19+
20+
def visit(self, request: typing.Callable[[], T_Result], response: typing.Callable[[], T_Result]) -> T_Result:
21+
if self is CustomGuardrailConfigTarget.REQUEST:
22+
return request()
23+
if self is CustomGuardrailConfigTarget.RESPONSE:
24+
return response()

src/truefoundry_sdk/types/dynamic_volume_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class DynamicVolumeConfig(UniversalBaseModel):
1010
"""
11-
+label=Dynamic Volume Config
11+
+label=Create new volume
1212
"""
1313

1414
type: typing.Literal["dynamic"] = pydantic.Field(default="dynamic")

src/truefoundry_sdk/types/open_ai_moderations_guardrail_config.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ class OpenAiModerationsGuardrailConfig(BaseGuardrailConfig):
2323
"""
2424
+value=integration/guardrail-config/openai-moderations
2525
+sort=50
26+
+uiType=Hidden
2627
"""
2728

28-
auth_data: typing.Optional[OpenaiApiKeyAuth] = None
2929
base_url: typing.Optional[str] = pydantic.Field(default=None)
3030
"""
3131
+label=Base URL
32-
+sort=300
33-
+usage=Optional custom base URL for OpenAI API
34-
+message=Base URL must not be empty
32+
+sort=100
33+
+usage=Optional custom base URL for OpenAI API. If not provided, the default base URL will be used.
3534
"""
3635

36+
auth_data: typing.Optional[OpenaiApiKeyAuth] = None
3737
model: typing.Optional[str] = pydantic.Field(default="omni-moderation-latest")
3838
"""
3939
+label=OpenAI Moderation Model
40-
+sort=400
40+
+sort=300
4141
+usage=The model to use for the OpenAI Moderation API.
4242
"""
4343

@@ -46,8 +46,9 @@ class OpenAiModerationsGuardrailConfig(BaseGuardrailConfig):
4646
)
4747
"""
4848
+label=Category Thresholds
49-
+sort=500
49+
+sort=400
5050
+usage=The thresholds for the OpenAI Moderation API.
51+
+uiType=Hidden
5152
"""
5253

5354
if IS_PYDANTIC_V2:

src/truefoundry_sdk/types/static_volume_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class StaticVolumeConfig(UniversalBaseModel):
1010
"""
11-
+label=Static Volume Config
11+
+label=Use existing volume
1212
"""
1313

1414
type: typing.Literal["static"] = pydantic.Field(default="static")

0 commit comments

Comments
 (0)