diff --git a/fern/products/sdks/overview/python/configuration.mdx b/fern/products/sdks/overview/python/configuration.mdx
index 1c0eb6af7..2556a076c 100644
--- a/fern/products/sdks/overview/python/configuration.mdx
+++ b/fern/products/sdks/overview/python/configuration.mdx
@@ -5,17 +5,19 @@ description: Configuration options for the Fern Python SDK.
You can customize the behavior of the Python SDK generator in `generators.yml`:
-```yaml {7-10}
+```yaml {7-12}
default-group: local
groups:
local:
generators:
- name: fernapi/fern-python
- version: 0.7.1
+ version:
config:
package_name: "your_package"
client:
class_name: "YourClient"
+ pydantic-config:
+ skip_validation: true
```
## SDK Configuration Options
@@ -85,56 +87,12 @@ groups:
local:
generators:
- name: fernapi/fern-python
- version: 0.7.1
+ version:
config:
package_name: "my_custom_package"
```
-
-
-
-
- When enabled, the generator will output a Pydantic `__root__` class that will contain utilities to visit the union. For example, for the following union type:
-
- ```
- types:
- Shape:
- union:
- circle: Circle
- triangle: Triangle
- ```
- you will get a generated `Shape` class that has a factory and visitor:
- ```python
- # Use a factory to instantiate the union
- Shape.factory.circle(Circle(...))
-
- # Visit every case in the union
- shape = get_shape()
- shape.visit(
- circle: lambda circle: do_something_with_circle(circle),
- triangle: lambda triangle: do_something_with_triangle(triangle),
- )
- ```
-
- When enabled, the python generator will not run Black formatting in the generated code. Black is slow so this can potentially speed up code generation quite a bit.
-
-
-
- By default, the generator generates pydantic models that are v1 and v2 compatible. However you can override them to:
- - `v1`: strictly use Pydantic v1
- - `v2`: strictly use Pydantic v2
- - `both`: maintain compatibility with both versions
- - `v1_on_v2`: use Pydantic v1 compatibility layer on v2
-
- Example:
- ```yaml
- config:
- pydantic_config:
- version: v1 # or v2 or "both"
- ```
-
-
This changes your declared python dependency, which is not meant to be done often if at all. This is a last resort if any dependencies force you to change your version requirements.
@@ -194,4 +152,139 @@ groups:
The name of the exported client class that will be used in code snippets.
+
+
+### pydantic-config
+
+Configure Pydantic model generation settings for your Python SDK.
+
+```yaml
+config:
+ pydantic-config:
+ enum_type: "literals"
+ extra_fields: "forbid"
+ frozen: true
+ include_union_utils: false
+ include_validators: true
+ orm_mode: false
+ require_optional_fields: false
+ skip_formatting: false
+ skip_validation: true
+ smart_union: true
+ union_naming: "v0"
+ use_inheritance_for_extended_models: true
+ use_pydantic_field_aliases: false
+ use_provided_defaults: true
+ use_str_enums: true
+ use_typeddict_requests: false
+ wrapped_aliases: false
+```
+
+
+ The type of enums to use in the generated models:
+ - `literals`: Use Python Literal types, e.g. `MyEnum = Literal["foo", "bar"]`
+ - `forward_compatible_python_enums`: Use Python Enum classes, with a `MyEnum._UNKNOWN` member for forward compatibility. `MyEnum._UNKNOWN.value` contains the raw unrecognized value.
+ - `python_enums`: Your vanilla Python enum class, with the members defined within your API.
+
+
+
+ How to handle extra fields not defined in the model schema.
+
+
+
+ Whether Pydantic models should be frozen (immutable after creation).
+
+
+
+ When enabled, the generator will output a Pydantic `__root__` class that will contain utilities to visit the union. For example, for the following union type:
+
+ ```
+ types:
+ Shape:
+ union:
+ circle: Circle
+ triangle: Triangle
+ ```
+ you will get a generated `Shape` class that has a factory and visitor:
+ ```python
+ # Use a factory to instantiate the union
+ Shape.factory.circle(Circle(...))
+
+ # Visit every case in the union
+ shape = get_shape()
+ shape.visit(
+ circle: lambda circle: do_something_with_circle(circle),
+ triangle: lambda triangle: do_something_with_triangle(triangle),
+ )
+ ```
+
+
+
+ Include custom validators in generated Pydantic models.
+
+
+
+ Enable ORM mode for Pydantic models to work with ORMs like SQLAlchemy.
+
+
+
+ Custom package name for the generated models.
+
+
+
+ Whether optional fields must be explicitly provided (cannot be omitted).
+
+
+
+ Skip code formatting for generated Pydantic models.
+
+
+
+ When enabled, disables Pydantic validation for API responses. This ensures that Pydantic does not immediately fail if the model being returned from an API does not exactly match the Pydantic model.
+
+ This is meant to add flexibility should your SDK fall behind your API, but should be used sparingly, as the type-hinting for users will still reflect the Pydantic model exactly.
+
+
+
+ Enable smart union handling in Pydantic models for better type discrimination.
+
+
+
+ Control union naming strategy. If you are dealing with discriminated union members that already have the discriminant property on them (and they're only used in one union), you should prefer the global API config within your `generators.yml`:
+ ```yaml
+ - name: fernapi/fern-python-sdk
+ version: 3.0.0-rc0
+ api:
+ settings:
+ unions: v1
+ ```
+
+
+
+ Use Pydantic field aliases for property names that differ from wire format.
+
+
+
+ Leverage defaults specified in the API specification.
+
+
+
+ Generate TypedDicts instead of Pydantic Models for request objects.
+
+
+
+ By default, the generator generates pydantic models that are v1 and v2 compatible. However you can override them to:
+ - `v1`: strictly use Pydantic v1
+ - `v2`: strictly use Pydantic v2
+ - `both`: maintain compatibility with both versions
+ - `v1_on_v2`: use Pydantic v1 compatibility layer on v2
+
+
+
+
+ Enable wrapped aliases for Pydantic models. Only supported in Pydantic V1, V1_ON_V2, or V2.
+
+
+
+ Generate Pydantic models that implement inheritance when a model utilizes the Fern `extends` keyword.
\ No newline at end of file