Skip to content

Commit

Permalink
Release 0.0.77
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Mar 15, 2024
1 parent 3e88ec0 commit d426ba1
Show file tree
Hide file tree
Showing 7 changed files with 353 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .mock/definition/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: fern
auth: bearer
environments:
Production: https://api.buildwithfern.com
default-environment: Production
error-discrimination:
strategy: property
property-name: error
audiences:
- external
16 changes: 16 additions & 0 deletions .mock/definition/commons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

types:
ApiDefinitionId: uuid

OrgId:
type: string
docs: Human readable org id (e.g. fern)

ApiId:
type: string
docs: Human readable api identifier (e.g. venus)

DocsConfigId:
type: string
docs: The ID of a particular docs config.
290 changes: 290 additions & 0 deletions .mock/definition/snippets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
commons: commons.yml

service:
auth: true
base-path: /snippets
endpoints:
get:
path: ""
docs: Get snippet by endpoint method and path
display-name: Get snippet for endpoint
availability: pre-release
audiences:
- external
- fiddle
method: POST
request:
name: GetSnippetRequest
body:
properties:
orgId:
type: optional<commons.OrgId>
docs: |
If the same API is defined across multiple organization,
you must specify an organization ID.
apiId:
type: optional<commons.ApiId>
docs: |
If you have more than one API, you must specify its ID.
sdks:
type: optional<list<SDK>>
docs: |
The SDKs for which to load snippets. If unspecified,
snippets for the latest published SDKs will be returned.
loadLevel:
type: optional<SnippetLoadLevel>
docs: |
The level of detail to load for the snippet. If unspecified,
the full snippet will be returned.
endpoint: EndpointIdentifier
response: list<Snippet>
examples:
- request:
endpoint:
method: GET
path: /v1/search
response:
body:
- type: python
sdk:
package: vellum-ai
version: 1.2.1
sync_client: |
import Vellum from vellum.client
client = Vellum(api_key="YOUR_API_KEY")
client.search(query="Find documents written in the last 5 days")
async_client: |
import VellumAsync from vellum.client
client = VellumAsync(api_key="YOUR_API_KEY")
await client.search(query="Find documents written in the last 5 days")
- type: typescript
sdk:
package: vellum-ai
version: 1.2.1
client: |
import { VellumClient } from "vellum-ai";
const vellum = VellumClient({
apiKey="YOUR_API_KEY"
})
vellum.search({
query: "Find documents written in the last 5 days"
})
load:
path: /load
display-name: Load all snippets
method: POST
availability: pre-release
audiences:
- external
- fiddle
request:
name: ListSnippetsRequest
query-parameters:
page: optional<integer>
body:
properties:
orgId:
type: optional<commons.OrgId>
docs: |
If the same API is defined across multiple organization,
you must specify an organization ID.
apiId:
type: optional<commons.ApiId>
docs: |
If you have more than one API, you must specify its ID.
sdks:
type: optional<list<SDK>>
docs: |
The SDKs for which to load snippets. If unspecified,
snippets for the latest published SDKs will be returned.
loadLevel:
type: optional<SnippetLoadLevel>
docs: |
The level of detail to load for the snippet. If unspecified,
the full snippet will be returned.
response: SnippetsPage
examples:
- query-parameters:
page: 1
request:
orgId: vellum
apiId: vellum-ai
sdks:
- type: python
package: vellum-ai
version: 1.2.1
response:
body:
next: 2
snippets:
/v1/search:
GET:
- type: python
sdk:
package: vellum-ai
version: 1.2.1
sync_client: |
import Vellum from vellum.client
client = Vellum(api_key="YOUR_API_KEY")
client.search(query="Find documents written in the last 5 days")
async_client: |
import Vellum from vellum.client
client = Vellum(api_key="YOUR_API_KEY")
client.search(query="Find documents written in the last 5 days")
- type: typescript
sdk:
package: vellum-ai
version: 1.2.1
client: |
import { VellumClient } from "vellum-ai";
const vellum = VellumClient({
apiKey="YOUR_API_KEY"
})
vellum.search({
query: "Find documents written in the last 5 days"
})
v1/document-indexes:
POST:
- type: python
sdk:
package: vellum-ai
version: 1.2.1
sync_client: |
import Vellum from vellum.client
client = Vellum(api_key="YOUR_API_KEY")
client.document_indexes.create(name="meeting-reports", status="ACTIVE")
async_client: |
import VellumAsync from vellum.client
client = VellumAsync(api_key="YOUR_API_KEY")
await client.document_indexes.create(name="meeting-reports", status="ACTIVE")
- type: typescript
sdk:
package: vellum-ai
version: 1.2.1
client: |
import { VellumClient } from "vellum-ai";
const vellum = VellumClient({
apiKey="YOUR_API_KEY"
})
vellum.documentIndexes.create({
name: "meeting-reports",
status: "ACTIVE"
})
types:
SnippetLoadLevel:
enum:
- value: full
docs: |
The full snippet including client instantiation and method call.
- value: endpoint
docs: |
Only returns the part of the snippet for the endpoint call. In
other words, the client instantiation is not included.
EndpointIdentifier:
properties:
path: EndpointPath
method: EndpointMethod

