This page covers how to add custom logic, methods, and dependencies to your Python SDK.
To get started adding custom code:
Fern also allows you to add custom methods to the SDK itself (e.g.
client.my_method() ) by inheriting the Fern generated client and then
extending it.
See an example from ElevenLabs using this process in their Python SDK.
generators.yml configurationName your Fern-generated client something like BaseClient to reflect
that this client will be extended. Configure the generator to output the
client in a file called base_client.py.
First, import the Fern generated base clients from .base_client.py and extend them to create your custom clients. Then, add whatever methods you want.
See an example client.py from ElevenLabs.
.fernignoreAdd the client.py to .fernignore.
See an example .fernignore from ElevenLabs.
This feature is available only for the Enterprise plan. To get started, reach out to support@buildwithfern.com.
To add packages that your custom code requires, update your generators.yml.