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

Add websearch controls for assistants #812

Merged
merged 50 commits into from Mar 14, 2024
Merged

Conversation

nsarrazin
Copy link
Collaborator

Added 4 options to assistant for RAG

  • Disabled (will never use websearch)
  • Enabled (will always use websearch)
  • Links (user specifies up to 3 URLs that will be parsed directly)
  • Domains (lets the user specify domains that will be used for searching the web)

Links

image image

This is super useful if you have a website that contains maybe your restaurant's menu, or the daily country in your "guess a country game" or any information that you want to udpate easily from a website you own. (could even be a markdown file on github or a pastebin)

Domains

image image

Useful if you want to still use a search engine but restrict it to maybe your company website, or your docs, or a specific subreddit for example. It just adds site:[domainhere] to the query before asking the search engine.

@nsarrazin nsarrazin added enhancement New feature or request front This issue is related to the front-end of the app. back This issue is related to the Svelte backend or the DB websearch assistants Related to the assistants feature labels Feb 10, 2024
@nsarrazin
Copy link
Collaborator Author

cc @mishig25 maybe have a look at 59066f2 for websearch related changes if you want! (I added plain text support to the parser)

@mishig25
Copy link
Collaborator

@nsarrazin I didn't follow the reason why the websearch was turned off for the assistants from the beginning ?

@nsarrazin
Copy link
Collaborator Author

Don't remember exactly 😅 , cc @gary149

@mishig25
Copy link
Collaborator

mishig25 commented Feb 15, 2024

If assistant has rag

rag?: {
	allowAll: boolean;
	allowList: string[];
	links: string[];
};

I think it would be useful to show the rag on the assitant page as well

image

@@ -18,6 +19,9 @@ const newAsssistantSchema = z.object({
exampleInput3: z.string().optional(),
exampleInput4: z.string().optional(),
avatar: z.instanceof(File).optional(),
ragLinkList: z.preprocess(parseStringToList, z.string().url().array().max(3)),
ragDomainList: z.preprocess(parseStringToList, z.string().array()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also add max n here

@nsarrazin
Copy link
Collaborator Author

Started a conversation internally about the security aspects of letting the user fetch an arbitrary URL server-side. Maybe this should be feature flagged?

@gururise
Copy link
Contributor

Started a conversation internally about the security aspects of letting the user fetch an arbitrary URL server-side. Maybe this should be feature flagged?

Any resolution? This feature would be useful for agents.

Copy link
Collaborator

@mishig25 mishig25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ! made some nits (please accept/disregard any)

@gary149 gary149 self-requested a review March 14, 2024 17:25
@nsarrazin nsarrazin merged commit 3f5871c into main Mar 14, 2024
3 checks passed
@nsarrazin nsarrazin deleted the feature/rag_on_assistant branch March 14, 2024 17:49
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 back This issue is related to the Svelte backend or the DB enhancement New feature or request front This issue is related to the front-end of the app. websearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants