Skip to content

Configuration for generating SDKs and Documentation.

Notifications You must be signed in to change notification settings

octoml/fern-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Octo Fern Configuration

This repository contains Fern configurations.

Getting Started

To install the Fern CLI run:

npm install -g fern-api

To validate your API, run:

fern check

Updating your SDKs

To update your SDKs, simply tag a release with <language>@<version> e.g. python@<version> or node@<version> on the repository.

Under the hood this leverages the Fern CLI:

fern generate --group python-sdk --api api

You can also trigger a release by running git actions manually.

Custom Code

Sometimes we need to augment fern generated code. We currently do this for two reasons:

  • Orchestration of complex operations. An example of this is asset upload, where we wish to call a series of endpoints from a single SDK operation.
  • Adding functionality not supported by Open API. For example, compute uses wildcard routes for inferencing, which is not support by Open API.

In order to author custom code, you'll need to add files to .fernignore in the corresponding language repository. In cases where you need to mix generated and custom code in a single release, you'll need to configure fern to make a pull request instead of immediately releasing code.

Update the generators.yml configuration file. Each generator contains a github section, which you can add a mode: pull-request to.

groups:
  python-sdk:
    generators:
      - name: fernapi/fern-python-sdk
        version: 1.2.0-rc2
        output:
          location: pypi
          package-name: "octoai"
          token: ${PYPI_TOKEN}
        github:
          repository: octoml/octoai-python-sdk-fern
          mode: pull-request