EndpointPath:
type: string
docs: The relative path for an endpont (e.g. `/users/{userId}`)

EndpointMethod:
enum:
- PUT
- POST
- GET
- PATCH
- DELETE

SDK:
union:
typescript: TypeScriptSDK
python: PythonSDK
go: GoSDK
java: JavaSDK

TypeScriptSDK:
properties:
package: string
version: string

PythonSDK:
properties:
package: string
version: string

GoSDK:
properties:
githubRepo: string
version: string

JavaSDK:
properties:
group:
type: string
docs: The maven repository group (e.g. `com.stripe.java`)
artifact:
type: string
docs: The artifact (e.g. `stripe-java`)
version: string

####### Load Snippets #######

SnippetsPage:
properties:
next:
type: optional<integer>
docs: If present, pass this into the `page` query parameter to load the next page.
snippets:
type: map<EndpointPath, SnippetsByEndpointMethod>
docs: |
The snippets are returned as a map of endpoint path (e.g. `/api/users`)
to a map of endpoint method (e.g. `POST`) to snippets.
SnippetsByEndpointMethod:
type: map<EndpointMethod, list<Snippet>>

Snippet:
union:
typescript: TypeScriptSnippet
python: PythonSnippet
java: JavaSnippet
go: GoSnippet

TypeScriptSnippet:
properties:
sdk: TypeScriptSDK
client: string

PythonSnippet:
properties:
sdk: PythonSDK
async_client: string
sync_client: string

GoSnippet:
properties:
sdk: GoSDK
client: string

JavaSnippet:
properties:
sdk: JavaSDK
async_client: string
sync_client: string
4 changes: 4 additions & 0 deletions .mock/fern.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"organization" : "fern",
"version" : "0.0.77"
}
31 changes: 31 additions & 0 deletions .mock/generators.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
groups:
node-sdk:
audiences:
- external
generators:
- name: fernapi/fern-typescript-node-sdk
version: 0.9.2
output:
location: npm
package-name: '@fern-api/node-sdk'
token: ${NPM_TOKEN}
github:
repository: fern-api/node-sdk
license: MIT
config:
namespaceExport: Fern
python-sdk:
audiences:
- external
generators:
- name: fernapi/fern-python-sdk
version: 0.12.1
output:
location: pypi
package-name: fern-api
# token: ${PYPI_TOKEN}
github:
repository: fern-api/python-sdk
license: MIT
config:
client_class_name: Fern
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fern-api"
version = "0.0.76"
version = "0.0.77"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 1 addition & 1 deletion src/fern/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "fern-api",
"X-Fern-SDK-Version": "0.0.76",
"X-Fern-SDK-Version": "0.0.77",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down

0 comments on commit d426ba1

Please sign in to comment.