carlrobertoh / CodeGPT

JetBrains extension providing access to state-of-the-art LLMs, such as GPT-4, Claude 3, Code Llama, and others, all for free
https://codegpt.ee
Apache License 2.0
885 stars 184 forks source link

feat: allow drag and drop of image file in prompt textArea #566

Open PhilKes opened 1 month ago

PhilKes commented 1 month ago

This PR closes #554

Adds support for drag&drop of a single image file into the prompt codegpt-drop-image2

PhilKes commented 1 month ago

@carlrobertoh no idea why the ChatToolWindowTabPanelTest.testSendingOpenAIMessageWithImage fails, it succeeds locally. No X11 DISPLAY variable was set, but this program performed an operation which requires it. https://github.com/carlrobertoh/CodeGPT/actions/runs/9112340838/job/25051402045?pr=566#step:4:724

carlrobertoh commented 1 month ago

Noice! 👍

It happens because the tests on the Github runner are executed in headless mode. You can replicate this by running export JAVA_TOOL_OPTIONS='-Djava.awt.headless=true' before executing the tests. Not sure what the fix is yet.

PhilKes commented 1 month ago

Noice! 👍

It happens because the tests on the Github runner are executed in headless mode. You can replicate this by running export JAVA_TOOL_OPTIONS='-Djava.awt.headless=true' before executing the tests. Not sure what the fix is yet.

Ah I see, in the DropTarget constructor:

public DropTarget(Component c, int ops, DropTargetListener dtl,   boolean act, FlavorMap fm)  throws HeadlessException   {
        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }
      ...
}