Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

docs(api): improve api reference descriptions (#1244)

Marc Klingen977ac39ec56d
diff --git a/fern/apis/server/definition/commons.yml b/fern/apis/server/definition/commons.yml
index 66fba0a0c1..41a61cbb66 100644
--- a/fern/apis/server/definition/commons.yml
+++ b/fern/apis/server/definition/commons.yml
@@ -90,14 +90,28 @@ types:
latency: optional<double>
Usage:
+ docs: Standard interface for usage and cost
properties:
- input: optional<integer>
- output: optional<integer>
- total: optional<integer>
+ input:
+ docs: Number of input units (e.g. tokens)
+ type: optional<integer>
+ output:
+ docs: Number of output units (e.g. tokens)
+ type: optional<integer>
+ total:
+ docs: Defaults to input+output if not set
+ type: optional<integer>
unit: optional<ModelUsageUnit>
- inputCost: optional<double>
- outputCost: optional<double>
- totalCost: optional<double>
+ inputCost:
+ docs: USD input cost
+ type: optional<double>
+ outputCost:
+ docs: USD output cost
+ type: optional<double>
+ totalCost:
+ docs: USD total cost, defaults to input+output
+ type: optional<double>
+
Score:
properties:
id: string
@@ -145,6 +159,7 @@ types:
# Utilities
ModelUsageUnit:
+ docs: Unit of usage in Langfuse
enum:
- CHARACTERS
- TOKENS
diff --git a/fern/apis/server/definition/dataset-items.yml b/fern/apis/server/definition/dataset-items.yml
index d28e49fb41..8ec7e7657a 100644
--- a/fern/apis/server/definition/dataset-items.yml
+++ b/fern/apis/server/definition/dataset-items.yml
@@ -7,12 +7,12 @@ service:
endpoints:
create:
method: POST
- docs: Create a dataset item, upserts on id
+ docs: Create a dataset item
path: /dataset-items
request: CreateDatasetItemRequest
response: commons.DatasetItem
get:
- docs: Get a specific dataset item
+ docs: Get a dataset item
method: GET
path: /dataset-items/{id}
path-parameters:
@@ -26,4 +26,6 @@ types:
datasetName: string
input: unknown
expectedOutput: optional<unknown>
- id: optional<string>
+ id:
+ type: optional<string>
+ docs: Dataset items are upserted on their id
diff --git a/fern/apis/server/definition/ingestion.yml b/fern/apis/server/definition/ingestion.yml
index 222a15bed0..313486b657 100644
--- a/fern/apis/server/definition/ingestion.yml
+++ b/fern/apis/server/definition/ingestion.yml
@@ -7,7 +7,7 @@ service:
base-path: /api/public
endpoints:
batch:
- docs: Ingest multiple events to Langfuse
+ docs: Batched ingestion for Langfuse Tracing
method: POST
path: /ingestion
request:
@@ -31,8 +31,12 @@ types:
sdk-log: SDKLogEvent
# both are legacy
- observation-create: CreateObservationEvent
- observation-update: UpdateObservationEvent
+ observation-create:
+ type: CreateObservationEvent
+ docs: Deprecated event type
+ observation-update:
+ type: UpdateObservationEvent
+ docs: Deprecated event type
ObservationType:
enum:
@@ -47,6 +51,7 @@ types:
- OpenAIUsage
OpenAIUsage:
+ docs: Usage interface of OpenAI for improved compatibility.
properties:
promptTokens: optional<integer>
completionTokens: optional<integer>
diff --git a/fern/apis/server/definition/observations.yml b/fern/apis/server/definition/observations.yml
index ccdfacf2f9..468d4d8d3a 100644
--- a/fern/apis/server/definition/observations.yml
+++ b/fern/apis/server/definition/observations.yml
@@ -7,7 +7,7 @@ service:
base-path: /api/public
endpoints:
get:
- docs: Get a specific observation
+ docs: Get a observation
method: GET
path: /observations/{observationId}
path-parameters:
diff --git a/fern/apis/server/definition/projects.yml b/fern/apis/server/definition/projects.yml
index 08ba2227b7..a5a3273455 100644
--- a/fern/apis/server/definition/projects.yml
+++ b/fern/apis/server/definition/projects.yml
@@ -7,6 +7,7 @@ service:
base-path: /api/public
endpoints:
get:
+ docs: Get Project associated with API key
method: GET
path: /projects
response: Projects
diff --git a/fern/apis/server/definition/prompts.yml b/fern/apis/server/definition/prompts.yml
index 2ebfeb4470..ea03a8688f 100644
--- a/fern/apis/server/definition/prompts.yml
+++ b/fern/apis/server/definition/prompts.yml
@@ -7,7 +7,7 @@ service:
base-path: /api/public
endpoints:
get:
- docs: Get a specific prompt
+ docs: Get a prompt
method: GET
path: /prompts
request:
@@ -17,7 +17,7 @@ service:
version: optional<integer>
response: Prompt
create:
- docs: Create a specific prompt
+ docs: Create a prompt
method: POST
path: /prompts
request: CreatePromptRequest
@@ -27,7 +27,9 @@ types:
CreatePromptRequest:
properties:
name: string
- isActive: boolean
+ isActive:
+ docs: Should the prompt be promoted to production immediately?
+ type: boolean
prompt: string
config: optional<unknown>
diff --git a/fern/apis/server/definition/score.yml b/fern/apis/server/definition/score.yml
index 65792ac47b..35c51c42bb 100644
--- a/fern/apis/server/definition/score.yml
+++ b/fern/apis/server/definition/score.yml
@@ -7,7 +7,7 @@ service:
base-path: /api/public
endpoints:
create:
- docs: Add a score to the database, upserts on id
+ docs: Create a score
method: POST
path: /scores
request: CreateScoreRequest
diff --git a/generated/postman/collection.json b/generated/postman/collection.json
index 34c1874285..85b56779f7 100644
--- a/generated/postman/collection.json
+++ b/generated/postman/collection.json
@@ -46,7 +46,7 @@
"_type": "endpoint",
"name": "Create",
"request": {
- "description": "Create a dataset item, upserts on id",
+ "description": "Create a dataset item",
"url": {
"raw": "{{baseUrl}}/api/public/dataset-items",
"host": [
@@ -79,7 +79,7 @@
"_type": "endpoint",
"name": "Get",
"request": {
- "description": "Get a specific dataset item",
+ "description": "Get a dataset item",
"url": {
"raw": "{{baseUrl}}/api/public/dataset-items/:id",
"host": [
@@ -301,7 +301,7 @@
"_type": "endpoint",
"name": "Batch",
"request": {
- "description": "Ingest multiple events to Langfuse",
+ "description": "Batched ingestion for Langfuse Tracing",
"url": {
"raw": "{{baseUrl}}/api/public/ingestion",
"host": [
@@ -400,7 +400,7 @@
"_type": "endpoint",
"name": "Get",
"request": {
- "description": "Get a specific observation",
+ "description": "Get a observation",
"url": {
"raw": "{{baseUrl}}/api/public/observations/:observationId",
"host": [
@@ -500,7 +500,7 @@
"_type": "endpoint",
"name": "Get",
"request": {
- "description": null,
+ "description": "Get Project associated with API key",
"url": {
"raw": "{{baseUrl}}/api/public/projects",
"host": [
@@ -532,7 +532,7 @@
"_type": "endpoint",
"name": "Get",
"request": {
- "description": "Get a specific prompt",
+ "description": "Get a prompt",
"url": {
"raw": "{{baseUrl}}/api/public/prompts?name=&version=",
"host": [
@@ -568,7 +568,7 @@
"_type": "endpoint",
"name": "Create",
"request": {
- "description": "Create a specific prompt",
+ "description": "Create a prompt",
"url": {
"raw": "{{baseUrl}}/api/public/prompts",
"host": [
@@ -608,7 +608,7 @@
"_type": "endpoint",
"name": "Create",
"request": {
- "description": "Add a score to the database, upserts on id",
+ "description": "Create a score",
"url": {
"raw": "{{baseUrl}}/api/public/scores",
"host": [
diff --git a/web/generated/openapi-server/openapi.yml b/web/generated/openapi-server/openapi.yml
index 3dee0447bc..91a78a315c 100644
--- a/web/generated/openapi-server/openapi.yml
+++ b/web/generated/openapi-server/openapi.yml
@@ -16,7 +16,7 @@ info:
paths:
/api/public/dataset-items:
post:
- description: Create a dataset item, upserts on id
+ description: Create a dataset item
operationId: datasetItems_create
tags:
- DatasetItems
@@ -63,7 +63,7 @@ paths:
$ref: '#/components/schemas/CreateDatasetItemRequest'
/api/public/dataset-items/{id}:
get:
- description: Get a specific dataset item
+ description: Get a dataset item
operationId: datasetItems_get
tags:
- DatasetItems
@@ -336,7 +336,7 @@ paths:
description: ''
/api/public/ingestion:
post:
- description: Ingest multiple events to Langfuse
+ description: Batched ingestion for Langfuse Tracing
operationId: ingestion_batch
tags:
- Ingestion
@@ -464,7 +464,7 @@ paths:
security: *ref_0
/api/public/observations/{observationId}:
get:
- description: Get a specific observation
+ description: Get a observation
operationId: observations_get
tags:
- Observations
@@ -594,6 +594,7 @@ paths:
security: *ref_0
/api/public/projects:
get:
+ description: Get Project associated with API key
operationId: projects_get
tags:
- Projects
@@ -633,7 +634,7 @@ paths:
security: *ref_0
/api/public/prompts:
get:
- description: Get a specific prompt
+ description: Get a prompt
operationId: prompts_get
tags:
- Prompts
@@ -683,7 +684,7 @@ paths:
schema: {}
security: *ref_0
post:
- description: Create a specific prompt
+ description: Create a prompt
operationId: prompts_create
tags:
- Prompts
@@ -729,7 +730,7 @@ paths:
$ref: '#/components/schemas/CreatePromptRequest'
/api/public/scores:
post:
- description: Add a score to the database, upserts on id
+ description: Create a score
operationId: score_create
tags:
- Score
@@ -1328,16 +1329,20 @@ components:
Usage:
title: Usage
type: object
+ description: Standard interface for usage and cost
properties:
input:
type: integer
nullable: true
+ description: Number of input units (e.g. tokens)
output:
type: integer
nullable: true
+ description: Number of output units (e.g. tokens)
total:
type: integer
nullable: true
+ description: Defaults to input+output if not set
unit:
$ref: '#/components/schemas/ModelUsageUnit'
nullable: true
@@ -1345,14 +1350,17 @@ components:
type: number
format: double
nullable: true
+ description: USD input cost
outputCost:
type: number
format: double
nullable: true
+ description: USD output cost
totalCost:
type: number
format: double
nullable: true
+ description: USD total cost, defaults to input+output
Score:
title: Score
type: object
@@ -1503,6 +1511,7 @@ components:
- MILLISECONDS
- SECONDS
- IMAGES
+ description: Unit of usage in Langfuse
ObservationLevel:
title: ObservationLevel
type: string
@@ -1542,6 +1551,7 @@ components:
id:
type: string
nullable: true
+ description: Dataset items are upserted on their id
required:
- datasetName
- input
@@ -1709,6 +1719,7 @@ components:
OpenAIUsage:
title: OpenAIUsage
type: object
+ description: Usage interface of OpenAI for improved compatibility.
properties:
promptTokens:
type: integer
@@ -2238,6 +2249,7 @@ components:
type: string
isActive:
type: boolean
+ description: Should the prompt be promoted to production immediately?
prompt:
type: string
config: