-
Notifications
You must be signed in to change notification settings - Fork 163
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
Media (and other) links. #481
Comments
Question 1: Because users can have lots of links in regular Org buffers, which are almost always intended for purposes other than sending data to the LLM. Question 3: To signal intent more clearly, and to make the links whose data will be included stand out and easier to spot. Making it a "standalone" link is used as a proxy for the I can make both of these customizable, but I think it's easy to forget that you've included something in a link that you didn't mean to send, especially in a non-chat buffer that's being used for something else primarily. If you have more thoughts on this I'd be curious to hear them. Question 2: I like the idea of using links to set up per-buffer context lists, as a solution to #475. It's also more transparent than an internally maintained context list that is only accessible via running a command/opening up the context buffer. The reason this is limited to media file types right now is just mental compartmentalization -- I added media support and @daedsidog added context support at two different times, and it didn't occur to me to combine the two. I'll work on adding this feature. It's still ill-defined because there are many ways to link to buffers in Org, including user-defined link types. It's also difficult to link to regions of buffers robustly. On the other hand Markdown does not have any built-in way to link to buffers, only files. So we'll have to think about how to do this carefully. If you can provide a spec to help nail down the feature it'll be easier to implement. One thing I can do but wish to avoid is to define a new gptel-specific Org link-type. See also #325. |
One thing to be wary of is cases when you do not wish links to be treated as actual file links. For example, I often use an Org document as a reference for prose and content material, and would not want to have links translated into media. I don't se a way around that other than having a gptel-specific link type. ...On second thought, if the link translation is handled only in the chat buffer, it's fine. |
Yes, this is why link translation is currently limited to chat buffers. |
Understood, but as an org user this seems unnecessarily limiting. How about any links that appear in a region of text that is inside a drawer called :CONTEXT: for example, be sent to the LLM and no other links. That way one can manually construct context explicitly.
What if links that are within a CONTEXT drawer, which have a label name, which is suffixed with two line numbers, separated by colon, which is used to define a region within a referenced context file. More or less as you must be doing already within context buffers. So something like this:
I can think of some corner cases here. For example, if the referenced region changes because the referenced file is modified, the limits in the link would need to be updated. As I imagine, you do now with context buffers.
Fair enough. However, if links appear inside a context draw for org mode users, then this should not be a requirement.
I prefer DWIM as far as possible and avoiding customizations where possible. I don't know about others and their use of gptel, but I tend to assume org mode or markdown syntax for all the text that I'm using, even in files that are not explicitly of that syntax. Org mode in particular offers powerful syntactic sugar to enable gptel to be integrated in ways I've suggested here.
I'm 100% with you on this one.
Excellent. I think this will be a major workflow gain, at least for me :)
Agreed. One needs to consider this carefully in the context of files that are not org mode.
I think the solution I suggested above will work in markdown as well as in org mode. That is, you co-opt the label part of the link to have syntax that you interpret for gptel purposes if it appears in a :CONTEXT: drawer. The equivalent of the idea of a context draw in Markdown might be to use front matter?
Agree 100%. You do not want to change anything org mode does with links. Including customised link types and all the rest. However, the link label is not touched by org mode and is therefore "open slather" for you with gptel, So long as it appears within a context drawer! |
More ideas from as an org mode user: further to the :CONTEXT: drawer suggestion to isolate LLM links, perhaps when working in org mode with |
The more I think about it, I think the link metaphor to embed context in gptel will be a great addition. It's simple, explicit and easily managed. Especially in org mode because of the rich features set apropos links and what one can do with them. For example MCP servers #484 presenting a RESTful API on a URL fits right in. If if not on a URL end-point, perhaps one can shell out using shell: or ssh: (tramp) links in some creative way too. Food for thought. |
Karthik, question/suggestion about links.
They are VERY convenient. Often more convenient than using context.
I understand that in chat buffers, one can include links to media files:
https://github.com/karthink/gptel?tab=readme-ov-file#including-media-images-documents-with-requests
Why is this limited to chat buffers only?
I understand I can use the context to include media files in other buffer types but why not also allow links in buffer of other types, for example org or markdown?
Why is this limited to media files types?
If a link is to a file that has a mime type that is not media known to the model, but it is text, why not include the contents of the file in the prompt at that point? That is, if it's a link to a txt, org, md or other text file type, just include it in the prompt.
Why do links need to be standalone?
In org mode buffers and chat buffers, why not support links however they appear, not just when they are standalone. Likewise, if a link is internal, to another heading in the same or a different file, why not allow the body text in that heading be included in the prompt. It would for example, make it very easy to include "boilerplate" or other context by simply including links in the prompt text.
[2024-11-23 Sat 23:04]
The text was updated successfully, but these errors were encountered: