Skip to content

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

chore(api): casing of fromTimestamp param (#1547)

Marc Klingen036736d80587
diff --git a/fern/apis/server/definition/score.yml b/fern/apis/server/definition/score.yml
index 995c7c09c6..9522b05d7e 100644
--- a/fern/apis/server/definition/score.yml
+++ b/fern/apis/server/definition/score.yml
@@ -23,7 +23,7 @@ service:
limit: optional<integer>
userId: optional<string>
name: optional<string>
- from_timestamp:
+ fromTimestamp:
type: optional<datetime>
docs: Retrieve only scores newer than this timestamp.
response: Scores
diff --git a/fern/apis/server/definition/trace.yml b/fern/apis/server/definition/trace.yml
index 16c29cf041..70cce6778a 100644
--- a/fern/apis/server/definition/trace.yml
+++ b/fern/apis/server/definition/trace.yml
@@ -26,7 +26,7 @@ service:
limit: optional<integer>
userId: optional<string>
name: optional<string>
- from_timestamp:
+ fromTimestamp:
type: optional<datetime>
docs: Retrieve only traces newer than this timestamp.
orderBy:
diff --git a/generated/postman/collection.json b/generated/postman/collection.json
index 7cd8150c98..27faf3351f 100644
--- a/generated/postman/collection.json
+++ b/generated/postman/collection.json
@@ -648,7 +648,7 @@
"request": {
"description": "Get a list of scores",
"url": {
- "raw": "{{baseUrl}}/api/public/scores?page=&limit=&userId=&name=&from_timestamp=",
+ "raw": "{{baseUrl}}/api/public/scores?page=&limit=&userId=&name=&fromTimestamp=",
"host": [
"{{baseUrl}}"
],
@@ -679,7 +679,7 @@
"description": null
},
{
- "key": "from_timestamp",
+ "key": "fromTimestamp",
"value": "",
"description": "Retrieve only scores newer than this timestamp."
}
@@ -841,7 +841,7 @@
"request": {
"description": "Get list of traces",
"url": {
- "raw": "{{baseUrl}}/api/public/traces?page=&limit=&userId=&name=&from_timestamp=&orderBy=&tags=",
+ "raw": "{{baseUrl}}/api/public/traces?page=&limit=&userId=&name=&fromTimestamp=&orderBy=&tags=",
"host": [
"{{baseUrl}}"
],
@@ -872,7 +872,7 @@
"description": null
},
{
- "key": "from_timestamp",
+ "key": "fromTimestamp",
"value": "",
"description": "Retrieve only traces newer than this timestamp."
},
diff --git a/web/generated/openapi-server/openapi.yml b/web/generated/openapi-server/openapi.yml
index 14e3c38964..610791d187 100644
--- a/web/generated/openapi-server/openapi.yml
+++ b/web/generated/openapi-server/openapi.yml
@@ -814,7 +814,7 @@ paths:
schema:
type: string
nullable: true
- - name: from_timestamp
+ - name: fromTimestamp
in: query
description: Retrieve only scores newer than this timestamp.
required: false
@@ -1065,7 +1065,7 @@ paths:
schema:
type: string
nullable: true
- - name: from_timestamp
+ - name: fromTimestamp
in: query
description: Retrieve only traces newer than this timestamp.
required: false
diff --git a/web/src/pages/api/public/scores.ts b/web/src/pages/api/public/scores.ts
index 3bba3872d7..40a6a2cee5 100644
--- a/web/src/pages/api/public/scores.ts
+++ b/web/src/pages/api/public/scores.ts
@@ -22,7 +22,7 @@ const ScoresGetSchema = z.object({
...paginationZod,
userId: z.string().nullish(),
name: z.string().nullish(),
- from_timestamp: stringDate,
+ fromTimestamp: stringDate,
});
export default async function handler(
@@ -103,8 +103,8 @@ export default async function handler(
const nameCondition = obj.name
? Prisma.sql`AND s."name" = ${obj.name}`
: Prisma.empty;
- const fromTimestampCondition = obj.from_timestamp
- ? Prisma.sql`AND t."timestamp" >= ${obj.from_timestamp}::timestamp with time zone at time zone 'UTC'`
+ const fromTimestampCondition = obj.fromTimestamp
+ ? Prisma.sql`AND t."timestamp" >= ${obj.fromTimestamp}::timestamp with time zone at time zone 'UTC'`
: Prisma.empty;
const scores = await prisma.$queryRaw<
@@ -131,8 +131,8 @@ export default async function handler(
const totalItems = await prisma.score.count({
where: {
name: obj.name ? obj.name : undefined,
- timestamp: obj.from_timestamp
- ? { gte: new Date(obj.from_timestamp) }
+ timestamp: obj.fromTimestamp
+ ? { gte: new Date(obj.fromTimestamp) }
: undefined,
trace: {
projectId: authCheck.scope.projectId,
diff --git a/web/src/pages/api/public/traces.ts b/web/src/pages/api/public/traces.ts
index 2617c794ef..054db35d90 100644
--- a/web/src/pages/api/public/traces.ts
+++ b/web/src/pages/api/public/traces.ts
@@ -26,7 +26,7 @@ const GetTracesSchema = z.object({
userId: z.string().nullish(),
name: z.string().nullish(),
tags: z.union([z.array(z.string()), z.string()]).nullish(),
- from_timestamp: stringDate,
+ fromTimestamp: stringDate,
orderBy: z
.string() // orderBy=timestamp.asc
.nullish()
@@ -106,8 +106,8 @@ export default async function handler(
", ",
)}] <@ t."tags"`
: Prisma.empty;
- const fromTimestampCondition = obj.from_timestamp
- ? Prisma.sql`AND t."timestamp" >= ${obj.from_timestamp}::timestamp with time zone at time zone 'UTC'`
+ const fromTimestampCondition = obj.fromTimestamp
+ ? Prisma.sql`AND t."timestamp" >= ${obj.fromTimestamp}::timestamp with time zone at time zone 'UTC'`
: Prisma.empty;
const orderByCondition = orderByToPrismaSql(
@@ -155,8 +155,8 @@ export default async function handler(
projectId: authCheck.scope.projectId,
name: obj.name ? obj.name : undefined,
userId: obj.userId ? obj.userId : undefined,
- timestamp: obj.from_timestamp
- ? { gte: new Date(obj.from_timestamp) }
+ timestamp: obj.fromTimestamp
+ ? { gte: new Date(obj.fromTimestamp) }
: undefined,
tags: obj.tags
? {