Skip to content

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

Non-success responses in SDK

Marc Klingena4eb114a567f
diff --git a/fern/client/definition/api.yml b/fern/client/definition/api.yml
index 7e2d9286d0..e9fa6f3b65 100644
--- a/fern/client/definition/api.yml
+++ b/fern/client/definition/api.yml
@@ -2,3 +2,10 @@ name: langfuse
error-discrimination:
strategy: status-code
auth: bearer
+imports:
+ commons: commons.yml
+errors:
+ - commons.Error
+ - commons.UnauthorizedError
+ - commons.AccessDeniedError
+ - commons.MethodNotAllowedError
diff --git a/fern/client/definition/commons.yml b/fern/client/definition/commons.yml
new file mode 100644
index 0000000000..98fc49843f
--- /dev/null
+++ b/fern/client/definition/commons.yml
@@ -0,0 +1,13 @@
+errors:
+ Error:
+ status-code: 400
+ type: string
+ UnauthorizedError:
+ status-code: 401
+ type: string
+ AccessDeniedError:
+ status-code: 403
+ type: string
+ MethodNotAllowedError:
+ status-code: 405
+ type: string
diff --git a/fern/server/definition/api.yml b/fern/server/definition/api.yml
index 46b1a9facb..3b110783f4 100644
--- a/fern/server/definition/api.yml
+++ b/fern/server/definition/api.yml
@@ -2,3 +2,10 @@ name: langfuse
error-discrimination:
strategy: status-code
auth: basic
+imports:
+ commons: commons.yml
+errors:
+ - commons.Error
+ - commons.UnauthorizedError
+ - commons.AccessDeniedError
+ - commons.MethodNotAllowedError
diff --git a/fern/server/definition/commons.yml b/fern/server/definition/commons.yml
new file mode 100644
index 0000000000..98fc49843f
--- /dev/null
+++ b/fern/server/definition/commons.yml
@@ -0,0 +1,13 @@
+errors:
+ Error:
+ status-code: 400
+ type: string
+ UnauthorizedError:
+ status-code: 401
+ type: string
+ AccessDeniedError:
+ status-code: 403
+ type: string
+ MethodNotAllowedError:
+ status-code: 405
+ type: string
diff --git a/generated/openapi-client/openapi.yml b/generated/openapi-client/openapi.yml
index 5123477aad..591df2b93d 100644
--- a/generated/openapi-client/openapi.yml
+++ b/generated/openapi-client/openapi.yml
@@ -1,7 +1,7 @@
openapi: 3.0.1
info:
title: langfuse
- version: ''
+ version: ""
paths:
/api/public/scores:
post:
@@ -11,12 +11,36 @@ paths:
- Score
parameters: []
responses:
- '200':
- description: ''
+ "200":
+ description: ""
content:
application/json:
schema:
- $ref: '#/components/schemas/Score'
+ $ref: "#/components/schemas/Score"
+ "400":
+ description: ""
+ content:
+ application/json:
+ schema:
+ type: string
+ "401":
+ description: ""
+ content:
+ application/json:
+ schema:
+ type: string
+ "403":
+ description: ""
+ content:
+ application/json:
+ schema:
+ type: string
+ "405":
+ description: ""
+ content:
+ application/json:
+ schema:
+ type: string
security:
- BearerAuth: []
requestBody:
@@ -24,7 +48,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/CreateScoreRequest'
+ $ref: "#/components/schemas/CreateScoreRequest"
components:
schemas:
CreateScoreRequest:
@@ -34,7 +58,7 @@ components:
traceId:
type: string
traceIdType:
- $ref: '#/components/schemas/TraceIdType'
+ $ref: "#/components/schemas/TraceIdType"
name:
type: string
value:
diff --git a/generated/openapi-server/openapi.yml b/generated/openapi-server/openapi.yml
index 227be53624..39a29dbe37 100644
--- a/generated/openapi-server/openapi.yml
+++ b/generated/openapi-server/openapi.yml
@@ -17,6 +17,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Event'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: &ref_0
- BasicAuth: []
requestBody:
@@ -38,6 +62,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Log'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: *ref_0
requestBody:
required: true
@@ -57,6 +105,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Log'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: *ref_0
requestBody:
required: true
@@ -78,6 +150,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Score'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: *ref_0
requestBody:
required: true
@@ -99,6 +195,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Span'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: *ref_0
requestBody:
required: true
@@ -119,6 +239,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Span'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: *ref_0
requestBody:
required: true
@@ -140,6 +284,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Trace'
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '401':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '403':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
+ '405':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: string
security: *ref_0
requestBody:
required: true
diff --git a/src/pages/api/public/events.ts b/src/pages/api/public/events.ts
index fcabe4f262..39c7015a01 100644
--- a/src/pages/api/public/events.ts
+++ b/src/pages/api/public/events.ts
@@ -92,7 +92,7 @@ export default async function handler(
},
});
- res.status(201).json(newObservation);
+ res.status(200).json(newObservation);
} catch (error: unknown) {
console.error(error);
const errorMessage =
diff --git a/src/pages/api/public/generations.ts b/src/pages/api/public/generations.ts
index fb56797417..e4f6e656ce 100644
--- a/src/pages/api/public/generations.ts
+++ b/src/pages/api/public/generations.ts
@@ -148,7 +148,7 @@ export default async function handler(
},
});
- res.status(201).json(newObservation);
+ res.status(200).json(newObservation);
} catch (error: unknown) {
console.error(error);
const errorMessage =
@@ -201,7 +201,7 @@ export default async function handler(
},
});
- res.status(201).json(newObservation);
+ res.status(200).json(newObservation);
} catch (error: unknown) {
console.error(error);
const errorMessage =
diff --git a/src/pages/api/public/scores.ts b/src/pages/api/public/scores.ts
index f5cc3cfb74..3a99111844 100644
--- a/src/pages/api/public/scores.ts
+++ b/src/pages/api/public/scores.ts
@@ -84,7 +84,7 @@ export default async function handler(
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const newScore = await prisma.score.create({ data });
- res.status(201).json(newScore);
+ res.status(200).json(newScore);
} catch (error: unknown) {
console.error(error);
const errorMessage =
diff --git a/src/pages/api/public/spans.ts b/src/pages/api/public/spans.ts
index d1cbf3c8e9..9e87ad55ee 100644
--- a/src/pages/api/public/spans.ts
+++ b/src/pages/api/public/spans.ts
@@ -107,7 +107,7 @@ export default async function handler(
},
});
- res.status(201).json(newObservation);
+ res.status(200).json(newObservation);
} catch (error: unknown) {
const errorMessage =
error instanceof Error ? error.message : "An unknown error occurred";
@@ -144,7 +144,7 @@ export default async function handler(
},
});
- res.status(201).json(newObservation);
+ res.status(200).json(newObservation);
} catch (error: unknown) {
console.error(error);
const errorMessage =
diff --git a/src/pages/api/public/traces.ts b/src/pages/api/public/traces.ts
index 07fce154cd..13cb99fa7d 100644
--- a/src/pages/api/public/traces.ts
+++ b/src/pages/api/public/traces.ts
@@ -53,7 +53,7 @@ export default async function handler(
},
});
- res.status(201).json(newTrace);
+ res.status(200).json(newTrace);
} catch (error: unknown) {
console.error(error);
const errorMessage =