Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update prompts and invalidate cache #493

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions integration-test/langfuse-integration-node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,26 @@ describe("Langfuse Node.js", () => {
version: expect.any(Number),
});
});

it.only("update a prompt", async () => {
hassiebp marked this conversation as resolved.
Show resolved Hide resolved
const promptName = "test-prompt" + Math.random().toString(36);
await langfuse.createPrompt({
name: promptName,
prompt: "This is a prompt with a {{variable}}",
isActive: true,
labels: ["john"],
});

const updatedPrompt = await langfuse.updatePrompt({
name: promptName,
version: 1,
newLabels: ["john", "doe"],
});
Comment on lines +445 to +449
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Test should verify that old labels are preserved when updating with newLabels. Consider testing removal of labels and complete label replacement


const prompt = await langfuse.getPrompt(promptName);
expect(prompt.labels).toEqual(expect.arrayContaining(["john", "doe"]));
expect(updatedPrompt.labels).toEqual(expect.arrayContaining(["john", "doe"]));
});
});

it("link prompt to generation", async () => {
Expand Down
Loading
Loading