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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/langfuse.ts +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-langfuse",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "Langfuse extension for Pi coding agent",
5
5
  "repository": {
6
6
  "type": "git",
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 getTrace = rt.scoreClient.api?.trace?.get;
211
- if (!getTrace) {
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", getTrace(traceId));
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 ingestionBatch = rt.scoreClient.api?.ingestion?.batch;
305
- if (!ingestionBatch) {
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
- ingestionBatch({
312
+ ingestionApi.batch({
313
313
  batch,
314
314
  metadata: {
315
315
  source: "pi-langfuse",