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

Support custom knowledge base #83

Merged
merged 29 commits into from
Mar 29, 2024
Merged

Support custom knowledge base #83

merged 29 commits into from
Mar 29, 2024

Conversation

lynchee-owo
Copy link
Contributor

@lynchee-owo lynchee-owo commented Mar 25, 2024

  • custom knowledge base UI in settings
  • new custom knowledge in form
  • new custom knowledge in json
  • combine custom knowledge with local knowledge(db.json)

TODO in the future. not in scope of this pr

  • use <FastField /> when the new knowledge form gets very complicated (30+ fields)
  • more sophisticated form field validation

solve #57

Copy link
Contributor

@mondaychen mondaychen left a comment

Choose a reason for hiding this comment

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

  1. Please address type errors and warnings.
  2. I don't see redirects. I think we either need to store custom redirects, or make www.example.com and example.com point to each other automatically (do the same build-in knowledge base)
  3. we should think about how people can use the settings others share. Maybe add a view that allows freeform JSON editing (of course we'll need to validate before save)

src/helpers/knowledge/index.ts Outdated Show resolved Hide resolved
src/state/settings.ts Outdated Show resolved Hide resolved
src/common/NewKnowledgeForm.tsx Outdated Show resolved Hide resolved
@@ -158,6 +158,7 @@ const Settings = ({ setInSettingsView }: SettingsProps) => {
<FormLabel mb="0">Turn On Voice Mode</FormLabel>
<Spacer />
<Switch
id="voiceModeSwitch"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an id here because without this, clicking any formLabel in settings would trigger switch even though there's no htmlFor

src/common/NewKnowledgeForm.tsx Outdated Show resolved Hide resolved
src/common/CustomKnowledgeBase.tsx Outdated Show resolved Hide resolved
src/common/CustomKnowledgeBase.tsx Outdated Show resolved Hide resolved
src/common/CustomKnowledgeBase.tsx Outdated Show resolved Hide resolved
src/common/CustomKnowledgeBase.tsx Outdated Show resolved Hide resolved
src/common/NewKnowledgeForm.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@mondaychen mondaychen left a comment

Choose a reason for hiding this comment

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

Great job! Approved, just some small things

src/common/CustomKnowledgeBase/NewKnowledgeForm.tsx Outdated Show resolved Hide resolved
src/common/CustomKnowledgeBase/NewKnowledgeForm.tsx Outdated Show resolved Hide resolved
@lynchee-owo lynchee-owo merged commit 00eafaa into main Mar 29, 2024
3 checks passed
@mondaychen mondaychen deleted the lynchee/ckb branch May 23, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants