Skip to content

Commit e7ef518

Browse files
committed
Update configuration.mdx based on issue #266
1 parent 04c20ac commit e7ef518

File tree

1 file changed

+59
-46
lines changed

1 file changed

+59
-46
lines changed

fern/products/sdks/overview/python/configuration.mdx

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,55 @@ groups:
2121
## SDK Configuration Options
2222
2323
<ParamField path="additional_init_exports" type="array" default="null" required={false} toc={true}>
24+
Additional exports to include in the package's __init__.py file.
25+
</ParamField>
26+
27+
<ParamField path="client" type="object" default="{}" required={false} toc={true}>
28+
Configuration for the generated client class and file structure.
29+
30+
```yaml
31+
config:
32+
client:
33+
filename: "my_client.py"
34+
class_name: "MyClient"
35+
exported_filename: "my_client.py"
36+
exported_class_name: "MyClient"
37+
```
38+
</ParamField>
39+
40+
<ParamField path="client.filename" type="string" default="client.py" required={false} toc={true}>
41+
The filename for the generated client file.
42+
</ParamField>
43+
44+
<ParamField path="client.class_name" type="string" default="null" required={false} toc={true}>
45+
The name of the generated client class.
46+
</ParamField>
47+
48+
<ParamField path="client.exported_filename" type="string" default="client.py" required={false} toc={true}>
49+
The filename of the exported client which will be used in code snippets.
50+
</ParamField>
51+
52+
<ParamField path="client.exported_class_name" type="string" default="null" required={false} toc={true}>
53+
The name of the exported client class that will be used in code snippets.
2454
</ParamField>
2555
2656
<ParamField path="default_bytes_stream_chunk_size" type="number" default="null" required={false} toc={true}>
2757
The chunk size to use (if any) when processing a response bytes stream within `iter_bytes` or `aiter_bytes` results in: `for chunk in response.iter_bytes(chunk_size=<default_bytes_stream_chunk_size>):`
2858
</ParamField>
2959

3060
<ParamField path="exclude_types_from_init_exports" type="bool" default="false" required={false} toc={true}>
61+
Whether to exclude type definitions from the package's __init__.py exports.
62+
</ParamField>
63+
64+
<ParamField path="extension_headers" type="object" default="{}" required={false} toc={true}>
65+
Headers to inject into all requests made by the client. Useful for custom authentication or tracking.
66+
67+
```yaml
68+
config:
69+
extension_headers:
70+
x-custom-header: "custom-value"
71+
x-api-key: "default-key"
72+
```
3173
</ParamField>
3274

3375
<ParamField path="extra_dependencies" type="object" default="{}" required={false} toc={true}>
@@ -40,27 +82,31 @@ groups:
4082
</ParamField>
4183

4284
<ParamField path="extra_dev_dependencies" type="object" default="{}" required={false} toc={true}>
85+
Additional development dependencies to include in the generated package.
4386
</ParamField>
4487

4588
<ParamField path="extras" type="object" default="{}" required={false} toc={true}>
89+
Optional feature groups that can be installed with the package.
4690
</ParamField>
4791

4892
<ParamField path="flat_layout" type="bool" default="false" required={false} toc={true}>
93+
Whether to generate a flat file structure instead of nested directories.
4994
</ParamField>
5095

5196
<ParamField path="follow_redirects_by_default" type="bool" default="true" required={false} toc={true}>
5297
Whether to follow redirects by default in HTTP requests.
5398
</ParamField>
5499

55100
<ParamField path="improved_imports" type="bool" default="true" required={false} toc={true}>
56-
Feature flag that improves imports in the Python SDK by removing nested `resources` directory
101+
Feature flag that improves imports in the Python SDK by removing nested `resources` directory.
57102
</ParamField>
58103

59104
<ParamField path="include_legacy_wire_tests" type="bool" default="false" required={false} toc={true}>
60-
Whether or not to include legacy wire tests in the generated SDK
105+
Whether or not to include legacy wire tests in the generated SDK.
61106
</ParamField>
62107

63108
<ParamField path="include_union_utils" type="bool" default="false" required={false} toc={true}>
109+
Whether to include utility functions for working with union types.
64110
</ParamField>
65111

66112
<ParamField path="inline_path_params" type="bool" default="false" required={false} toc={true}>
@@ -72,26 +118,18 @@ groups:
72118
</ParamField>
73119

74120
<ParamField path="package_name" type="string" default="null" required={false} toc={true}>
75-
76-
Specifies the Python package name that users will import your generated client
77-
from.
121+
Specifies the Python package name that users will import your generated client from.
78122

79-
For example, setting `package_name: "my_custom_package"` enables users to use
80-
`my_custom_package import Client` to import your client:
123+
For example, setting `package_name: "my_custom_package"` enables users to use `from my_custom_package import Client` to import your client:
81124

82-
```yaml {7-10}
83-
default-group: local
84-
groups:
85-
local:
86-
generators:
87-
- name: fernapi/fern-python
88-
version: 0.7.1
89-
config:
90-
package_name: "my_custom_package"
91-
```
125+
```yaml
126+
config:
127+
package_name: "my_custom_package"
128+
```
92129
</ParamField>
93130

94-
<ParamField path="pydantic_config" type="SdkPydanticModelCustomConfig" default="SdkPydanticModelCustomConfig()" required={false} toc={true}>
131+
<ParamField path="pydantic_config" type="object" default="{}" required={false} toc={true}>
132+
Configuration options for Pydantic model generation.
95133
</ParamField>
96134

97135
<ParamField path="pydantic_config.include_union_utils" type="bool" default="false" required={false} toc={true}>
@@ -140,20 +178,23 @@ groups:
140178
</ParamField>
141179
142180
<ParamField path="pyproject_toml" type="string" default="null" required={false} toc={true}>
181+
Custom pyproject.toml content to include in the generated package.
143182
</ParamField>
144183
145184
<ParamField path="should_generate_websocket_clients" type="bool" default="false" required={false} toc={true}>
146185
Feature flag that enables generation of Python websocket clients.
147186
</ParamField>
148187
149188
<ParamField path="skip_formatting" type="bool" default="false" required={false} toc={true}>
189+
Whether to skip code formatting of the generated files.
150190
</ParamField>
151191
152192
<ParamField path="timeout_in_seconds" type="number | 'infinity'" default="60" required={false} toc={true}>
153193
By default, the generator generates a client that times out after 60 seconds. You can customize this value by providing a different number or setting to `infinity` to get rid of timeouts.
154194
</ParamField>
155195

156196
<ParamField path="use_api_name_in_package" type="bool" default="false" required={false} toc={true}>
197+
Whether to include the API name in the generated package name.
157198
</ParamField>
158199

159200
<ParamField path="use_inheritance_for_extended_models" type="bool" default="true" required={false} toc={true}>
@@ -166,32 +207,4 @@ groups:
166207

167208
<ParamField path="use_typeddict_requests_for_file_upload" type="bool" default="false" required={false} toc={true}>
168209
Whether or not to generate TypedDicts instead of Pydantic Models for file upload request objects. Note that this flag was only introduced due to an oversight in the `use_typeddict_requests` flag implementation; it should be removed in the future.
169-
</ParamField>
170-
171-
### client
172-
Configuration for the generated client class and file structure.
173-
174-
```yaml
175-
config:
176-
client:
177-
filename: "my_client.py"
178-
class_name: "MyClient"
179-
exported_filename: "my_client.py"
180-
exported_class_name: "MyClient"
181-
```
182-
183-
<ParamField path="filename" type="string" default="client.py" required={false} toc={true}>
184-
The filename for the generated client file.
185-
</ParamField>
186-
187-
<ParamField path="class_name" type="string" default="null" required={false} toc={true}>
188-
The name of the generated client class.
189-
</ParamField>
190-
191-
<ParamField path="exported_filename" type="string" default="client.py" required={false} toc={true}>
192-
The filename of the exported client which will be used in code snippets.
193-
</ParamField>
194-
195-
<ParamField path="exported_class_name" type="string" default="null" required={false} toc={true}>
196-
The name of the exported client class that will be used in code snippets.
197210
</ParamField>

0 commit comments

Comments
 (0)