-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Set assistant prompt from URL #942
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
Conversation
formData.set("ragPrepromptUrl", ""); | ||
} else if (ragMode === "all") { | ||
formData.set("ragAllowAll", "true"); | ||
formData.set("ragLinkList", ""); | ||
formData.set("ragDomainList", ""); | ||
formData.set("ragPrepromptUrl", ""); | ||
} else if (ragMode === "links") { | ||
formData.set("ragAllowAll", "false"); | ||
formData.set("ragDomainList", ""); | ||
formData.set("ragPrepromptUrl", ""); | ||
} else if (ragMode === "domains") { | ||
formData.set("ragAllowAll", "false"); | ||
formData.set("ragLinkList", ""); | ||
formData.set("ragPrepromptUrl", ""); | ||
} else if (ragMode === "preprompt") { | ||
formData.set("ragAllowAll", "false"); | ||
formData.set("ragLinkList", ""); | ||
formData.set("ragDomainList", ""); | ||
formData.set( | ||
"preprompt", | ||
"The system prompt input is disabled when using a system prompt URL." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just refactor later no? I don't get why we need this list this should be handled natively by the <form>
.
Co-authored-by: Victor Muštar <[email protected]>
// if the assistant has a preprompt Url and it's not local, try to fetch it | ||
if (assistant.rag?.prepromptUrl && !(await isURLLocal(new URL(assistant.rag.prepromptUrl)))) { | ||
try { | ||
const content = await parseWeb(assistant.rag.prepromptUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not parse like for web content.
I think, this will be a very useful feature. 👍 But I would suggest to make the internet access features composable, so that web search, prompts from URLs, etc. can be used together if desired. In that case, the settings UI could be structured this way:
Related to this feature:
|
Closing in favour of #949 |
Assistant view
Settings edit/new
This uses the same
parseWeb
method we use in the web search, but instead of chunking and generating embeddings we just add the resulting text to the system prompt.