pi-langfuse 1.4.7 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/langfuse.ts +6 -6
package/package.json
CHANGED
package/src/langfuse.ts
CHANGED
|
@@ -207,11 +207,11 @@ function wrapObservation(
|
|
|
207
207
|
|
|
208
208
|
async function traceExists(rt: LangfuseRuntime, traceId: string): Promise<boolean> {
|
|
209
209
|
try {
|
|
210
|
-
const
|
|
211
|
-
if (!
|
|
210
|
+
const traceApi = rt.scoreClient.api?.trace;
|
|
211
|
+
if (!traceApi?.get) {
|
|
212
212
|
return false;
|
|
213
213
|
}
|
|
214
|
-
const trace = await withTimeout("Trace visibility check",
|
|
214
|
+
const trace = await withTimeout("Trace visibility check", traceApi.get(traceId));
|
|
215
215
|
if (!trace) {
|
|
216
216
|
return false;
|
|
217
217
|
}
|
|
@@ -301,15 +301,15 @@ async function fallbackToRestIngestion(rt: LangfuseRuntime) {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
const
|
|
305
|
-
if (!
|
|
304
|
+
const ingestionApi = rt.scoreClient.api?.ingestion;
|
|
305
|
+
if (!ingestionApi?.batch) {
|
|
306
306
|
console.log("📊 Langfuse: REST fallback ingestion is unavailable");
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
const response = await withTimeout(
|
|
311
311
|
"REST fallback ingestion",
|
|
312
|
-
|
|
312
|
+
ingestionApi.batch({
|
|
313
313
|
batch,
|
|
314
314
|
metadata: {
|
|
315
315
|
source: "pi-langfuse",
|