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

Fix empty prompt logs #3862

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Fix empty prompt logs #3862

merged 1 commit into from
Jan 28, 2025

Conversation

RomneyDa
Copy link
Collaborator

Description

Didn't have any contentToShow in case where message content was already a string.

Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 015ed6d
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/6797ea26aea5e90008dfa635

@tomasz-stefaniak
Copy link
Collaborator

Test? 🙏

@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented Jan 27, 2025

Actually +1 to Tomasz here, think it would be nice to get our first e2e test for prompt logs

@RomneyDa
Copy link
Collaborator Author

time boxed my test writing and didn't quite get selecting terminal output to work. Posting here for future reference

  it.only("Shows in prompt logs", async () => {
      const [messageInput] = await GUISelectors.getMessageInputFields(view);
      const messagePair = TestUtils.generateTestMessagePair();
      await messageInput.sendKeys(messagePair.userMessage);
      await messageInput.sendKeys(Key.ENTER);
      await TestUtils.waitForSuccess(() =>
        GUISelectors.getThreadMessageByText(view, messagePair.llmResponse),
      );
      view.switchBack();
      const output = await GUISelectors.getContinueOutputLog(driver);
      expect(await output.getText()).has.string(messagePair.userMessage);
    });
  public static async getContinueOutputLog(driver: WebDriver) {
    await new Workbench().executeCommand("Focus on Output View");
    // const option = await driver.findElement(By.xpath("//option[contains(text(), 'Continue - LLM Prompt/Completion')]"));
    const select = await driver.findElements(By.xpath("//select"));
    select[1].click();
    const option = await driver.findElement(
      By.xpath(
        "//option[contains(text(), 'Continue - LLM Prompt/Completion')]",
      ),
    );
    option.click();
    await new Promise((resolve) => setTimeout(resolve, 10000));
    const output = await driver.findElement(
      By.xpath(
        "//*[@data-uri^='output:extension-output-Continue.continue-%231-Continue%20-%20LLM%20Prompt/Completion']",
      ),
    );
    return output;
  }

@RomneyDa RomneyDa merged commit e67be03 into main Jan 28, 2025
31 checks passed
@RomneyDa RomneyDa deleted the dallin/empty-prompt-logs branch January 28, 2025 18:21
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.

3 participants