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

Can't show image in vscode chat markdown panel #1063

Open
nikawang opened this issue Jul 14, 2024 · 1 comment
Open

Can't show image in vscode chat markdown panel #1063

nikawang opened this issue Jul 14, 2024 · 1 comment
Assignees

Comments

@nikawang
Copy link

nikawang commented Jul 14, 2024

Extension sample

chat-sample

VS Code version

1.91 - VS Code Remote

What went wrong?

I've tried many ways to load the image file with no luck:

 const markdownStr = new vscode.MarkdownString();
        markdownStr.supportHtml = true;
        markdownStr.value='![image](https://westusdallestore.blob.core.windows.net/public/b52b7f8ff97ba775ff1f92587485c8d62d2cc0bb.png)';
		stream.markdown(markdownStr);

        const markdownStr1 = new vscode.MarkdownString();
        markdownStr1.supportHtml = true;
        const imagePath = vscode.Uri.from({ scheme: 'https://', path: "westusdallestore.blob.core.windows.net/public/b52b7f8ff97ba775ff1f92587485c8d62d2cc0bb.png" });
        markdownStr1.value=`![image](${imagePath})`;
        stream.markdown(markdownStr1)
        stream.markdown(`![image](https://westusdallestore.blob.core.windows.net/public/b52b7f8ff97ba775ff1f92587485c8d62d2cc0bb.png)`)
        stream.markdown(`![image](file:///tmp/chat-agent-dalle/9fa80e2015fac7bdb84d1e4248e15b9469c348be.png-small.png)`)

image image
@roblourens
Copy link
Member

Images from remote domains are only rendered if the user has added that domain to their trusted domain list- run the command "Manage Trusted Domains" to configure this. In the future I'd like to render something more helpful, like a button to load the image.

The local image should work though. My "dall-e" chat participant actually does this. Rendering as vscode-file is expected. Maybe you can get a clue from the network tab? Maybe it works as an absolute path instead of a file URI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants