New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

langfuse

Package Overview
Dependencies
Maintainers
1
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

langfuse - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

28

dist/index.d.ts

@@ -44,3 +44,31 @@ import { paths } from './api/server';

} | undefined>;
createScore: (body: paths['/api/public/scores']['post']['requestBody']['content']['application/json'], trace?: ReturnType<typeof this.createTrace>) => Promise<{
id: string;
traceId: string;
name: string;
value: number;
observationId?: string | null | undefined;
timestamp: string;
} | undefined>;
flush: () => Promise<void>;
}
export declare class LangfuseWeb {
private publicKey;
private get;
private post;
baseUrl: string;
private promises;
constructor(params: {
publicKey: string;
baseUrl?: string;
});
createScore: (body: paths['/api/public/scores']['post']['requestBody']['content']['application/json']) => Promise<{
id: string;
traceId: string;
name: string;
value: number;
observationId?: string | null | undefined;
timestamp: string;
} | undefined>;
flush: () => Promise<void>;
}

@@ -40,2 +40,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

});
this.createScore = (body, trace) => __awaiter(this, void 0, void 0, function* () {
var _c;
const traceId = trace ? (_c = (yield trace)) === null || _c === void 0 ? void 0 : _c.id : undefined;
const res = this.post('/api/public/scores', {
body: Object.assign(Object.assign({}, body), { traceId: traceId !== null && traceId !== void 0 ? traceId : body.traceId }),
}).then((res) => {
if (res.error) {
throw new Error(res.error);
}
return res.data;
});
this.promises.push(res);
return res;
});
this.flush = () => __awaiter(this, void 0, void 0, function* () {

@@ -59,1 +73,32 @@ yield Promise.all(this.promises);

}
export class LangfuseWeb {
constructor(params) {
var _a;
this.baseUrl = 'https://cloud.langfuse.com';
this.createScore = (body) => __awaiter(this, void 0, void 0, function* () {
const res = this.post('/api/public/scores', { body }).then((res) => {
if (res.error) {
throw new Error(res.error);
}
return res.data;
});
this.promises.push(res);
return res;
});
this.flush = () => __awaiter(this, void 0, void 0, function* () {
yield Promise.all(this.promises);
this.promises = [];
});
this.publicKey = params.publicKey;
this.baseUrl = (_a = params.baseUrl) !== null && _a !== void 0 ? _a : this.baseUrl;
this.promises = [];
const { get, post } = createClient({
baseUrl: this.baseUrl,
headers: {
Authorization: 'Bearer ' + this.publicKey,
},
});
this.get = get;
this.post = post;
}
}

2

package.json
{
"name": "langfuse",
"version": "0.0.5",
"version": "0.0.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc