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: add warning when getting deleted prompt lineage #90

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Matthieu-OD
Copy link
Contributor

@Matthieu-OD Matthieu-OD commented Dec 16, 2024

To test

  • get or create or get prompt version or prompt lineage where the prompt lineage has been deleted which means that the value of the field deletedAt is not null

after adding the dev version of literal-typescript you can use this code to test it

import { LiteralClient } from "@literalai/client";

async function testPromptCache() {
  const client = new LiteralClient({
    apiKey: "my-initial-api-key",
    apiUrl: "http://localhost:3000",
  });

  const promptLineageName = "Default";
  const promptVersionId = "144a1f2f-ae41-509b-b21f-5dab8d7bf3b6";

  console.log(1);
  const promptVersionById = await client.api.getPromptById(promptVersionId);
  console.log(2);
  const promptVersionGetOrCreate = await client.api.getOrCreatePrompt(
    promptLineageName,
    [],
  );
  console.log(3);
  const promptVersion = await client.api.getPrompt(promptLineageName);
  console.log(4);
  const promptLineage =
    await client.api.getPromptLineageByName(promptLineageName);
}

// Run the test
console.log("Starting prompt cache test...\n");
testPromptCache()
  .then(() => {
    console.log("\nTest completed");
  })
  .catch((error) => {
    console.error("Test failed:", error);
  });

@Matthieu-OD Matthieu-OD self-assigned this Dec 16, 2024
@Matthieu-OD Matthieu-OD marked this pull request as ready for review December 20, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant