mirror of
https://github.com/FJurmanovic/sugarr.git
synced 2026-11-11 15:51:09 +00:00
upgrade langfuse
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { Langfuse } from 'langfuse';
|
||||
import { LangfuseClient } from '@langfuse/client';
|
||||
import type { PromptFetcher, RawPrompt } from './PromptGateway';
|
||||
|
||||
export class LangfusePromptGateway implements PromptFetcher {
|
||||
private readonly client: Langfuse;
|
||||
private readonly client: LangfuseClient;
|
||||
|
||||
constructor(opts: { publicKey: string; secretKey: string; baseUrl: string }) {
|
||||
this.client = new Langfuse({
|
||||
this.client = new LangfuseClient({
|
||||
publicKey: opts.publicKey,
|
||||
secretKey: opts.secretKey,
|
||||
baseUrl: opts.baseUrl,
|
||||
@@ -13,7 +13,7 @@ export class LangfusePromptGateway implements PromptFetcher {
|
||||
}
|
||||
|
||||
async fetch(promptName: string): Promise<RawPrompt> {
|
||||
const prompt = await this.client.getPrompt(promptName, undefined, { type: 'chat', cacheTtlSeconds: 0 });
|
||||
const prompt = await this.client.prompt.get(promptName, { type: 'chat' });
|
||||
return {
|
||||
name: prompt.name,
|
||||
version: prompt.version,
|
||||
|
||||
Reference in New Issue
Block a user