Skip to content

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

fixes

Max Deichmannef2dfe580952
diff --git a/src/pages/api/cors.ts b/src/pages/api/cors.ts
index 92966956f5..f33f42747f 100644
--- a/src/pages/api/cors.ts
+++ b/src/pages/api/cors.ts
@@ -19,7 +19,7 @@ export function runMiddleware(
}
export const cors = Cors({
- origin: ["http://localhost:3000"],
+ origin: true,
//update: or "origin: true," if you don't wanna add a specific one
- credentials: true,
+ credentials: false,
});
diff --git a/src/pages/api/llm-span.ts b/src/pages/api/llm-span.ts
index a0f157cd38..0dce4054ad 100644
--- a/src/pages/api/llm-span.ts
+++ b/src/pages/api/llm-span.ts
@@ -1,5 +1,5 @@
import { prisma } from "@/src/server/db";
-import { ObservationType, type Prisma } from "@prisma/client";
+import { ObservationType } from "@prisma/client";
import { type NextApiRequest, type NextApiResponse } from "next";
import { z } from "zod";
import { cors, runMiddleware } from "./cors";
diff --git a/src/pages/llm-calls/[llmCallId].tsx b/src/pages/llm-calls/[llmCallId].tsx
index e173a94ac4..0767df5b18 100644
--- a/src/pages/llm-calls/[llmCallId].tsx
+++ b/src/pages/llm-calls/[llmCallId].tsx
@@ -64,9 +64,9 @@ export default function LlmCallPage() {
{
label: "Tokens",
value: [
- llmCall.data.attributes.tokens.prompt &&
+ llmCall.data.attributes.tokens?.prompt &&
`${llmCall.data.attributes.tokens.prompt} prompt tokens`,
- llmCall.data.attributes.tokens.completion &&
+ llmCall.data.attributes.tokens?.completion &&
`${llmCall.data.attributes.tokens.completion} completion tokens`,
]
.filter(Boolean)
diff --git a/src/utils/types.ts b/src/utils/types.ts
index 73af94dc09..834bedfc45 100644
--- a/src/utils/types.ts
+++ b/src/utils/types.ts
@@ -22,7 +22,7 @@ export type LlmCall = Observation & {
attributes: {
prompt?: string;
completion?: string;
- tokens: {
+ tokens?: {
prompt?: number;
completion?: number;
};