Skip to content

Commit 186a403

Browse files
committed
Release 0.0.10
1 parent dce5e43 commit 186a403

12 files changed

+487
-3
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ jobs:
3838

3939
- name: Test
4040
run: |
41-
poetry run pytest .
41+
fern test --command "poetry run pytest -rP ."

.mock/definition/api.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: fern
2+
auth: bearer
3+
environments:
4+
Production: https://api.buildwithfern.com
5+
default-environment: Production
6+
error-discrimination:
7+
strategy: property
8+
property-name: error
9+
audiences:
10+
- external

.mock/definition/commons.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
2+
3+
types:
4+
ApiDefinitionId: uuid
5+
6+
OrgId:
7+
type: string
8+
docs: Human readable org id (e.g. fern)
9+
10+
ApiId:
11+
type: string
12+
docs: Human readable api identifier (e.g. venus)
13+
14+
DocsConfigId:
15+
type: string
16+
docs: The ID of a particular docs config.

.mock/definition/snippets.yml

+290
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
2+
3+
imports:
4+
commons: commons.yml
5+
6+
service:
7+
auth: true
8+
base-path: /snippets
9+
endpoints:
10+
get:
11+
path: ""
12+
docs: Get snippet by endpoint method and path
13+
display-name: Get snippet for endpoint
14+
availability: pre-release
15+
audiences:
16+
- external
17+
- fiddle
18+
method: POST
19+
request:
20+
name: GetSnippetRequest
21+
body:
22+
properties:
23+
orgId:
24+
type: optional<commons.OrgId>
25+
docs: |
26+
If the same API is defined across multiple organization,
27+
you must specify an organization ID.
28+
apiId:
29+
type: optional<commons.ApiId>
30+
docs: |
31+
If you have more than one API, you must specify its ID.
32+
sdks:
33+
type: optional<list<SDK>>
34+
docs: |
35+
The SDKs for which to load snippets. If unspecified,
36+
snippets for the latest published SDKs will be returned.
37+
loadLevel:
38+
type: optional<SnippetLoadLevel>
39+
docs: |
40+
The level of detail to load for the snippet. If unspecified,
41+
the full snippet will be returned.
42+
endpoint: EndpointIdentifier
43+
response: list<Snippet>
44+
examples:
45+
- request:
46+
endpoint:
47+
method: GET
48+
path: /v1/search
49+
response:
50+
body:
51+
- type: python
52+
sdk:
53+
package: vellum-ai
54+
version: 1.2.1
55+
sync_client: |
56+
import Vellum from vellum.client
57+
58+
client = Vellum(api_key="YOUR_API_KEY")
59+
client.search(query="Find documents written in the last 5 days")
60+
async_client: |
61+
import VellumAsync from vellum.client
62+
63+
client = VellumAsync(api_key="YOUR_API_KEY")
64+
await client.search(query="Find documents written in the last 5 days")
65+
- type: typescript
66+
sdk:
67+
package: vellum-ai
68+
version: 1.2.1
69+
client: |
70+
import { VellumClient } from "vellum-ai";
71+
72+
const vellum = VellumClient({
73+
apiKey="YOUR_API_KEY"
74+
})
75+
vellum.search({
76+
query: "Find documents written in the last 5 days"
77+
})
78+
79+
load:
80+
path: /load
81+
display-name: Load all snippets
82+
method: POST
83+
availability: pre-release
84+
audiences:
85+
- external
86+
- fiddle
87+
request:
88+
name: ListSnippetsRequest
89+
query-parameters:
90+
page: optional<integer>
91+
body:
92+
properties:
93+
orgId:
94+
type: optional<commons.OrgId>
95+
docs: |
96+
If the same API is defined across multiple organization,
97+
you must specify an organization ID.
98+
apiId:
99+
type: optional<commons.ApiId>
100+
docs: |
101+
If you have more than one API, you must specify its ID.
102+
sdks:
103+
type: optional<list<SDK>>
104+
docs: |
105+
The SDKs for which to load snippets. If unspecified,
106+
snippets for the latest published SDKs will be returned.
107+
loadLevel:
108+
type: optional<SnippetLoadLevel>
109+
docs: |
110+
The level of detail to load for the snippet. If unspecified,
111+
the full snippet will be returned.
112+
response: SnippetsPage
113+
examples:
114+
- query-parameters:
115+
page: 1
116+
request:
117+
orgId: vellum
118+
apiId: vellum-ai
119+
sdks:
120+
- type: python
121+
package: vellum-ai
122+
version: 1.2.1
123+
response:
124+
body:
125+
next: 2
126+
snippets:
127+
/v1/search:
128+
GET:
129+
- type: python
130+
sdk:
131+
package: vellum-ai
132+
version: 1.2.1
133+
sync_client: |
134+
import Vellum from vellum.client
135+
136+
client = Vellum(api_key="YOUR_API_KEY")
137+
client.search(query="Find documents written in the last 5 days")
138+
async_client: |
139+
import Vellum from vellum.client
140+
141+
client = Vellum(api_key="YOUR_API_KEY")
142+
client.search(query="Find documents written in the last 5 days")
143+
- type: typescript
144+
sdk:
145+
package: vellum-ai
146+
version: 1.2.1
147+
client: |
148+
import { VellumClient } from "vellum-ai";
149+
150+
const vellum = VellumClient({
151+
apiKey="YOUR_API_KEY"
152+
})
153+
vellum.search({
154+
query: "Find documents written in the last 5 days"
155+
})
156+
v1/document-indexes:
157+
POST:
158+
- type: python
159+
sdk:
160+
package: vellum-ai
161+
version: 1.2.1
162+
sync_client: |
163+
import Vellum from vellum.client
164+
165+
client = Vellum(api_key="YOUR_API_KEY")
166+
client.document_indexes.create(name="meeting-reports", status="ACTIVE")
167+
async_client: |
168+
import VellumAsync from vellum.client
169+
170+
client = VellumAsync(api_key="YOUR_API_KEY")
171+
await client.document_indexes.create(name="meeting-reports", status="ACTIVE")
172+
- type: typescript
173+
sdk:
174+
package: vellum-ai
175+
version: 1.2.1
176+
client: |
177+
import { VellumClient } from "vellum-ai";
178+
179+
const vellum = VellumClient({
180+
apiKey="YOUR_API_KEY"
181+
})
182+
vellum.documentIndexes.create({
183+
name: "meeting-reports",
184+
status: "ACTIVE"
185+
})
186+
187+
types:
188+
SnippetLoadLevel:
189+
enum:
190+
- value: full
191+
docs: |
192+
The full snippet including client instantiation and method call.
193+
- value: endpoint
194+
docs: |
195+
Only returns the part of the snippet for the endpoint call. In
196+
other words, the client instantiation is not included.
197+
198+
EndpointIdentifier:
199+
properties:
200+
path: EndpointPath
201+
method: EndpointMethod
202+
203+
EndpointPath:
204+
type: string
205+
docs: The relative path for an endpont (e.g. `/users/{userId}`)
206+
207+
EndpointMethod:
208+
enum:
209+
- PUT
210+
- POST
211+
- GET
212+
- PATCH
213+
- DELETE
214+
215+
SDK:
216+
union:
217+
typescript: TypeScriptSDK
218+
python: PythonSDK
219+
go: GoSDK
220+
java: JavaSDK
221+
222+
TypeScriptSDK:
223+
properties:
224+
package: string
225+
version: string
226+
227+
PythonSDK:
228+
properties:
229+
package: string
230+
version: string
231+
232+
GoSDK:
233+
properties:
234+
githubRepo: string
235+
version: string
236+
237+
JavaSDK:
238+
properties:
239+
group:
240+
type: string
241+
docs: The maven repository group (e.g. `com.stripe.java`)
242+
artifact:
243+
type: string
244+
docs: The artifact (e.g. `stripe-java`)
245+
version: string
246+
247+
####### Load Snippets #######
248+
249+
SnippetsPage:
250+
properties:
251+
next:
252+
type: optional<integer>
253+
docs: If present, pass this into the `page` query parameter to load the next page.
254+
snippets:
255+
type: map<EndpointPath, SnippetsByEndpointMethod>
256+
docs: |
257+
The snippets are returned as a map of endpoint path (e.g. `/api/users`)
258+
to a map of endpoint method (e.g. `POST`) to snippets.
259+
260+
SnippetsByEndpointMethod:
261+
type: map<EndpointMethod, list<Snippet>>
262+
263+
Snippet:
264+
union:
265+
typescript: TypeScriptSnippet
266+
python: PythonSnippet
267+
java: JavaSnippet
268+
go: GoSnippet
269+
270+
TypeScriptSnippet:
271+
properties:
272+
sdk: TypeScriptSDK
273+
client: string
274+
275+
PythonSnippet:
276+
properties:
277+
sdk: PythonSDK
278+
async_client: string
279+
sync_client: string
280+
281+
GoSnippet:
282+
properties:
283+
sdk: GoSDK
284+
client: string
285+
286+
JavaSnippet:
287+
properties:
288+
sdk: JavaSDK
289+
async_client: string
290+
sync_client: string

.mock/fern.config.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"organization" : "fern",
3+
"version" : "0.0.10"
4+
}

.mock/generators.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
groups:
2+
node-sdk:
3+
audiences:
4+
- external
5+
generators:
6+
- name: fernapi/fern-typescript-node-sdk
7+
version: 0.9.2
8+
output:
9+
location: npm
10+
package-name: '@fern-api/node-sdk'
11+
token: ${NPM_TOKEN}
12+
github:
13+
repository: fern-api/node-sdk
14+
license: MIT
15+
config:
16+
namespaceExport: Fern
17+
python-sdk:
18+
audiences:
19+
- external
20+
generators:
21+
- name: fernapi/fern-python-sdk
22+
version: 0.12.1
23+
output:
24+
location: pypi
25+
package-name: fern-api
26+
# token: ${PYPI_TOKEN}
27+
github:
28+
repository: fern-api/python-sdk
29+
license: MIT
30+
config:
31+
client_class_name: Fern

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fern-api"
3-
version = "0.0.0-rc1"
3+
version = "0.0.10"
44
description = ""
55
readme = "README.md"
66
authors = []

src/fern/core/client_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "fern-api",
19-
"X-Fern-SDK-Version": "0.0.0-rc1",
19+
"X-Fern-SDK-Version": "0.0.10",
2020
}
2121
headers["Authorization"] = f"Bearer {self._get_token()}"
2222
return headers

tests/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+

0 commit comments

Comments
 (0)