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

Set assistant prompt from URL #942

Closed
wants to merge 4 commits into from
Closed

Set assistant prompt from URL #942

wants to merge 4 commits into from

Conversation

nsarrazin
Copy link
Collaborator

Assistant view

image

Settings edit/new

image

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.

@nsarrazin nsarrazin added enhancement New feature or request websearch assistants Related to the assistants feature labels Mar 19, 2024
Comment on lines +124 to +144
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."
Copy link
Collaborator

@gary149 gary149 Mar 19, 2024

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>.

// 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);
Copy link
Collaborator

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.

@secondtruth
Copy link
Contributor

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:

Internet access

  • [Checkbox] Web searchexpands the options:
    • (Radio) Everywhere
    • (Radio) Specific Domains
    • (Radio) Specific Links
  • [Checkbox] System Prompt URL

Related to this feature:

@nsarrazin
Copy link
Collaborator Author

Closing in favour of #949

@nsarrazin nsarrazin closed this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assistants Related to the assistants feature enhancement New feature or request websearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants