Compare commits

...

1251 Commits

Author SHA1 Message Date
Yuhong Sun
4293543a6a k 2024-07-20 16:48:05 -07:00
Yuhong Sun
e95bfa0e0b Suffix Test (#1880) 2024-07-20 15:54:55 -07:00
Yuhong Sun
4848b5f1de Suffix Edits (#1878) 2024-07-20 13:59:14 -07:00
Yuhong Sun
7ba5c434fa Missing Comma (#1877) 2024-07-19 22:15:45 -07:00
Yuhong Sun
59bf5ba848 File Connector Metadata (#1876) 2024-07-19 20:45:18 -07:00
Weves
f66c33380c Improve widget README 2024-07-19 20:21:07 -07:00
Weves
115650ce9f Add example widget code 2024-07-19 20:14:52 -07:00
Weves
7aa3602fca Fix black 2024-07-19 18:55:09 -07:00
Weves
864c552a17 Fix UT 2024-07-19 18:55:09 -07:00
Brent Kwok
07b2ed3d8f Fix HTTP 422 error for api_inference_sample.py (#1868) 2024-07-19 18:54:43 -07:00
Yuhong Sun
38290057f2 Search Eval (#1873) 2024-07-19 16:48:58 -07:00
Weves
2344edf158 Change default login time to 7 days 2024-07-19 13:58:50 -07:00
versecafe
86d1804eb0 Add GPT-4o-Mini & fix a missing gpt-4o 2024-07-19 12:10:27 -07:00
pablodanswer
1ebae50d0c minor udpate 2024-07-19 10:53:28 -07:00
Weves
a9fbaa396c Stop building on every PR 2024-07-19 10:21:19 -07:00
pablodanswer
27d5f69427 udpate to headers (#1864) 2024-07-19 08:38:54 -07:00
pablodanswer
5d98421ae8 show "analysis" (#1863) 2024-07-18 18:18:36 -07:00
Kevin Shi
6b561b8ca9 Add config to skip zendesk article labels 2024-07-18 18:00:51 -07:00
pablodanswer
2dc7e64dd7 fix internet search icons / text + assistants tab (#1862) 2024-07-18 16:15:19 -07:00
Yuhong Sun
5230f7e22f Enforce Disable GenAI if set (#1860) 2024-07-18 13:25:55 -07:00
hagen-danswer
a595d43ae3 Fixed deleting toolcall by message 2024-07-18 12:52:28 -07:00
Yuhong Sun
ee561f42ff Cleaner Layout (#1857) 2024-07-18 11:13:16 -07:00
Yuhong Sun
f00b3d76b3 Touchup NoOp (#1856) 2024-07-18 08:44:27 -07:00
Yuhong Sun
e4984153c0 Touchups (#1855) 2024-07-17 23:47:10 -07:00
pablodanswer
87fadb07ea COMPLETE USER EXPERIENCE OVERHAUL (#1822) 2024-07-17 19:44:21 -07:00
pablodanswer
2b07c102f9 fix discourse connector rate limiting + topic fetching (#1820) 2024-07-17 14:57:40 -07:00
hagen-danswer
e93de602c3 Use SHA instead of branch and save more data (#1850) 2024-07-17 14:56:24 -07:00
hagen-danswer
1c77395503 Fixed llm_indices from document search api (#1853) 2024-07-17 14:52:49 -07:00
Victorivus
cdf6089b3e Fix bug XML files in chat (#1804) 2024-07-17 08:09:40 -07:00
pablodanswer
d01f46af2b fix search doc bug (#1851) 2024-07-16 15:27:04 -07:00
hagen-danswer
b83f435bb0 Catch dropped eval questions and added multiprocessing (#1849) 2024-07-16 12:33:02 -07:00
hagen-danswer
25b3dacaba Seperated model caching volumes (#1845) 2024-07-15 15:32:04 -07:00
hagen-danswer
a1e638a73d Improved eval logging and stability (#1843) 2024-07-15 14:58:45 -07:00
Yuhong Sun
bd1e0c5969 Add Enum File (#1842) 2024-07-15 09:13:27 -07:00
Yuhong Sun
4d295ab97d Model Server Logging (#1839) 2024-07-15 09:00:27 -07:00
Weves
6fe3eeaa48 Fix model serer startup 2024-07-14 23:33:58 -07:00
Chris Weaver
078d5defbb Update Slack link in README.md 2024-07-14 16:50:48 -07:00
Weves
0d52e99bd4 Improve confluence rate limiting 2024-07-14 16:40:45 -07:00
hagen-danswer
1b864a00e4 Added support for multiple Eval Pipeline UIs (#1830) 2024-07-14 15:16:20 -07:00
Weves
dae4f6a0bd Fix latency caused by large numbers of tags 2024-07-14 14:21:07 -07:00
Yuhong Sun
f63d0ca3ad Title Truncation Logic (#1828) 2024-07-14 13:54:36 -07:00
Yuhong Sun
da31da33e7 Fix Title for docs without (#1827) 2024-07-14 13:51:11 -07:00
Yuhong Sun
56b175f597 Fix Sitemap Robo (#1826) 2024-07-14 13:29:26 -07:00
Zoltan Szabo
1b311d092e Try to find the sitemap for a given site (#1538) 2024-07-14 13:24:10 -07:00
Moshe Zada
6ee1292757 Fix semantic id for web pdfs (#1823) 2024-07-14 11:38:11 -07:00
Yuhong Sun
017af052be Global Tokenizer Fix (#1825) 2024-07-14 11:37:10 -07:00
pablodanswer
e7f81d1688 add third party embedding models (#1818) 2024-07-14 10:19:53 -07:00
Weves
b6bd818e60 Fix user groups page when a persona is deleted 2024-07-13 15:35:50 -07:00
hagen-danswer
36da2e4b27 Fixed slack groups (#1814)
* Simplified slackbot response groups and fixed need more help bug

* mypy fixes

* added exceptions for the couldnt find passthrough arrays
2024-07-13 22:34:35 +00:00
pablodanswer
c7af6a4601 add new standard answer test endpoint (#1789) 2024-07-12 10:06:30 -07:00
Yuhong Sun
e90c66c1b6 Include Titles in Chunks (#1817) 2024-07-12 09:42:24 -07:00
hagen-danswer
8c312482c1 fixed id retrieval from zip metadata (#1813) 2024-07-11 20:38:12 -07:00
Weves
e50820e65e Remove Internet 'Connector' that mistakenly appears on the Add Connector page 2024-07-11 18:00:59 -07:00
hagen-danswer
991ee79e47 some qol improvements for search pipeline (#1809) 2024-07-11 17:42:11 -07:00
hagen-danswer
3e645a510e Fix slack error logging (#1800) 2024-07-11 08:31:48 -07:00
Yuhong Sun
08c6e821e7 Merge Sections Logic (#1801) 2024-07-10 20:14:02 -07:00
hagen-danswer
47a550221f slackbot doesnt respond without citations/quotes (#1798)
* slackbot doesnt respond without citations/quotes

fixed logical issues

fixed dict logic

* added slackbot shim for the llm source/time feature

* mypy fixes

* slackbot doesnt respond without citations/quotes

fixed logical issues

fixed dict logic

* Update handle_regular_answer.py

* added bypass_filter check

* final fixes
2024-07-11 00:18:26 +00:00
Weves
511f619212 Add content to /document-search response 2024-07-10 15:44:58 -07:00
Varun Gaur
6c51f001dc Confluence Connector to Sync Child pages only (#1629)
---------

Co-authored-by: Varun Gaur <vgaur@roku.com>
Co-authored-by: hagen-danswer <hagen@danswer.ai>
Co-authored-by: pablodanswer <pablo@danswer.ai>
2024-07-10 14:17:03 -07:00
pablodanswer
09a11b5e1a Fix citations + unit tests (#1760) 2024-07-10 10:05:20 -07:00
pablodanswer
aa0f7abdac add basic table wrapping (#1791) 2024-07-09 19:14:41 -07:00
Yuhong Sun
7c8f8dba17 Break the Danswer LLM logging from LiteLLM Verbose (#1795) 2024-07-09 18:18:29 -07:00
Yuhong Sun
39982e5fdc Info propagating to allow Chunk Merging (#1794) 2024-07-09 18:15:07 -07:00
pablodanswer
5e0de111f9 fix wrapping in error hover connector (#1790) 2024-07-09 11:54:35 -07:00
pablodanswer
727d80f168 fix gpt-4o image issue (#1786) 2024-07-08 23:07:53 +00:00
rashad-danswer
146f85936b Internet Search Tool (#1666)
---------

Co-authored-by: Weves <chrisweaver101@gmail.com>
2024-07-06 18:01:24 -07:00
Chris Weaver
e06f8a0a4b Standard Answers (#1753)
---------

Co-authored-by: druhinsgoel <druhin@danswer.ai>
2024-07-06 16:11:11 -07:00
Yuhong Sun
f0888f2f61 Eval Script Incremental Write (#1784) 2024-07-06 15:43:40 -07:00
Yuhong Sun
d35d7ee833 Evaluation Pipeline Touchup (#1783) 2024-07-06 13:17:05 -07:00
Yuhong Sun
c5bb3fde94 Ignore Eval Files (#1782) 2024-07-06 12:15:03 -07:00
Yuhong Sun
79190030a5 New Env File for Eval (#1781) 2024-07-06 12:07:31 -07:00
Yuhong Sun
8e8f262ed3 Docker Compose Eval Pipeline Cleanup (#1780) 2024-07-06 12:04:57 -07:00
hagen-danswer
ac14369716 Added search quality testing pipeline (#1774) 2024-07-06 11:51:50 -07:00
Weves
de4d8e9a65 Fix shared chats 2024-07-04 11:41:16 -07:00
hagen-danswer
0b384c5b34 fixed salesforce url generation (#1777) 2024-07-04 10:43:21 -07:00
Weves
fa049f4f98 Add UI support for github configs 2024-07-03 17:37:59 -07:00
pablodanswer
72d6a0ef71 minor updates to assistant UI (#1771) 2024-07-03 18:28:25 +00:00
pablodanswer
ae4e643266 Update Assistants Creation UI (#1714)
* slide up "Tools"

* rework assistants page

* update layout

* reorg complete

- pending: useful header text?

* add tooltips

* alter organizational structure

* rm shadcn

* rm dependencies

* revalidate dependencies

* restore

* update component structure

* [s] format

* rm package json

* add package-lock.json [s]

* collapsible

* naming + width

* formatting

* formatting

* updated user flow

- Fix error/detail messages
- Fix tooltip delay
- Fix icons

* 1 -> 2

* naming fixes

* ran pretty

* fix build issue?

* web build issues?
2024-07-03 17:11:14 +00:00
hagen-danswer
a7da07afc0 allowed arbitrary types to handle the sqlalchemy datatype (#1758)
* allowed arbitrary types to handle the sqlalchemy datatype

* changed persona_upsert to take in ids instead of objects
2024-07-03 07:10:57 +00:00
Weves
7f1bb67e52 Pass through API base to ImageGenerationTool 2024-07-02 23:31:04 -07:00
Weves
982b1b0c49 Add litellm.set_verbose support 2024-07-02 23:22:17 -07:00
Daniel Naber
2db128fb36 Notion date filter fix (#1755)
* fix filter logic

* make comparison better readable
2024-07-02 15:39:35 -07:00
Christoph Petzold
3ebac6256f Fix "cannot access local variable" for bot direct messages (#1737)
* Update handle_message.py

* Update handle_message.py

* Update handle_message.py

---------

Co-authored-by: hagen-danswer <hagen@danswer.ai>
2024-07-02 15:36:23 -07:00
Weves
1a3ec59610 Fix build caused by bad seeding config 2024-07-01 23:41:43 -07:00
hagen-danswer
581cb827bb added settings and persona seeding options (#1742)
* added settings and persona seeding options

* updated recency_bias

* changed variable type

* another fix

* Update seeding.py

* fixed mypy

* push
2024-07-01 22:22:17 +00:00
Weves
393b3c9343 Fix misc chat bugs 2024-06-30 18:08:03 -07:00
Weves
2035e9f39c Fix docker build 2024-06-30 14:34:47 -07:00
Weves
52c3a5e9d2 Fix slackbot citation images 2024-06-30 13:42:56 -07:00
pablodanswer
3e45a41617 Bugfix/scroll (#1748) 2024-06-30 12:58:57 -07:00
Weves
415960564d Fix fast models 2024-06-29 15:19:09 -07:00
pablodanswer
ed550986a6 Feature/assistants (#1581)
* include alternate assisstant

- migrate models
- migrate db

* functional alternate assistant selection

* refactor chat components for persona API

* functional assistants api

* add full functionality- assistants

* add functional assistants dropdown handler

* refactor assistants for full compatability

- hooks
- track the live assistant for edge cases
- UI updates

* add assistant UI features

- Autotab
- Arrow selection
- Icons
- Proper @ detection
- Info Popup

prune unnecessary comments

* functional search toggling for assistants

* add functional cross-page assistants

rebase with main

* add proper interactivity for edge cases

- click outside of input / text box
- "force search" assistant consistency

* refactor alt assistant consistency

* update alembic versions

* rebased

* undo formatting changes

* additional formatting

* current processing

* merge fixes

* formatting

* colors

* 2 -> 1

* 1 -> 2

---------

Co-authored-by: “Pablo <“pablo@danswer.ai”>
2024-06-29 00:18:39 +00:00
hagen-danswer
60dd77393d Disallowed simultaneous pruning jobs (#1704)
* Added TTL to EE Celery tasks

* fixed alembic files

* fixed frontend build issue and reworked file deletion

* FileD

* revert change

* reworked delete chatmessage

* added orphan cleanup

* ensured syntax

* Disallowed simultaneous pruning jobs

* added rate limiting and env vars

* i hope this is how you use decorators

* nonsense

* cleaned up names, added config

* renamed other utils

* Update celery_utils.py

* reverted changes
2024-06-28 23:26:00 +00:00
hagen-danswer
3fe5313b02 renamed alembic table (#1741) 2024-06-28 22:54:19 +00:00
hagen-danswer
bd0925611a Added TTL to EE Celery tasks (#1713)
* Added TTL to EE Celery tasks

* fixed alembic files

* fixed frontend build issue and reworked file deletion

* FileD

* revert change

* reworked delete chatmessage

* added orphan cleanup

* ensured syntax

* default value to None

* made all deletions manual

* added fix

* Use tremor buttons now

* removed words

* Update 23957775e5f5_remove_feedback_foreignkey_constraint.py

* fixed alembic version
2024-06-28 22:13:47 +00:00
pablodanswer
de6d040349 add boto3 typing to default requirements (#1740) 2024-06-28 13:06:59 -07:00
Chris Weaver
38da3128d8 Pass headers into image generation (#1739) 2024-06-28 12:33:53 -07:00
Chris Weaver
e47da0d688 Small readme improvement (#1735) 2024-06-27 19:12:24 -07:00
rkuo-danswer
2c0e0c5f11 Merge pull request #1731 from danswer-ai/feature/merge-queue-workflows
add workflows that automate docker builds against merge group events
2024-06-27 18:25:05 -07:00
Richard Kuo (Danswer)
29d57f6354 remove obsolete comment 2024-06-27 17:39:17 -07:00
rkuo-danswer
369e607631 Fixes DAN-189 (safari bug in admin). Removed td/absolute positioning behavior which is unde… (#1718) 2024-06-27 17:15:42 -07:00
pablodanswer
f03f97307f Blob Storage (#1705)
S3 + OCI + Google Cloud Storage + R2
---------

Co-authored-by: Art Matsak <5328078+artmatsak@users.noreply.github.com>
2024-06-27 17:12:20 -07:00
Weves
145cdb69b7 Remove duplicate tool check 2024-06-27 17:05:50 -07:00
pablodanswer
9310a8edc2 Feature/scroll (#1694)
---------

Co-authored-by: “Pablo <“pablo@danswer.ai”>
2024-06-27 16:40:23 -07:00
Yuhong Sun
2140f80891 Tidy up Actions ported from EE (#1732) 2024-06-27 16:20:34 -07:00
Richard Kuo (Danswer)
52dab23295 add workflows that automate docker builds against merge group events 2024-06-27 14:31:39 -07:00
Weves
91c9b2eb42 Add more logging for num workers in simple job client 2024-06-27 11:49:08 -07:00
Weves
5764cdd469 Use FiEdit2 as the standard edit icon 2024-06-27 11:32:47 -07:00
Weves
8fea6d7f64 Fix share for insecure: 2024-06-27 11:19:04 -07:00
pablodanswer
5324b15397 Chat overflow (#1723) 2024-06-27 11:02:11 -07:00
Yuhong Sun
8be42a5f98 Touchup for Multilingual Users (#1725) 2024-06-26 22:44:06 -07:00
Weves
062dc98719 Fix search tool 2024-06-26 21:28:16 -07:00
pablodanswer
43557f738b add copy-paste images (#1722) 2024-06-26 20:12:34 -07:00
Weves
b5aa7370a2 Make seeded model default 2024-06-26 16:03:24 -07:00
Weves
4ba6e45128 Small template fix 2024-06-26 13:58:30 -07:00
pablodanswer
d6e5a98a22 Minor Update to UI (#1692)
New sidebar / chatbar color, hidable right-panel, and many more small tweaks.

---------

Co-authored-by: pablodanswer <“pablo@danswer.ai”>
2024-06-26 13:54:41 -07:00
Yuhong Sun
20c4cdbdda Catch LLM Generation Failure (#1712) 2024-06-26 10:44:22 -07:00
Yuhong Sun
0d814939ee Bugfix for Selected Doc when the message it is selected from failed (#1711) 2024-06-26 10:32:30 -07:00
Yuhong Sun
7d2b0ffcc5 Developer Env Setup (#1710) 2024-06-26 09:45:19 -07:00
hagen-danswer
8c6cd661f5 Ignore messages from Slack's official bot (#1703)
* Ignore messages from Slack's official bot

* re-added message filter
2024-06-25 20:33:36 -07:00
Weves
5d552705aa Change EE environment variable name 2024-06-25 16:59:09 -07:00
Weves
1ee8ee9e8b Prepare EE to merge with MIT 2024-06-25 15:07:56 -07:00
Chris Weaver
f0b2b57d81 Usage reports (#118)
---------

Co-authored-by: amohamdy99 <a.mohamdy99@gmail.com>
2024-06-25 15:07:56 -07:00
hagen-danswer
5c12a3e872 brought out the UsersResponse interface (#119) 2024-06-25 15:07:56 -07:00
Weves
3af81ca96b Fix seed config when left empty 2024-06-25 15:07:56 -07:00
Weves
f55e5415bb Add empty assets folder 2024-06-25 15:07:56 -07:00
Weves
3d434c2c9e Fix persona access for answer-with-quote API 2024-06-25 15:07:56 -07:00
pablodanswer
90ec156791 formatting 2024-06-25 15:07:56 -07:00
pablodanswer
8ba48e24a6 minor build fix 2024-06-25 15:07:56 -07:00
pablodanswer
e34bcbbd06 Add persistent name and logo seeding (#107) 2024-06-25 15:07:56 -07:00
pablodanswer
db319168f8 stronger wording 2024-06-25 15:07:56 -07:00
pablodanswer
010ce5395f Minor/ee optional branding (#105) 2024-06-25 15:07:56 -07:00
rashad-danswer
98a58337a7 Query history speed fix (#109) 2024-06-25 15:07:56 -07:00
Weves
733d4e666b Add support for private file connectors 2024-06-25 15:07:56 -07:00
Weves
2937fe9e7d Fix backend build 2024-06-25 15:07:56 -07:00
Weves
457527ac86 Try different runner groups for each build 2024-06-25 15:07:56 -07:00
Weves
7cc51376f2 Allow basic seeding of Danswer via env variable 2024-06-25 15:07:56 -07:00
Weves
7278d45552 Fix rebase issue 2024-06-25 15:07:56 -07:00
Yuhong Sun
1c343bbee7 Enable Dedup Flag for Doc Search Endpoint 2024-06-25 15:07:56 -07:00
Weves
bdcfb39724 Add whitelabeled name to login page 2024-06-25 15:07:56 -07:00
Weves
694d20ea8f Fix user groups issue from rebase 2024-06-25 15:07:56 -07:00
Weves
45402d0755 Add back custom logo/name to sidebar header 2024-06-25 15:07:56 -07:00
Weves
69740ba3d5 Fix rebase issue 2024-06-25 15:07:56 -07:00
Yuhong Sun
6162283beb Fix formatting issues (#93) 2024-06-25 15:07:56 -07:00
Yuhong Sun
44284f7912 Fix Rebase Issues (#92) 2024-06-25 15:07:56 -07:00
Weves
775ca5787b Move web build to a matrix build 2024-06-25 15:07:56 -07:00
Weves
c6e49a3034 Don't get duplicate docs during user group syncing 2024-06-25 15:07:56 -07:00
Weves
9c8cfd9175 Fix mypy 2024-06-25 15:07:56 -07:00
Weves
fc3ed76d12 Add pagination to user group syncing 2024-06-25 15:07:56 -07:00
Weves
a2597d5f21 Fix rebase issue with dev compose file 2024-06-25 15:07:56 -07:00
Yuhong Sun
af588461d2 Enable Encryption 2024-06-25 15:07:56 -07:00
Weves
460e61b3a7 Fix document lock acquisition for user group sync 2024-06-25 15:07:56 -07:00
Weves
c631ac0c3a Change secret name 2024-06-25 15:07:56 -07:00
Yuhong Sun
10be91a8cc Track Slack questions Autoresolved (#86) 2024-06-25 15:07:56 -07:00
Weves
eadad34a77 Fix /send-message-simple-api endpoint 2024-06-25 15:07:56 -07:00
Weves
b19d88a151 Fix rebase issue with file_store 2024-06-25 15:07:56 -07:00
Weves
e33b469915 Remove unused Chat.tsx file 2024-06-25 15:07:56 -07:00
Weves
719fc06604 Fix rebase issue with UI-based LLM selection 2024-06-25 15:07:56 -07:00
Alan Hagedorn
d7a704c0d9 Token Rate Limiting
WIP

Cleanup 🧹

Remove existing rate limiting logic

Cleanup 🧼

Undo nit

Cleanup 🧽

Move db constants (avoids circular import)

WIP

WIP

Cleanup

Lint

Resolve alembic conflict

Fix mypy

Add backfill to migration

Update comment

Make unauthenticated users still adhere to global limits

Use Depends

Remove enum from table

Update migration error handling + deletion

Address verbal feedback, cleanup urls, minor nits
2024-06-25 15:07:56 -07:00
Yuhong Sun
7a408749cf Fix Web Compile Issue (#81) 2024-06-25 15:07:56 -07:00
Yuhong Sun
d9acd03a85 Query History Include Feedback Text (#80) 2024-06-25 15:07:56 -07:00
Yuhong Sun
af94c092e7 Reduce sync jobs batch size (#79) 2024-06-25 15:07:56 -07:00
Yuhong Sun
f55a4ef9bd Remove Nested Session (#78) 2024-06-25 15:07:56 -07:00
Yuhong Sun
6c6e33e001 Allow Empty API Names (#77) 2024-06-25 15:07:56 -07:00
Yuhong Sun
336c046e5d Better Naming for API Keys (#76) 2024-06-25 15:07:56 -07:00
Weves
9a9b89f073 Fix rebase issue with public assistants 2024-06-25 15:07:56 -07:00
Weves
89fac98534 Fix ee redirect 2024-06-25 15:07:56 -07:00
Weves
65b65518de Add back ChatBanner 2024-06-25 15:07:56 -07:00
Yuhong Sun
0c827d1e6c Permission Sync Framework (#44) 2024-06-25 15:07:56 -07:00
Weves
1984f2c1ca Add automated auth checks for ee 2024-06-25 15:07:56 -07:00
Yuhong Sun
50f006557f Add message id to simple message endpoint (#69) 2024-06-25 15:07:56 -07:00
Yuhong Sun
c00bd44bcc Add Chunk Context options for EE APIs (#68) 2024-06-25 15:07:56 -07:00
Yuhong Sun
680aca68e5 Make EE containers public changes (#67) 2024-06-25 15:07:56 -07:00
Weves
22a2f86fb9 FE build fix 2024-06-25 15:07:56 -07:00
Weves
c055dc1535 Add custom analytics script 2024-06-25 15:07:56 -07:00
Alan Hagedorn
81e9880d9d Add names to API Keys (#63) 2024-06-25 15:07:56 -07:00
Weves
3466f6d3a4 Custom banner 2024-06-25 15:07:56 -07:00
Weves
91cf45165f Small fixes + adding 'Powered by Danswer' 2024-06-25 15:07:56 -07:00
Weves
ee2a5bbf49 Add custom-styling ability via themes 2024-06-25 15:07:56 -07:00
Weves
153007c57c Whitelableing for Logo / Name via Admin panel 2024-06-25 15:07:56 -07:00
Yuhong Sun
fa8cc10063 Allow Optional Rerank in APIs (#60) 2024-06-25 15:07:56 -07:00
Yuhong Sun
2c3ba5f021 Include User in Query Export (#59) 2024-06-25 15:07:56 -07:00
Yuhong Sun
e3ef620094 Query History Now Handles Old Messages (#58) 2024-06-25 15:07:56 -07:00
Yuhong Sun
40369e0538 Formatter (#57) 2024-06-25 15:07:56 -07:00
Yuhong Sun
d6c5c65b51 Fix Query History (#56) 2024-06-25 15:07:56 -07:00
Yuhong Sun
7b16cb9562 Rebase search changes to EE APIs (#55) 2024-06-25 15:07:56 -07:00
Weves
ef4f06a375 Fix SAML for /manage/me 2024-06-25 15:07:56 -07:00
Chris Weaver
17cc262f5d Private personas doc sets (#52)
Private Personas and Document Sets

---------

Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-06-25 15:07:56 -07:00
Yuhong Sun
680482bd06 Metadata filter for document search API (#53) 2024-06-25 15:07:56 -07:00
Weves
64874d2737 Change runner for backend 2024-06-25 15:07:56 -07:00
Weves
00ade322f1 Fix small answer-with-quote bug 2024-06-25 15:07:56 -07:00
Weves
eab5d054d5 Add env variable to control hash rounds 2024-06-25 15:07:56 -07:00
Weves
a09d60d7d0 Fix user group deletion bug 2024-06-25 15:07:56 -07:00
Yuhong Sun
f17dc52b37 One Shot API No Stream (#41) 2024-06-25 15:07:56 -07:00
Yuhong Sun
c1862e961b Simple API No Longer Require Specify Prompt (#40) 2024-06-25 15:07:56 -07:00
Yuhong Sun
6b46a71cb5 Fix Empty Chat for API (#39) 2024-06-25 15:07:56 -07:00
Yuhong Sun
9ae3a4af7f Basic Chat API (#38) 2024-06-25 15:07:56 -07:00
Weves
328b96c9ff Make public/not-public selector prettier 2024-06-25 15:07:56 -07:00
Yuhong Sun
bac34a47b2 Embedding Model Swap Changes (#35) 2024-06-25 15:07:56 -07:00
Weves
15934ee268 Fix limit/offset for document-search endpoint 2024-06-25 15:07:56 -07:00
Weves
fe975c3357 Add global prefix to EE endpoints 2024-06-25 15:07:56 -07:00
Weves
8bf483904d Fix users page with API keys + add spinner on key creation 2024-06-25 15:07:56 -07:00
Yuhong Sun
db338bfddf Introduce EE only Backend APIs (#29) 2024-06-25 15:07:56 -07:00
Weves
ae02a5199a Add API key generation in the UI + allow it to be used across all endpoints 2024-06-25 15:07:56 -07:00
Yuhong Sun
4b44073d9a CVEs (#26) 2024-06-25 15:07:56 -07:00
Weves
ce36530c79 Fix viewing other users' chat histories in query history 2024-06-25 15:07:56 -07:00
Weves
39d69838c5 Make query history fetch client-side 2024-06-25 15:07:56 -07:00
Weves
e11f0f6202 Fix /chat-session-history/{chat_session_id} endpoint when auth is enabled 2024-06-25 15:07:56 -07:00
Weves
ce870ff577 Re-style user group pages 2024-06-25 15:07:56 -07:00
Weves
a52711967f Fix analytics + query history 2024-06-25 15:07:56 -07:00
Weves
67a4eb6f6f Fix frontend typing rebase issue 2024-06-25 15:07:56 -07:00
Weves
9599388db8 Fix sidebar typo 2024-06-25 15:07:56 -07:00
Weves
f82ae158ea Mark indexing jobs as ee when running ee supervisord 2024-06-25 15:07:56 -07:00
Weves
670de6c00d Add new env variable to EE supervisord 2024-06-25 15:07:56 -07:00
Yuhong Sun
56c52bddff Fix missing supervisord change from Danswer MIT (#18) 2024-06-25 15:07:56 -07:00
Chris Weaver
3984350ff9 Improvements to Query History (#17)
* Add option to download query-history as a CSV

* Add user email + more complete timestamp
2024-06-25 15:07:56 -07:00
Weves
f799d9aa11 Fix EE import 2024-06-25 15:07:56 -07:00
Yuhong Sun
529f2c8c2d Danswer EE Version Text (#12) 2024-06-25 15:07:56 -07:00
Yuhong Sun
b4683dc841 Fix Rebase Issue 2024-06-25 15:07:56 -07:00
Chris Weaver
db8ce61ff4 Fix group prefix (#11) 2024-06-25 15:07:56 -07:00
Yuhong Sun
d016e8335e Update default SAML config location (#10) 2024-06-25 15:07:56 -07:00
Yuhong Sun
0c295d1de5 Enable EE features for no-letsencrypt deployment (#9) 2024-06-25 15:07:56 -07:00
Chris Weaver
e9f273d99a Admin Analytics/Query History dashboards (#6) 2024-06-25 15:07:56 -07:00
Weves
428f5edd21 Update ee supervisord 2024-06-25 15:07:56 -07:00
Weves
50170cc97e Move user group syncing to Celery Beat 2024-06-25 15:07:56 -07:00
Chris Weaver
7503f8f37b Add User Groups (a.k.a. RBAC) (#4) 2024-06-25 15:07:56 -07:00
Yuhong Sun
92de6acc6f Initial EE features (#3) 2024-06-25 15:07:56 -07:00
mattboret
65d5808ea7 Confluence: add pages labels indexation (#1635)
* Confluence: add pages labels indexation

* changed the default and fixed the dict building

* Update app_configs.py

* Update connector.py

---------

Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
Co-authored-by: hagen-danswer <hagen@danswer.ai>
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-06-25 10:41:29 -07:00
Yuhong Sun
061dab7f37 Touchup (#1702) 2024-06-25 10:34:03 -07:00
hagen-danswer
e65d9e155d fixed confluence breaking on unknown filetypes (#1698) 2024-06-25 10:19:01 -07:00
hagen-danswer
50f799edf4 Merge pull request #1672 from danswer-ai/add-groups-to-slack-bot-responses
add slack groups to user response list
2024-06-24 15:10:12 -07:00
pablodanswer
c1d8f6cb66 add basic 403 support for healthcheck (#1689) 2024-06-23 11:19:46 -07:00
pablodanswer
6c71bc05ea modify script deletion name (#1690) 2024-06-23 08:29:37 -07:00
Yuhong Sun
123ec4342a Relari (#1687)
Also includes some bugfixes
2024-06-22 18:52:48 -07:00
pablodanswer
7253316b9e Add script for forced connector deletion (#1683) 2024-06-22 17:15:25 -07:00
Weves
4ae924662c Add migration for usage reports 2024-06-22 16:21:41 -07:00
Yuhong Sun
094eea2742 Discourse Edge Case (#1685) 2024-06-22 15:17:33 -07:00
pablodanswer
8178d536b4 Add functional thread modification endpoints (#1668)
Makes it so if you change which LLM you are using in a given ChatSession, that is persisted and sticks around if you reload the page / come back to the ChatSession later
2024-06-21 18:10:30 -07:00
Yuhong Sun
5cafc96cae Enable Internet Search for Deployment Options (#1684) 2024-06-21 17:38:49 -07:00
Weves
3e39a921b0 Fix image generation output 2024-06-21 15:41:55 -07:00
Weves
98b2507045 Improve persona access 2024-06-21 13:35:14 -07:00
hagen-danswer
3dfe17a54d google drive ignores shortcut filetypes now 2024-06-20 18:50:12 -07:00
hagen-danswer
b4675082b1 Update handle_message.py 2024-06-20 21:16:26 -04:00
hagen-danswer
287a706e89 combined the input fields 2024-06-20 11:48:14 -07:00
Kevin Shi
ba58208a85 Transform HTML links to markdown behind config option (#1671) 2024-06-20 10:43:15 -07:00
hagen-danswer
694e9e8679 finished first draft 2024-06-19 22:11:33 -07:00
pablodanswer
9e30ec1f1f hide popup for non admin + if search is disabled 2024-06-19 13:08:24 -07:00
pablodanswer
1b56c75527 [minor] proper assistant line length 2024-06-19 12:14:42 -07:00
Weves
b07fdbf1d1 Cleanup user management 2024-06-18 14:37:47 -07:00
hagen-danswer
54c2547d89 Add connector document pruning task (#1652) 2024-06-18 14:26:12 -07:00
Liam Norris
58b5e25c97 User Management: Invite, Deactivate, Search, & Paginate (#1631) 2024-06-18 11:28:47 -07:00
hagen-danswer
4e15ba78d5 replicated drive fix for gmail connector (#1658) 2024-06-18 08:47:06 -07:00
Yuhong Sun
c798ade127 Code for ease of eval (#1656) 2024-06-17 20:32:12 -07:00
hagen-danswer
93cc5a9e77 improved salesforce description text (#1655) 2024-06-17 20:14:34 -07:00
Weves
7746375bfd Custom tools 2024-06-17 15:12:50 -07:00
Weves
c6d094b2ee Fix google drive connector page refresh 2024-06-16 14:56:36 -07:00
hagen-danswer
7a855192c3 added google slides format to gdrive connector (#1645) 2024-06-16 13:59:20 -07:00
hagen-danswer
c3577cf346 salesforce qol changes (#1644) 2024-06-16 11:12:37 -07:00
hagen-danswer
722a1dd919 Add salesforce connector (#1621) 2024-06-16 10:04:44 -07:00
hagen-danswer
e4999266ca added azure models to vision capable list (#1638) 2024-06-16 08:38:30 -07:00
Weves
f294dba095 Fix google drive page 2024-06-15 16:04:21 -07:00
Weves
03105ad551 Fix bypass_acl support for Slack bot 2024-06-14 16:57:06 -07:00
hagen-danswer
4b0ff95b26 added pptx to drive reader (#1634) 2024-06-13 22:50:28 -07:00
Vikas Neha Ojha
ff06d62acf Added ClickUp Connector (#1521)
* Added connector for clickup

* Fixed mypy issues

* Fallback to description if markdown is not available

* Added extra information in metadata, and support to index comments

* Fixes for fields parsing

* updated fetcher to errorHandlingFetcher

---------

Co-authored-by: hagen-danswer <hagen@danswer.ai>
2024-06-13 17:49:31 -07:00
Yuhong Sun
26fee36ed4 Catch Slack Greeting Msgs Generic (#1633) 2024-06-13 09:41:01 -07:00
Scott Davidson
428439447e Fix Helm vespa resource limits (#1606)
Co-authored-by: sd109 <scott@stackhpc.com>
2024-06-11 21:01:26 -07:00
hagen-danswer
e8cfbc1dd8 added a check for empty URL list in web connector (#1573)
* added a check for empty URL list in web connector

* added raise condition for improper sitemap designation
2024-06-11 18:26:44 -07:00
hagen-danswer
486b0ecb31 Confluence: Add page attachments indexing (#1617)
* Confluence: Add page attachments indexing

* used the centralized file processing to extract file content

* flipped input order for extract_file_text

* added bytes support for pdf converter

* brought out the io.BytesIO to the confluence connector

---------

Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2024-06-11 18:23:13 -07:00
dependabot[bot]
8c324f8f01 Bump requests from 2.31.0 to 2.32.2 in /backend/requirements (#1509)
Bumps [requests](https://github.com/psf/requests) from 2.31.0 to 2.32.2.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.31.0...v2.32.2)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 18:20:08 -07:00
Varun Gaur
5a577f9a00 Added a Logic to Index entire Gitlab Project (#1586)
* Changes for Gitlab connector

* Changes to Rebase from Main

* Changes to Rebase from Main

* Changes to Rebase from Main

* Changes to Rebase from Main

* made indexing code files a config setting

* Update app_configs.py

created env variable

* Update app_configs.py

added false

---------

Co-authored-by: Varun Gaur <vgaur@roku.com>
Co-authored-by: hagen-danswer <hagen@danswer.ai>
2024-06-11 18:18:14 -07:00
Weves
e6d5b95b4a Fix web build 2024-06-11 15:06:55 -07:00
Weves
cc0320b50a Apply passthrough headers for chat renaming 2024-06-10 18:24:46 -07:00
Yuhong Sun
36afa9370f Vespa remove apostrophe in URLs (#1618) 2024-06-10 17:19:47 -07:00
Yuhong Sun
7c9d037b7c Env Template Update (#1615) 2024-06-10 14:24:17 -07:00
Yuhong Sun
a2065f018a Environment Template for VSCode/Cursor (#1614) 2024-06-10 13:36:20 -07:00
Weves
b723627e0c Ability to pass through headers to LLM call 2024-06-10 13:18:31 -07:00
hagen-danswer
180b592afe added html support to file text extractor (#1611) 2024-06-10 12:46:05 -07:00
Weves
e8306b0fa5 Fix web build 2024-06-10 11:40:49 -07:00
Weves
64ee5ffff5 Fix slack bot creation with document sets 2024-06-10 11:29:44 -07:00
hagen-danswer
ead6a851cc Merge pull request #1144 from hagen6835/add-teams-connector
added teams connector
2024-06-10 13:25:54 -04:00
hagen-danswer
73575f22d8 prettier 2024-06-10 09:44:20 -07:00
hagen-danswer
be5dd3eefb final revisions fr 2024-06-10 09:32:39 -07:00
hagen-danswer
f18aa2368e Merge pull request #1601 from danswer-ai/prune-model-list
chatpage now checks for llm override for image uploads
2024-06-09 20:17:13 -04:00
hagen-danswer
3ec559ade2 added null inputs for other usages 2024-06-09 17:11:06 -07:00
hagen-danswer
4d0794f4f5 chatpage now checks for llm override for image uploads 2024-06-09 17:05:41 -07:00
hagen-danswer
64a042b94d cleaned up sharepoint connector (#1599)
* cleaned up sharepoint connector

* additional cleanup

* fixed dropbox connector string
2024-06-09 12:15:52 -07:00
Yuhong Sun
fa3a3d348c Precommit Fixes (#1596) 2024-06-09 00:44:36 -07:00
mattboret
a0e10ac9c2 Slack: add support to rephrase user message (#1528)
* Slack: add support to rephrase user message

* fix: handle rephrase error

* Update listener.py

---------

Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-06-08 18:11:32 -07:00
Art Matsak
e1ece4a27a Fix Helm chart run failures due to low resources (#1536)
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-06-08 18:05:44 -07:00
Bijay Regmi
260149b35a Feature/support all gpus (#1515)
* add `count` explicitely to ensure backwards compat

* fix main document URL
2024-06-08 17:45:26 -07:00
Alexander L
5f2737f9ee Add OAuth env vars to API Server deployment (#1500)
* Add oauth vars to the kubernetes api server deployment

* Add example google oauth id and secret to kubernetes secrets
2024-06-08 17:43:36 -07:00
Moncho Pena
e1d8b88318 Changed the vespa podLabels to work properly (#1594)
Vespa is not working because this configuration

As you can see in this Issue https://github.com/unoplat/vespa-helm-charts/issues/20

You have to use this podLabels to be accord with the other configuration.

vespa:
  podLabels:
    app: vespa
    app.kubernetes.io/instance: danswer <-------------
2024-06-08 17:40:27 -07:00
Joe Shindelar
fc5337d4db Set ignore_danswer_metadata=False when calling read_text_file in file connector. (#1501)
Fixes an issue where metadata specified in a #DANSWER_METADATA line in a file read by the file connector is ignored.
2024-06-08 17:39:18 -07:00
hagen-danswer
bd9335e832 disabled reindexing for dropbox and added warning (#1593) 2024-06-08 17:26:07 -07:00
hagen-danswer
cbc53fd500 moved methods to top and fixed logic errors 2024-06-07 20:34:24 -07:00
Nils
7a3c102c74 Added support for Sites.Selected permissions to the SharePoint Connector and enabled the selection of individual subfolders (#1583) 2024-06-07 15:47:17 -07:00
Weves
4274c114c5 Fix display for std markdown without a language 2024-06-07 15:22:06 -07:00
Weves
d56e6c495a Fix code block copy 2024-06-07 15:22:06 -07:00
Weves
c9160c705a Fix list of assistants in Assistants Modal 2024-06-07 14:21:57 -07:00
Chris Weaver
3bc46ef40e Fix slack bot with document set (#1588)
Also includes a Persona db layer refactor
2024-06-07 14:14:08 -07:00
hagen-danswer
ff59858327 final bugfixes 2024-06-07 13:19:48 -07:00
Yuhong Sun
643176407c Fix Dedupe (#1587) 2024-06-07 11:35:27 -07:00
Weves
eacfd8f33f Use errorHandlingFetcher 2024-06-07 11:25:48 -07:00
Weves
f6fb963419 Fix indexing status page crashing 2024-06-07 11:25:48 -07:00
hagen-danswer
16e023a8ce Revert "ran prettier"
This reverts commit 750c1df0bb.
2024-06-07 11:20:58 -07:00
hagen-danswer
b79820a309 Revert "Update init-letsencrypt.sh (#1380)"
This reverts commit 9e0b6aa531.
2024-06-07 11:05:57 -07:00
hagen-danswer
754b735174 Revert "fix gitlab-connector - wrong datetime format (#1559)"
This reverts commit 8dfba97c09.
2024-06-07 11:00:01 -07:00
hagen-danswer
58c305a539 Revert "Add Dropbox connector (#956)"
This reverts commit 914dc27a8f.
2024-06-07 10:58:37 -07:00
hagen-danswer
26bc785625 Revert "Update README.md with fixed Slack link round 2"
This reverts commit 0b6e85c26b.
2024-06-07 10:53:15 -07:00
Yuhong Sun
09da456bba Remove Redundant Dedupe Logic (#1577) 2024-06-06 14:36:41 -07:00
Yuhong Sun
da43bac456 Dedupe Flag (#1576) 2024-06-06 14:10:40 -07:00
Weves
adcbd354f4 Fix fast model update + slight reword on model selection 2024-06-05 18:43:37 -07:00
Weves
41fbaf5698 Fix prompt access 2024-06-05 18:43:13 -07:00
Hagen O'Neill
0b83396c4d disabled dropbox polling 2024-06-05 15:14:08 -07:00
Hagen O'Neill
785d7736ed extracted semantic identifier into its own method 2024-06-05 14:37:53 -07:00
Hagen O'Neill
9a9a879aee bugfixes 2024-06-05 14:30:34 -07:00
Hagen O'Neill
7b36f7aa4f chat_message: ChatMessage 2024-06-05 14:18:28 -07:00
Hagen O'Neill
8d74176348 completed code revision suggestions 2024-06-05 14:11:38 -07:00
Hagen O'Neill
713d325f42 fixed rebase issues 2024-06-04 21:25:16 -07:00
Hagen O'Neill
f34b26b3d0 seperated teams and sharepoint enviornment variables 2024-06-04 20:08:24 -07:00
Hagenoneill
a2349af65c added teams connector 2024-06-04 20:08:07 -07:00
Bill Yang
914dc27a8f Add Dropbox connector (#956)
* start dropbox connector

* add wip ui

* polish ui

* Fix some ci

* ignore types

* addressed, fixed, and tested all comments

* ran prettier

* ran mypy fixes

---------

Co-authored-by: Bill Yang <bill@Bills-MacBook-Pro.local>
Co-authored-by: hagen-danswer <hagen@danswer.ai>
2024-06-04 20:04:50 -07:00
Chris Weaver
0b6e85c26b Update README.md with fixed Slack link round 2 2024-06-04 20:04:50 -07:00
Chris Weaver
291a3f9ca0 Fix Slack link in README.md 2024-06-04 20:04:50 -07:00
NP
8dfba97c09 fix gitlab-connector - wrong datetime format (#1559) 2024-06-04 20:04:50 -07:00
Keiron Stoddart
9e0b6aa531 Update init-letsencrypt.sh (#1380)
Add ability to accept a `.ev.nginx` configuration that lists a subdomain.
2024-06-04 20:04:50 -07:00
Bill Yang
1fb47d70b3 Add Dropbox connector (#956)
* start dropbox connector

* add wip ui

* polish ui

* Fix some ci

* ignore types

* addressed, fixed, and tested all comments

* ran prettier

* ran mypy fixes

---------

Co-authored-by: Bill Yang <bill@Bills-MacBook-Pro.local>
Co-authored-by: hagen-danswer <hagen@danswer.ai>
2024-06-04 17:58:01 -07:00
Chris Weaver
25d40f8daa Update README.md with fixed Slack link round 2 2024-06-04 17:19:59 -07:00
Chris Weaver
154cdec0db Fix Slack link in README.md 2024-06-04 16:42:33 -07:00
Hagen O'Neill
f5deb37fde fixed mypy issues 2024-06-04 13:35:30 -07:00
Hagen O'Neill
750c1df0bb ran prettier 2024-06-04 13:23:02 -07:00
Hagen O'Neill
e608febb7f fixed messages nesting 2024-06-04 13:17:19 -07:00
hagen-danswer
c8e10282b2 Update connector.py
removed unused var
2024-06-04 15:49:05 -04:00
hagen-danswer
d7f66ba8c4 Update connector.py
changed raise output
2024-06-04 15:46:55 -04:00
NP
4d5a39628f fix gitlab-connector - wrong datetime format (#1559) 2024-06-04 10:41:19 -07:00
Keiron Stoddart
b6d0ecec4f Update init-letsencrypt.sh (#1380)
Add ability to accept a `.ev.nginx` configuration that lists a subdomain.
2024-06-04 10:38:01 -07:00
Hagen O'Neill
14a39e88e8 seperated teams and sharepoint enviornment variables 2024-06-04 09:45:10 -07:00
hagen-danswer
ea71b9830c Update types.ts
removed semi
2024-06-04 12:11:19 -04:00
hagen-danswer
a9834853ef Merge branch 'main' into add-teams-connector 2024-06-04 12:09:52 -04:00
hagen-danswer
8b10535c93 Merge pull request #1505 from mboret/fix/sharepoint-connector-missing-drive-items
fix sharepoint connector missing objects
2024-06-04 10:27:22 -04:00
pablodanswer
e1e1f036a7 Remove React Markdown for human messages (#1562)
* Remove React Markdown for human messages

* Update globals.css

* add formatting

* formatting

---------

Co-authored-by: “Pablo <“pablo@danswer.ai”>
2024-06-03 18:20:46 -07:00
Weves
0c642f25dd Add image generation for gpt-4o 2024-06-03 16:38:49 -07:00
Weves
3788041115 Fix missing end of answer for quotes processor 2024-06-03 16:37:27 -07:00
Weves
5a75470d23 Fix no-search assistants with DISABLE_LLM_CHOOSE_SEARCH enabled 2024-06-03 14:38:42 -07:00
Weves
81aada7c0f Add option to hide logout 2024-06-03 12:13:40 -07:00
Chris Weaver
e4a08c5546 Improve error msg in chat UI (#1557) 2024-06-02 19:53:04 -07:00
Weves
61d096533c Allow multiple files to be selected for file upload 2024-06-02 16:20:59 -07:00
Weves
0543abac9a Move to matrix builds 2024-06-02 15:57:53 -07:00
Weves
1d0ce49c05 Fix slowness due to hitting async Postgres driver pool limit 2024-06-01 20:18:14 -07:00
Weves
6e9d7acb9c Latency logging 2024-06-01 20:18:14 -07:00
Yuhong Sun
026652d827 Helm tuning (#1553) 2024-06-01 17:29:58 -07:00
Yuhong Sun
2363698c20 Consolidate Helm Charts (#1552) 2024-06-01 16:46:44 -07:00
Clay Rosenthal
0ea257d030 adding secrets to helm (#1541)
* adding secrets to helm

* incrementing chart version
2024-05-31 19:11:36 -07:00
Yuhong Sun
d141e637d0 Disable Search if User uploads files in Chat (#1550) 2024-05-31 19:07:56 -07:00
Yuhong Sun
4b53cb56a6 Fix File Type Migration (#1549) 2024-05-31 18:35:36 -07:00
Weves
b690ae05b4 Add assistant gallery 2024-05-29 21:05:31 -07:00
Matthieu Boret
fbdf882299 fix sharepoint connector missing objects 2024-05-29 10:13:41 +02:00
Yuhong Sun
44d57f1b53 Reenable force search (#1531) 2024-05-28 11:36:02 -07:00
Art Matsak
d2b58bdb40 Fix DISABLE_LLM_CHOOSE_SEARCH being ignored (#1523) 2024-05-28 08:39:02 -07:00
Yuhong Sun
aa98200bec SlackBot Disable AI option (#1527) 2024-05-28 01:35:57 -07:00
Yuhong Sun
32c37f8b17 Update Prompt (#1526) 2024-05-28 01:08:29 -07:00
Weves
008a91bff0 Partial fix for links not working 2024-05-27 17:31:10 -07:00
Weves
9a3613eb44 Fix unknown languages causing the chat to crash 2024-05-27 17:31:10 -07:00
Yuhong Sun
90d5b41901 Fix Citation Prompt Optionality (#1524) 2024-05-27 14:11:58 -07:00
Yuhong Sun
8688226003 Remove Tag Unique Constraint Bug (#1519) 2024-05-26 15:10:56 -07:00
Weves
97d058b8b2 Fix mypy for mediawiki tests 2024-05-25 17:16:47 -07:00
Weves
26ef5b897d Code highlighting 2024-05-25 17:12:12 -07:00
Weves
dfd233b985 Fix mypy for mediawiki connector 2024-05-25 13:04:23 -07:00
Weves
2dab9c576c Add Slack payload log 2024-05-24 19:24:17 -07:00
Weves
a9f5952510 Fix migration multiple head issue 2024-05-24 14:43:52 -07:00
Andrew Sansom
94018e83b0 Add MediaWiki and Wikipedia Connectors (#1250)
* Add MediaWikiConnector first draft

* Add MediaWikiConnector first draft

* Add MediaWikiConnector first draft

* Add MediaWikiConnector sections for each document

* Add MediaWikiConnector to constants and factory

* Integrate MediaWikiConnector with connectors page

* Unit tests + bug fixes

* Allow adding multiple mediawikiconnectors

* add wikipedia connector

* add wikipedia connector to factory

* improve docstrings of mediawiki connector backend

* improve docstrings of mediawiki connector backend

* move wikipedia and mediawiki icon locations in admin page

* undo accidental commit of modified docker compose yaml
2024-05-24 08:51:20 -07:00
Yuhong Sun
6e5d9f33d2 Fix Undeleteable Connectors (#1507) 2024-05-23 23:44:32 -07:00
Yuhong Sun
57452b1030 File Chat Upload (#1490)
Also includes minor UX improvements

---------

Co-authored-by: Weves <chrisweaver101@gmail.com>
2024-05-23 15:04:36 -07:00
Weves
d6ea92b185 Fix slack bot page for deleted assistant 2024-05-22 11:26:51 -07:00
Chris Weaver
88db722ea4 Chat UI small rework (#1504)
* Fat bar + configuration modal

* Remove header
2024-05-21 23:34:35 -07:00
Weves
ba872a0f7f Gracefully handle missing call parties for Gong connector 2024-05-21 11:12:28 -07:00
Weves
cc9cb202cd Add option to specify custom port for indexing model server 2024-05-21 11:08:10 -07:00
Weves
bbae63b769 Add migration for env variable based LLM providers 2024-05-20 12:47:27 -07:00
Weves
4413c0df36 Remove console.log statements 2024-05-18 01:01:54 -07:00
Weves
286dc7e04a Fix issue with first message send 2024-05-18 00:57:05 -07:00
Weves
0ee1bb2400 Chat history editing 2024-05-17 20:37:17 -07:00
Weves
a4f2693819 Allow images to be passed in on initial model setup without a reload 2024-05-17 17:31:24 -07:00
Weves
079fdee79f Update github actions 2024-05-17 17:15:17 -07:00
Weves
5c997c0322 Use swcMinify 2024-05-17 13:49:58 -07:00
Weves
b9bae9a011 Add explicit request for standalone dir in web Dockerfile 2024-05-17 10:38:19 -07:00
Weves
f76e5e06c1 Add swc 2024-05-17 10:25:32 -07:00
Weves
fa698cd8fd Fix auth check with API prefix enabled 2024-05-17 10:18:40 -07:00
Weves
125d1a3e1f Update npm 2024-05-17 01:28:21 -07:00
Weves
c934ed78f4 Upgrade FE packages 2024-05-16 22:13:02 -07:00
Weves
0369ddef58 Fix document set editor refresh 2024-05-16 14:42:28 -07:00
Weves
8c17c77ed9 Small fixes to LLM configuration screen 2024-05-14 22:51:28 -07:00
Weves
f087d3eac0 Fix sleep + handle duplicates 2024-05-14 17:44:33 -07:00
Weves
10232c7c54 Bump openai version 2024-05-14 17:28:50 -07:00
Weves
7928ea2fff Improve document set page UX 2024-05-14 15:43:26 -07:00
Weves
05bc6b1c65 Add pagination to document set syncing + improve speed 2024-05-14 15:43:26 -07:00
Weves
6f90308278 Add gpt-4o support 2024-05-14 13:32:00 -07:00
Weves
d0850a0288 Fix model names for enabled LLM providers 2024-05-14 13:32:00 -07:00
Weves
e573ba80b9 Revert black bump 2024-05-14 00:20:03 -07:00
Weves
5d1a81001e bump litellm 2024-05-13 18:29:33 -07:00
Weves
8b95395f34 Remove chunk limit of 20 2024-05-13 11:35:16 -07:00
Weves
e8b38d5f63 Hide search tool if no connectors exist 2024-05-13 01:22:37 -07:00
Weves
c2cdce4d49 Tool calling framework 2024-05-13 00:47:39 -07:00
Yuhong Sun
546815dc8c Consolidate File Processing (#1449) 2024-05-11 23:11:22 -07:00
Yuhong Sun
e89c81de76 Make User Promotion Demotion sync calls (#1448) 2024-05-11 16:25:56 -07:00
Ryan Gordon
5bf123da53 Added user demotion functionality. (#1444) 2024-05-11 15:59:47 -07:00
Yuhong Sun
7a02fd7ad7 Touchups from Contributor PRs (#1447) 2024-05-11 15:58:33 -07:00
Weves
4e759717ab Fix mypy 2024-05-11 12:36:49 -07:00
Weves
2e0be9f2da Folder support 2024-05-11 12:29:35 -07:00
mattboret
eb1b604b8c Allow to define custom conditions for the answer prompt answer validation (#1347)
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2024-05-11 10:43:05 -07:00
Shravan Vishwanathan
b8af38bb95 Refactor comment extraction in JIRA connector to handle nested content (#1329)
- Implement `extract_text_from_content` to parse nested text elements from comment bodies.
- Modify `_get_comment_strs` to use the new text extraction method, improving handling of various content structures.
2024-05-11 10:41:27 -07:00
dependabot[bot]
cfd9159b27 Bump aiohttp from 3.9.2 to 3.9.4 in /backend/requirements (#1349) 2024-05-11 10:33:08 -07:00
dependabot[bot]
52fd18d3bd Bump pydantic from 1.10.7 to 1.10.13 in /backend/requirements (#1377) 2024-05-11 10:32:31 -07:00
EdmundKorley
b72e6861e7 Add handling for unsupported block types in NotionConnector (#1231) 2024-05-11 10:32:02 -07:00
Davy Peter Braun
20a22e2bc0 fix(config): password auth to be url-encoded to avoid some deployment errors (#1422) 2024-05-11 10:29:51 -07:00
mattboret
a467999984 Add Slack feedback reminder (#1262)
---------

Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2024-05-11 10:27:09 -07:00
mattboret
1729f78930 set follow-up emoji on an invalid answer (#1263)
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2024-05-11 10:16:42 -07:00
dependabot[bot]
94a6db51c8 Bump black from 23.3.0 to 24.3.0 in /backend/requirements (#1236) 2024-05-11 10:14:52 -07:00
Matthew Holland
d729066194 Feature: Added File connector support for .docx, .pptx, .xlsx, .csv, .eml, and .epub file types (#1284) 2024-05-10 19:06:13 -07:00
Yuhong Sun
c6b45a550f Update Launch Json (#1443) 2024-05-10 16:52:10 -07:00
Yuhong Sun
34d05f4599 Mypy fixes for default configs (#1442) 2024-05-10 16:46:28 -07:00
Weves
7f1ffa3921 Add predefined feedback option 2024-05-09 19:11:17 -07:00
Weves
957d3625c2 Add autorefresh for document sets page 2024-05-09 14:33:55 -07:00
Weves
683addc390 Use Vespa Visit to handle long documents 2024-05-09 14:33:55 -07:00
Moshe Zada
2952b1dd96 Split slack messages up to 3K messages (#1379) 2024-05-09 11:05:02 -07:00
Moshe Zada
9e08ab98a0 show error when warmin up encoders (#1314) 2024-05-09 10:52:54 -07:00
Bijay Regmi
436806f2e3 add gpu support and README for documentation (#1398) 2024-05-09 10:51:37 -07:00
JayGhiya
ffea041398 Helm Chart Support (#1177) 2024-05-08 18:06:00 -07:00
Weves
eef54c8a86 Add non-ee fallback to fetch_versioned_implementation 2024-05-08 16:26:45 -07:00
Weves
7ed176b7cc Lock improvement 2024-05-08 16:11:56 -07:00
Weves
8cbf7c8097 Custom LLM provider fix 2024-05-07 17:17:38 -07:00
Weves
76a5f26fe1 Add display names to LLMProvider + allow multiple configs from the same provider 2024-05-07 16:26:04 -07:00
Weves
d6522426c9 Make access key and secret optional for AWS Bedrock 2024-05-07 01:11:09 -07:00
Yuhong Sun
45d5d7af4a Ingestion API Additions (#1424) 2024-05-06 21:53:35 -07:00
Yuhong Sun
01476a37c3 Encrypted Sensitive Fields (#1423) 2024-05-06 18:02:42 -07:00
Yuhong Sun
060a8d0aad Discourse Connector (#1420) 2024-05-05 16:54:08 -07:00
Yuhong Sun
03911de8b2 Danswerbot Stats (#1421) 2024-05-04 18:12:54 -07:00
Weves
1d3d84456a Small cleanup 2024-05-03 17:41:51 -07:00
Yuhong Sun
745f68241d Chat Folders Backend (#1419) 2024-05-03 16:37:18 -07:00
Mehmet Bektas
6cbfe1bcdb support for passing extra headers to litellm using env variables 2024-05-03 14:42:22 -07:00
mattboret
2ff207218e Confluence: Add config to index only active pages (#1348)
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2024-05-03 09:04:09 -07:00
Vikas Neha Ojha
143b50c519 Save correct document url from document360 (#1413) 2024-05-01 18:28:34 -07:00
Yuhong Sun
577c870acb Manage me endpoint key rename (#1410) 2024-04-30 23:27:33 -07:00
Yuhong Sun
7b94159115 Api key email display for manage/me endpoint (#1409) 2024-04-30 22:05:40 -07:00
Weves
96762cfe44 Misc UI improvments 2024-04-30 20:54:59 -07:00
Weves
b89e9127d7 Fix double message send 2024-04-30 13:10:40 -07:00
Weves
3fb68af405 Address rate limiting for Notion 2024-04-30 01:43:08 -07:00
Weves
5b93e786ad Add image upload capabilities 2024-04-29 01:53:34 -07:00
Davy Peter Braun
350e548b2d fix(gitignore): properly ignore celery-generated file 2024-04-28 11:23:07 -07:00
Weves
a2156dd836 Cancel scheduled indexing attempts on deletion request 2024-04-27 16:02:30 -07:00
Weves
a19290cb27 Address 'PGRES_TUPLES_OK and no message from the libpq' issues 2024-04-27 14:42:18 -07:00
Weves
f5b3333df3 Add UI-based LLM selection 2024-04-27 01:41:26 -07:00
Yuhong Sun
4c740060aa Fix Citation Sort Tiebreak (#1397) 2024-04-26 18:33:09 -07:00
Yuhong Sun
6f2d6fc5f2 Set message logging to debug (#1396) 2024-04-26 17:27:56 -07:00
Weves
73d94086d6 Fix compose file dependencies 2024-04-26 16:57:20 -07:00
Weves
9211334597 Fix document360 mypy issue 2024-04-26 00:49:00 -07:00
Weves
60d5abae3c Add token rate limit tables to MIT 2024-04-26 00:37:28 -07:00
Weves
85a8f9926c Fix credential form refresh 2024-04-25 17:46:21 -07:00
Vikas Neha Ojha
fe03747a1a Support to loop through all nested subcategories (#1382)
* Fix for parser failing if doc is blank

* Support to loop through all nested child categories
2024-04-25 17:27:30 -07:00
Yuhong Sun
ead7a80297 Fix Tag Integer Enums (#1388) 2024-04-25 17:20:35 -07:00
Yuhong Sun
d756ad34f3 Connectors Whitelist Fix (#1387) 2024-04-25 16:43:25 -07:00
Yuhong Sun
b4842e3a0d Rework Disabled Connector options to Whitelist instead (#1386) 2024-04-25 16:23:11 -07:00
Mehmet Bektas
ee6b8b7f50 properly yield non-streaming responses 2024-04-25 14:49:25 -07:00
Weves
648f2d06bf Add env variable to disable streaming for the DefaultMultiLLM class 2024-04-25 09:22:14 -07:00
Yuhong Sun
66d95690cb Disabled Connectors List (#1376) 2024-04-24 17:24:17 -07:00
Yuhong Sun
d2774f8979 k 2024-04-24 16:50:40 -07:00
Jignesh Solanki
0b1695f616 fix error: NextRouter was not mounted 2024-04-23 11:05:21 -07:00
Yuhong Sun
8b4e55ca82 Vespa Batch Size (#1368) 2024-04-22 23:45:54 -07:00
Yuhong Sun
7044cae0e2 Remove Nested DB Sessions (#1367) 2024-04-22 23:05:43 -07:00
Weves
832d40e490 Allow separate vespa config server host 2024-04-22 21:36:54 -07:00
Weves
df216eafa5 Assistant rework fixes 2024-04-22 13:16:13 -07:00
Weves
b407edbe49 Personal assistants 2024-04-21 21:06:16 -07:00
Yuhong Sun
f616b7e6e5 Web Connector to only allow Global IPs (#1357) 2024-04-20 15:24:00 -07:00
Yuhong Sun
7d51549b1b Remove Unused Volumes (#1356) 2024-04-20 10:27:41 -07:00
Yuhong Sun
4e9605e652 Only Log Index Attempt CC Pair Miscount (#1355) 2024-04-20 09:25:08 -07:00
Yuhong Sun
58545ccf3a Pre download models (#1354) 2024-04-19 21:52:53 -07:00
Yuhong Sun
87f304dfd0 Swap Index Early (#1353) 2024-04-19 10:38:15 -07:00
Weves
82b9cb4cc1 Add check to ensure auth is enabled for every endpoint unless explicitly whitelisted 2024-04-19 01:26:24 -07:00
Yuhong Sun
e361e92230 Healthcheck for model server (#1350) 2024-04-18 16:22:38 -07:00
Yuhong Sun
89ff07a96b Slack improvement 2024-04-17 21:38:00 -07:00
Yuhong Sun
be12e4fa64 Double Check Files/URLs (#1344) 2024-04-17 21:34:29 -07:00
Yuhong Sun
26f8d884e1 Allow NLTK Failures (#1340) 2024-04-17 21:34:29 -07:00
Alan Hagedorn
654c103f36 test 2024-04-15 12:20:04 -07:00
Yuhong Sun
599db71238 Permission Sync Models (#1334) 2024-04-14 23:29:32 -07:00
Yuhong Sun
1b41ec2b50 Remove Search Only Model (#1331) 2024-04-14 18:49:07 -07:00
Yuhong Sun
a17060af5a Provide Additional Context for Chunk Options in APIs (#1330) 2024-04-14 18:32:22 -07:00
Alan Hagedorn
b9b1e22fac Add name to API Key (#1327) 2024-04-13 12:36:46 -07:00
Yuhong Sun
d2d042a2cc Add Container Descriptions (#1326) 2024-04-13 12:10:46 -07:00
2pac
7810e931f3 fix: Consider Hubspot ticket notes body 2024-04-12 10:14:18 -07:00
2pac
6be5f51440 fix: Stop reading Notion pages on polling 2024-04-12 09:27:45 -07:00
Yuhong Sun
b59912884b Fix Model Server (#1320) 2024-04-10 23:13:22 -07:00
Yuhong Sun
f346c2fc86 Axero Link Fix (#1317) 2024-04-10 09:44:12 -07:00
Weves
714a3c867d Add option to skip Jira tickets with a certain label 2024-04-09 19:40:36 -07:00
Weves
31bfbe5d16 Fix chat sharing 2024-04-09 11:57:09 -07:00
Weves
dac4be62e0 Fix prod compose files 2024-04-08 16:01:56 -07:00
Yuhong Sun
b432d42205 Mypy Fix (#1308) 2024-04-08 00:52:14 -07:00
Yuhong Sun
2db906b7a2 Always Use Model Server (#1306) 2024-04-07 21:25:06 -07:00
Chris Weaver
795243283d Update README.md
Remove 'Danswer is the ChatGPT for teams'
2024-04-07 14:30:26 -07:00
Weves
eb367de44d Small token budget tweaks 2024-04-04 20:58:45 -07:00
Chris Weaver
447791b455 Token budgets (#1302)
---------

Co-authored-by: Nick Donohue <ndonohue@gmail.com>
2024-04-04 20:43:24 -07:00
Weves
7ba7224929 Allow seeding of chat sessions via POST 2024-04-04 12:59:39 -07:00
Yuhong Sun
33da86c802 Reranker Warning Log (#1299) 2024-04-04 06:59:48 -07:00
Yuhong Sun
58dc620c28 Add Check for Enabling Reranking (#1298) 2024-04-04 06:29:00 -07:00
Yuhong Sun
7298cc2835 Add verbose logging in case of query failure (#1297) 2024-04-04 05:30:23 -07:00
Yuhong Sun
4abf5f27a0 Axero Forums Support (#1287) 2024-04-04 03:51:10 -07:00
Weves
c7efce3bde Enable bedrock nodels in dev compose file 2024-04-03 23:21:10 -07:00
ThomaciousD
d329061f92 Fixed: Web connector - documents deleted when no internet #1161 (#1292)
* fixing check connection before scrape in web connector #1161

* reformat

---------

Co-authored-by: ThomaciousD <ThomaciousD@me>
2024-04-02 23:17:53 -07:00
Weves
b06b95dc3a Bump litellm version to support latest Anthropic models 2024-04-02 19:32:19 -07:00
Yuhong Sun
b0e0557d63 Update Contributing (#1288) 2024-04-01 22:41:40 -07:00
Weves
87019fc18e Notion 404 graceful error handling 2024-04-01 17:37:35 -07:00
Hagenoneill
818dfd0413 JUST get_all LOL 2024-04-01 14:39:37 -04:00
Hagenoneill
51b4e63218 organized documents by post instead of by channel 2024-04-01 14:31:26 -04:00
Weves
e82061a5ec Add support for specifying title via search params 2024-04-01 11:25:57 -07:00
Weves
0b0fc785a1 Fix fetch settings SS 2024-03-31 23:51:11 -07:00
Yuhong Sun
5b8cdd4eee Gpt-3.5-0125 Option (#1282) 2024-03-31 21:58:00 -07:00
Weves
a4869b727d Add ability to control available pages 2024-03-31 21:49:34 -07:00
Yuhong Sun
15f7b42e2b More Options for Search APIs (#1280) 2024-03-31 21:45:46 -07:00
Weves
32f55ddb8f URL-based chat seeding 2024-03-31 18:10:49 -07:00
Yuhong Sun
b8af1377ba Trivy Ignore Path (#1278) 2024-03-31 16:22:48 -07:00
Yuhong Sun
29f251660b Trivi Security Scan (#1277) 2024-03-31 15:32:22 -07:00
Yuhong Sun
783696a671 Axero Spaces (#1276) 2024-03-31 14:45:20 -07:00
Yuhong Sun
22477b1aca Chunker Gmail Issue Logging (#1274) 2024-03-30 00:18:57 -07:00
Weves
49acde0a8f URL-based chat sharing 2024-03-29 00:51:17 -07:00
Yuhong Sun
055cab2944 Public Slack Feedback Option (#1270) 2024-03-28 18:21:28 -07:00
Yuhong Sun
f46e65be92 Save One Shot Docs (#1269) 2024-03-28 12:48:01 -07:00
Yuhong Sun
d46b475410 Make porting from persistent volumes optional (#1268) 2024-03-28 11:26:11 -07:00
Yuhong Sun
fd69203be8 More accurate input token count for LLM (#1267) 2024-03-28 11:11:37 -07:00
Yuhong Sun
9757fbee90 Axero Connector (#1253)
---------

Co-authored-by: Weves <chrisweaver101@gmail.com>
2024-03-27 11:12:01 -07:00
Weves
5a967322fd Add ability to specify custom embedding models 2024-03-27 00:02:51 -07:00
Yuhong Sun
fbff5b5784 Save Retrieved Docs for One Shot Flows (#1259) 2024-03-26 22:48:40 -07:00
Weves
efc7d6e098 Add support for Github Flavored Markdown 2024-03-26 11:15:06 -07:00
Weves
f135ba9c0c Rework LLM answering flow 2024-03-25 13:34:03 -07:00
Weves
1ba74ee4df Refactor search pipeline 2024-03-25 13:34:03 -07:00
Yuhong Sun
7a861ecec4 Session Dependency for Chat Streaming (#1256) 2024-03-24 19:40:06 -07:00
Johannes Vass
3107edc921 Do not obtain DB session via Depends() (#1238)
Endpoints that use Depends(get_session) with a StreamingResponse have
the problem that Depends() releases the session again after the endpoint
function returns. At that point, the streaming response is not
finished yet but still holds a reference to the session and uses it.
However, there is no cleanup of the session after the answer stream
finishes which leads to the connections accumulating in state "idle in
transaction".

This was due to a breaking change in FastAPI 0.106.0
https://fastapi.tiangolo.com/release-notes/#01060

Co-authored-by: Johannes Vass <johannes.vass@cloudflight.io>
2024-03-24 19:31:07 -07:00
Yuhong Sun
49263ed146 Linting (#1255) 2024-03-24 19:07:57 -07:00
Matthew Holland
bd1df9649b Added check for internet connection (#1214) 2024-03-24 19:04:40 -07:00
Yuhong Sun
d3674b02e6 Add Llama2 Prompt Option (#1254) 2024-03-24 19:01:38 -07:00
Arslan
b28b3cfa37 Making searching docs as a default option (#904) 2024-03-24 18:54:38 -07:00
Arnaud Ritti
12e8fd852c feat: add Helm chart (#1186) 2024-03-24 18:37:27 -07:00
Weves
b8f767adf2 Fix persona client side error 2024-03-23 14:58:01 -07:00
Arthur De Kimpe
920d059da5 Bugfix: Support more Confluence Cloud hostname (*.jira.com) (#1244) 2024-03-23 14:04:26 -07:00
Yuhong Sun
aaa7b26a4d Remove All Enums from Postgres (#1247) 2024-03-22 23:01:05 -07:00
Weves
89e72783a7 Add some private Persona / Document Set stuff 2024-03-22 21:44:31 -07:00
Weves
ec48142a2d Move some of the user re-work stuff to MIT repo 2024-03-22 16:29:24 -07:00
Yuhong Sun
c28a95e367 Port File Store from Volume to PG (#1241) 2024-03-21 20:10:08 -07:00
Weves
8dbe5cbaa6 Add private Persona / Document Set migration 2024-03-21 19:57:51 -07:00
Yuhong Sun
d66b6c0559 Fix Tag Document Source Enum (#1240) 2024-03-21 12:27:56 -07:00
Weves
6a776648b3 Fix LLM max tokens 2024-03-19 18:02:28 -07:00
Yuhong Sun
3a6d32da7c Port KV Store to Postgres (#1227) 2024-03-19 16:21:22 -07:00
Yuhong Sun
fab2be510a Update README (#1226) 2024-03-19 00:22:40 -07:00
Weves
04ae8b1bf9 Increase SQLAlchemy pool size 2024-03-18 12:19:49 -07:00
Weves
4b9c4667f6 Increase connection pool size 2024-03-18 12:19:49 -07:00
Weves
8e89d00e32 Improve Confluence rate limit handling 2024-03-14 19:33:16 -07:00
Yuhong Sun
f45e2476d0 Sharepoint Logging (#1218) 2024-03-14 18:35:31 -07:00
Yuhong Sun
4036e7c6c6 Remove DocumentSource Enum from postgres (#1217) 2024-03-14 18:19:40 -07:00
Kevin Shi
2a8e53c94f Skip draft zendesk articles 2024-03-11 12:00:18 -07:00
Yuhong Sun
90a6e23546 Jira Version Option (#1205) 2024-03-10 12:30:47 -07:00
teocns
19c7ebdc26 connector: ensure absolute URL integrity (#1196) 2024-03-10 01:04:05 -08:00
George 
f292ede85a Jira connector improvements (#1199)
* Jira connector:
- Add feature exclude comments from particular users
- Add feature common and custom fields to jira tasks

Fix bug on web in ConfigDisplay.tsx

* Mypy fixes

* move to metadata field

* k

---------

Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-03-10 01:00:19 -08:00
Riccardo Schirone
0442513539 backend: remove duplicated word in ANSWER_VALIDITY_PROMPT 2024-03-09 16:14:39 -08:00
Yuhong Sun
db77d8d7cc File connector metadata (#1203) 2024-03-09 16:13:37 -08:00
Dan Brown
fd5294ed82 Fix broken link when specified in metadata (#1200) 2024-03-09 12:49:15 -08:00
Weves
e752e6d671 Fix bug with persona creation caused by starter messages 2024-03-08 00:57:14 -08:00
Yuhong Sun
3f1cd1ad12 Better description of the document index interfaces (#1188) 2024-03-06 00:07:12 -08:00
Chris Weaver
2ace03081c More fetch_versioned_implementation logging (#1187)
---------

Co-authored-by: Kevin Shi <kevinshisvf@gmail.com>
2024-03-05 09:46:02 -08:00
Weves
40c420f845 Fix disapearing chat sessions 2024-03-04 21:05:55 -08:00
Weves
7869f23e12 Improve slack flow 2024-03-04 19:22:46 -08:00
Kevin Shi
0b0665044f @lru_cache on fetch_versioned_implementation (#1178) 2024-03-04 14:50:51 -08:00
Chris Weaver
a7c820147e Add confluence rate limit handling (#1174) 2024-03-04 01:02:57 -08:00
Weves
563df1f952 Add env variable to allow people to control what clicking on New Chat does 2024-03-03 15:32:37 -08:00
Weves
a8cc3d5a07 Add ability to add starter messages 2024-03-03 14:23:34 -08:00
Yuhong Sun
9051ebfed7 Map to local network for EC2 deployments (#1167) 2024-03-03 13:30:44 -08:00
Weves
197392a95f Change AI Message name to Persona name 2024-03-02 23:28:24 -08:00
Yuhong Sun
81cb1ae399 Fix fail case when conf empty (#1163) 2024-03-02 18:10:37 -08:00
Yuhong Sun
f934e0a5ce Fix Ollama (#1162) 2024-03-02 17:35:41 -08:00
Weves
0366f3313a Fix gen ai model correctness check frequency 2024-03-01 21:59:18 -08:00
Weves
5df2f00e80 Upgrade nextjs version 2024-02-29 17:31:43 -08:00
Matthew Holland
ddc8640504 Skip indexing pages returning HTTP 4XX & 5XX codes 2024-02-29 16:54:26 -08:00
dependabot[bot]
5e7d740814 Bump aiohttp from 3.9.0rc0 to 3.9.2 in /backend/requirements
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.0rc0 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.0rc0...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-29 16:52:31 -08:00
Bijay Regmi
cfcc1db338 add back line 2024-02-29 16:44:41 -08:00
Bijay Regmi
05f0ed6414 fix #955 2024-02-29 16:44:41 -08:00
Weves
c65e862adc Add option to disable document cleanup 2024-02-29 16:33:03 -08:00
Thomas Ritaine
86215238fc fix(nginx): adjust config to correctly route /openapi.json and /api/* 2024-02-29 16:32:42 -08:00
Weves
9308ba02a1 Small bug with persona prompt selection 2024-02-29 15:15:44 -08:00
Weves
7b7561533f Fix early breakout causing us to not update ConnectorByCredentialPair 2024-02-29 13:54:37 -08:00
Weves
2331bf9b36 Add trace for db session creation 2024-02-29 13:54:11 -08:00
Yuhong Sun
31d3ae0e3e Fix Slack Document Only Persona (#1150) 2024-02-29 13:53:37 -08:00
Weves
10cb4ab1d2 Revert "Trace sqla get_session"
This reverts commit d07345c533.
2024-02-29 13:41:28 -08:00
Kevin Shi
d07345c533 Trace sqla get_session 2024-02-29 13:33:04 -08:00
Hagenoneill
73b063b66c added teams connector 2024-02-29 12:36:05 -05:00
Yuhong Sun
c7d228e292 Trim Chunks if LLM tokenizer differs from Embedding tokenizer (#1143) 2024-02-28 13:01:32 -08:00
Weves
cd198ba368 mypy fixes 2024-02-27 16:02:24 -08:00
Weves
3941111685 Update mypy version 2024-02-27 16:02:24 -08:00
Weves
78f2e07d23 Improve tag handling 2024-02-27 16:02:24 -08:00
Weves
02d81c4be5 Bump up packages + add ddtrace 2024-02-27 12:18:11 -08:00
robertoamoreno
59c416b777 Update Document360 Connector (#1113)
expects primary_owners to be a list of dictionaries, but it's being provided with a list of strings instead.

https://github.com/danswer-ai/danswer/issues/1111
2024-02-27 08:40:52 -08:00
Weves
b38be416b7 Make init-letsencrypt bring up everything 2024-02-25 22:10:34 -08:00
Yuhong Sun
6d5340ae07 Default Values (#1130) 2024-02-24 14:01:59 -08:00
Yuhong Sun
0f23effe7e Change Endpoint Assumption (#1127) 2024-02-23 20:19:23 -08:00
Weves
9dac17d3e1 Add support for overriding semantic_identifier for file connector 2024-02-23 14:53:24 -08:00
Yuhong Sun
eed45f8410 Update README.md 2024-02-23 10:29:07 -08:00
Yuhong Sun
0e3894f27b Bump Reqs (#1116) 2024-02-22 07:08:00 -08:00
Yuhong Sun
7874eadb00 Bump Requirements (#1114) 2024-02-21 23:15:20 -08:00
Yuhong Sun
cfad36b828 Update CONTRIBUTING.md 2024-02-21 17:44:13 -08:00
Lawyered
76092a5cf0 Improve Virtual Env Activation Instructions for Windows (#1082)
This update enhances the CONTRIBUTING.md guide by providing clear, separate instructions for activating the Python virtual environment on Windows, tailored for both Command Prompt and PowerShell users. Previously, the guide only included a generic command, which might not work across different shells without slight modifications. This change aims to make the setup process more accessible and straightforward for contributors using Windows, ensuring they have the correct commands for their specific environment. By reducing potential setup hurdles, we hope to streamline the initial contribution process for new developers.
2024-02-21 17:15:23 -08:00
Ikko Eltociear Ashimine
0e4677e3db Update connector.py
recieved -> received
2024-02-21 16:54:40 -08:00
Weves
3a9d5b4d90 Style change for the docs_removed_from_index field in the admin UI 2024-02-21 16:53:58 -08:00
Weves
4c7c1b468b Fix mypy errors 2024-02-21 16:53:58 -08:00
Yuhong Sun
7748f4df94 Auto-Detect if Better Default LLM available for OpenAI (#1106) 2024-02-21 16:10:22 -08:00
Johannes Vass
918bc385a2 Remove documents from index which are not returned by connector 2024-02-21 16:09:04 -08:00
Weves
cc69ba03a6 Make WelcomeModal only appear for admins + only if no connectors are setup 2024-02-20 08:28:58 -08:00
Weves
db21d82ea2 Bump tf version 2024-02-19 20:17:20 -08:00
Weves
e246ea9d3b Fix embedding model migration with existing index_attempts 2024-02-19 18:23:59 -08:00
Weves
4eaf2b1200 Add more logging to run-nginx.sh 2024-02-19 16:52:29 -08:00
Weves
9ede8b727d Fix init-letsencrypt script 2024-02-19 16:52:29 -08:00
Weves
d20d2b0970 Bump up fastapi-users version 2024-02-19 15:57:51 -08:00
Weves
6b3ad15c90 Fix persona id change 2024-02-19 15:20:45 -08:00
dependabot[bot]
aa6d86accd Bump python-multipart from 0.0.6 to 0.0.7 in /backend/requirements (#1075)
Bumps [python-multipart](https://github.com/andrew-d/python-multipart) from 0.0.6 to 0.0.7.
- [Release notes](https://github.com/andrew-d/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andrew-d/python-multipart/compare/0.0.6...0.0.7)

---
updated-dependencies:
- dependency-name: python-multipart
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 14:28:04 -08:00
dependabot[bot]
33c1cc491f Bump fastapi from 0.103.0 to 0.109.1 in /backend/requirements (#1043)
Bumps [fastapi](https://github.com/tiangolo/fastapi) from 0.103.0 to 0.109.1.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](https://github.com/tiangolo/fastapi/compare/0.103.0...0.109.1)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 14:27:39 -08:00
George
54fb7792c8 Add Jira Server connector form (#1046) 2024-02-19 14:17:36 -08:00
Yuhong Sun
c1d1651b43 Option to stop sync-ing primary index when building secondary one (#1096) 2024-02-18 22:53:26 -08:00
Yuhong Sun
15335dcd7d Standardize Chat Message Stream (#1098) 2024-02-18 22:48:28 -08:00
Yuhong Sun
31278fc52a k 2024-02-18 18:42:45 -08:00
Yuhong Sun
46ee5b2071 k 2024-02-18 18:42:45 -08:00
Weves
6059339e61 Improve initial flow 2024-02-18 18:40:44 -08:00
Weves
f9733f9870 Handle missing ri:userkey gracefully in Confluence connector 2024-02-18 15:20:45 -08:00
Weves
4d2959f1cc Fix 'View Full Trace' 2024-02-18 01:20:40 -08:00
Weves
61e2e68cf9 Improve FE for no-retrieval personas 2024-02-17 23:42:36 -08:00
Yuhong Sun
927e85319c Memory Reduction (#1092) 2024-02-17 21:20:34 -08:00
Yuhong Sun
d2ce3033a2 Enable Chat Without Connectors (#1090) 2024-02-17 21:12:44 -08:00
Yuhong Sun
6e8acdb20d Fix Remove Index Attempt (#1091) 2024-02-17 19:53:17 -08:00
Yuhong Sun
e505486ca4 Zendesk Tags (#1089) 2024-02-17 10:40:19 -08:00
Yuhong Sun
514e7f6e41 Kill Index Attempts for previous model (#1088) 2024-02-16 18:35:01 -08:00
Weves
269431cc9d Remove accidental console.log 2024-02-16 16:51:32 -08:00
Yuhong Sun
92500d448c Guru Error Logging (#1085) 2024-02-16 12:41:18 -08:00
Weves
10ad9babef Fix paused connectors 2024-02-15 15:46:32 -08:00
Weves
064d129592 Allow specifying Postgres User / Password / DB for dev compose file 2024-02-15 14:52:25 -08:00
Yuhong Sun
5fb688df02 Dont Always Warm Up Slackbot Model (#1080) 2024-02-13 22:28:46 -08:00
Yuhong Sun
23bf6ad4c7 Sample API Script (#1079) 2024-02-13 14:47:28 -08:00
Weves
aa7c811a9a Fix view full trace styling 2024-02-12 10:38:01 -08:00
Weves
3c2fb21c11 Fix source display for Persona intro 2024-02-11 22:09:33 -08:00
Yuhong Sun
1b55e617ad Offset Github by 3 hours to not lose updates (#1073) 2024-02-11 17:08:43 -08:00
Yuhong Sun
1c4f7fe7ef Pass Tags to LLM (#1071) 2024-02-11 15:58:42 -08:00
Weves
4629df06ef Fix force search when selecting docs to chat with + fix selected document de-selection on chat switch 2024-02-11 15:58:14 -08:00
Weves
7d11f5ffb8 Fix initial session creation + add Force Search 2024-02-11 13:57:08 -08:00
Weves
591e9831e7 Fix black for Notion connector 2024-02-10 21:09:14 -08:00
Eugene Yaroslavtsev
01bd1a84c4 fix: Notion connector now skips parsing ai_block blocks instead of erroring out (ai_blocks are currently unsupported by Notion API) 2024-02-10 21:01:19 -08:00
Weves
236fa947ee Add full exception trace to UI 2024-02-10 20:52:10 -08:00
Weves
6b5c20dd54 Don't get rid of answer if something goes wrong during quote generation 2024-02-10 19:10:22 -08:00
Weves
d5168deac8 Fix feedback display 2024-02-10 00:19:20 -08:00
Weves
37110df2de Increase session timeout default 2024-02-09 21:17:20 -08:00
Yuhong Sun
517c27c5ed Dev Script to Restart Containers (#1063) 2024-02-08 17:34:15 -08:00
Weves
81f53ff3d8 Fix run-nginx script when initiated from a windows machine 2024-02-08 15:19:25 -08:00
Yuhong Sun
1a1c91a7d9 Support Detection of LLM Max Context for Non OpenAI Models (#1060) 2024-02-08 15:15:58 -08:00
Yuhong Sun
cd8d8def1e Reformat Slack Message Display (#1056) 2024-02-08 14:37:46 -08:00
Yuhong Sun
5a056f1c0c Bump Vulnerable Libs (#1055) 2024-02-07 21:06:40 -08:00
Weves
0fb3fb8a1f Improve Google Drive connector naming 2024-02-07 01:25:47 -08:00
Yuhong Sun
35fe86e931 Option to only include Domain/Org wide docs (#1052) 2024-02-07 01:16:14 -08:00
Weves
4d6b3c8f08 FE to allow full re-indexing 2024-02-07 00:10:19 -08:00
Yuhong Sun
2362c2bdcc Reindex All Backend (#1049) 2024-02-06 23:07:24 -08:00
Weves
62000c1e46 Misc frontend fixes 2024-02-06 23:06:05 -08:00
Weves
c903d92fcc Fix issue with empty issues 2024-02-05 15:47:29 -08:00
Yuhong Sun
988e9aa682 Change Vespa Query to Post from Get (#1044) 2024-02-05 13:40:39 -08:00
Yuhong Sun
6768c24723 Default LLM Update (#1042) 2024-02-05 01:25:51 -08:00
Yuhong Sun
b3b88f05d3 Anonymous User Telem (#1041) 2024-02-04 13:41:19 -08:00
Weves
e54ce779fd Enable selection of long documents 2024-02-03 17:55:24 -08:00
Yuhong Sun
4c9709ae4a Chat History Docs sometimes wrongly ordered (#1039) 2024-02-03 13:25:24 -08:00
Itay
c435bf3854 CI: new pre-commit check (#1037) 2024-02-03 11:23:31 -08:00
Yuhong Sun
bb2b517124 Relari Test Script (#1033) 2024-02-02 09:50:48 -08:00
Szymon Planeta
dc2f4297b5 Add return contexts (#1018) 2024-02-01 22:22:22 -08:00
Yuhong Sun
0060a1dd58 Immediate Mark Resolved SlackBot Option and Respond to Bots Option (#1031) 2024-02-01 22:18:15 -08:00
Weves
29e74c0877 Fix nginx startup issues 2024-02-01 21:54:49 -08:00
Yuhong Sun
779c2829bf Update Base README (#1027) 2024-02-01 16:33:41 -08:00
Yuhong Sun
6a2b7514fe Miscount but it's not used (#1025) 2024-01-30 22:48:45 -08:00
Weves
8b9e6a91a4 Fix change model popup 2024-01-30 10:15:58 -08:00
Weves
b076c3d1ea Add regex support for Slack channels 2024-01-29 20:18:49 -08:00
Weves
d75ca0542a Support Slack channel regex 2024-01-29 20:18:49 -08:00
Yuhong Sun
ce12dd4a5a Fix Secondary Index Polling (#1020) 2024-01-29 19:34:25 -08:00
Weves
0a9b854667 Make final add conector modal slightly prettier 2024-01-29 18:12:13 -08:00
Weves
159453f8d7 Fix SwitchModelModal 2024-01-29 00:33:25 -08:00
Weves
2138c0b69d UI for model selection 2024-01-29 00:14:46 -08:00
Yuhong Sun
4b45164496 Background Index Attempt Creation (#1010) 2024-01-28 23:14:20 -08:00
Moshe Zada
c0c9c67534 Moshe.download nltk data on start (#1014) 2024-01-28 13:05:42 -08:00
Itay
a4053501d0 CI: adding prettier to pre-commit (#1009) 2024-01-28 13:03:39 -08:00
Moshe Zada
60a16fa46d Add space before new line in order to fix typo (#1013) 2024-01-28 13:00:53 -08:00
Itay
0ce992e22e CI: Run Python tests (#1001) 2024-01-28 12:59:51 -08:00
Bill Yang
35105f951b Add launch.json to gitignore (#961)
Co-authored-by: Bill Yang <bill@Bills-MacBook-Pro.local>
2024-01-28 12:57:33 -08:00
Weves
f1a5460739 Fix connected sources display 2024-01-27 12:00:24 -08:00
Weves
824677ca75 Add option to add citations to Personas + allow for more chunks if an LLM model override is specified 2024-01-27 10:16:17 -08:00
Yuhong Sun
cf4ede2130 Embedding Models Table (#1006) 2024-01-26 18:40:53 -08:00
Weves
81c33cc325 Fix import order 2024-01-25 17:26:34 -08:00
Weves
ec93ad9e6d Sharepoint fixes 2024-01-25 17:24:26 -08:00
Yuhong Sun
d0fa02c8dc Multiple Indices in Vespa (#1000) 2024-01-25 13:56:29 -08:00
Hagen O'Neill
d6d83e79f1 Added sharepoint connector (#963) 2024-01-25 13:16:10 -08:00
Chris Weaver
e94fd8b022 Remove un-needed imports (#999) 2024-01-25 12:10:19 -08:00
Yuhong Sun
92628357df Prevent Scheduling Multiple Queued Indexings (#997) 2024-01-24 16:31:29 -08:00
Yuhong Sun
50086526e2 Fix Vespa Title Overly Punished when Missing (#995) 2024-01-24 15:13:36 -08:00
Weves
7174ea3908 Fix hubspot connector 2024-01-24 15:10:08 -08:00
Jeremi Joslin
d07647c597 Fix typo in gmail test connector (#981) 2024-01-24 12:01:26 -08:00
Yuhong Sun
3a6712e3a0 Default Embedding Size (#993) 2024-01-24 12:00:25 -08:00
Yuhong Sun
bcc40224fa Embed Dim Env Var (#988) 2024-01-23 19:32:51 -08:00
Yuhong Sun
5d26290c5d Vespa Hyperparameter Changes (#986) 2024-01-23 17:57:19 -08:00
Yuhong Sun
9d1aa7401e Variable Embedding Dim for Vespa (#985) 2024-01-23 17:38:50 -08:00
Weves
c2b34f623c Handle github rate limiting + fix Slack rate limiting bug + change frozen indexing time to 3 hours 2024-01-23 00:37:33 -08:00
Itay
692fdb4597 Gmail Connector (#946)
---------

Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-01-22 16:25:10 -08:00
Weves
2c38033ef5 More latency logging + add limit/offset support 2024-01-21 18:52:55 -08:00
Weves
777521a437 Move delete to the right for consistency + disabled -> paused 2024-01-20 20:04:16 -08:00
Yuhong Sun
0e793e972b Slack Give Resolver Name (#973) 2024-01-20 20:01:23 -08:00
Yuhong Sun
a2a171999a Guru Metadata (#967) 2024-01-18 23:14:26 -08:00
Yuhong Sun
5504c9f289 GitLab Connector Logic Fixes (#966) 2024-01-18 16:44:07 -08:00
Yuhong Sun
5edc464c9a Fix GitLabs CI (#965) 2024-01-18 16:12:46 -08:00
Rutik Thakre
1670d923aa Gitlab Connector (#931) 2024-01-18 15:43:17 -08:00
Weves
1981a02473 Add tags to file connector 2024-01-18 12:12:11 -08:00
Yuhong Sun
4dc8eab014 Fix Linting (#962) 2024-01-17 22:49:37 -08:00
Weves
3a8d89afd3 Fix newlines in answers 2024-01-17 02:10:52 -08:00
Weves
fa879f7d7f Add new APIs specifically for GPTs 2024-01-15 22:35:58 -08:00
Yuhong Sun
f5be0cc2c0 Tiny Mail From Fix (#953) 2024-01-15 22:03:38 -08:00
Roman
621967d2b6 Add MAIL_FROM env variable (#949)
Co-authored-by: Roman Tyshyk <roman.tyshyk@711media.de>
2024-01-15 21:53:03 -08:00
Yuhong Sun
44905d36e5 Slack Rate Limit Options (#952) 2024-01-15 21:47:24 -08:00
mattboret
53add2c801 Add support to limit the number of Slack questions per minute (#908)
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2024-01-15 21:26:35 -08:00
Yuhong Sun
d17426749d Group support for Slack Followup (#951) 2024-01-15 19:21:06 -08:00
Chris Weaver
d099b931d8 Slack confirmation UI (#950) 2024-01-15 15:33:55 -08:00
Yuhong Sun
4cd9122ba5 Slack Followup Option (#948) 2024-01-15 14:26:20 -08:00
Yuhong Sun
22fb7c3352 Slack LLM Filter Enabled by Default (#943) 2024-01-13 17:37:51 -08:00
dependabot[bot]
4ff3bee605 Bump pycryptodome from 3.19.0 to 3.19.1 in /backend/requirements (#909)
Bumps [pycryptodome](https://github.com/Legrandin/pycryptodome) from 3.19.0 to 3.19.1.
- [Release notes](https://github.com/Legrandin/pycryptodome/releases)
- [Changelog](https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst)
- [Commits](https://github.com/Legrandin/pycryptodome/compare/v3.19.0...v3.19.1)

---
updated-dependencies:
- dependency-name: pycryptodome
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-13 15:42:37 -08:00
Yuhong Sun
7029bdb291 Remove unused doc endpoint (#942) 2024-01-13 15:22:23 -08:00
Yuhong Sun
cf4c3c57ed Log size limit to prevent more disk usage (#941) 2024-01-13 15:22:01 -08:00
Weves
1b6eb0a52f Add API Key table 2024-01-12 17:48:25 -08:00
Yuhong Sun
503a709e37 Update Slack Link (#936) 2024-01-11 17:42:26 -08:00
Yuhong Sun
0fd36c3120 Remove Sweep Issues (#935) 2024-01-11 12:31:38 -08:00
Yuhong Sun
8d12c7c202 Remove Sweep Conf (#934) 2024-01-11 11:38:17 -08:00
Sam Jakos
a4d5ac816e Add metadata file loader to ZIP file connector (#920) 2024-01-11 11:14:30 -08:00
Yuhong Sun
2a139fd529 Poll Connector Window Overlap (#930) 2024-01-11 11:10:01 -08:00
Weves
54347e100f Fix Notion recursive 2024-01-10 17:17:56 -08:00
Yuhong Sun
936e69bc2b Stop Streaming Pattern (#923) 2024-01-09 23:52:21 -08:00
Yuhong Sun
0056cdcf44 GitHub Base URL (#922) 2024-01-09 22:31:07 -08:00
Yuhong Sun
1791edec03 Fix Occasionally dropped Issues (#921) 2024-01-09 22:16:02 -08:00
Yuhong Sun
6201c1b585 Update CONTRIBUTING.md 2024-01-08 22:44:49 -08:00
Yuhong Sun
c8f34e3103 Update CONTRIBUTING.md 2024-01-08 22:44:11 -08:00
Weves
77b0d76f53 Small improvement to persona table 2024-01-08 19:17:39 -08:00
Weves
733626f277 Fix modal z scores 2024-01-08 18:26:36 -08:00
Weves
1da79c8627 Fix mypy errors on loopio connector 2024-01-08 16:19:07 -08:00
Weves
4e3d57b1b9 Disallow Google Drive credential delete if connectors exist 2024-01-08 15:57:18 -08:00
Weves
e473ad0412 Go back to localhost:3000 2024-01-08 15:35:52 -08:00
Weves
7efd3ba42f Add retries to Slack 2024-01-08 15:24:01 -08:00
mikewolfxyou
879e873310 Add deployment/data/nginx/app.conf to .gitignore (#912)
In order to prevent local development changes from appearing in git diff and being committed

Co-authored-by: Mike Zhiguo Zhang <zhiguo.zhang@real-digital.de>
2024-01-07 10:32:27 -08:00
Yuhong Sun
adc747e66c Explain Chat History Structure (#913) 2024-01-07 10:30:01 -08:00
Mike P. Sinn
a29c1ff05c Change WEB_DOMAIN default to 127.0.0.1 instead of localhost (#901)
Got it, thanks for the contribution! Neither of us (maintainers) use Windows so we weren't aware of this. Thanks a bunch for pointing it out and fixing it!
2024-01-05 23:50:57 -08:00
Yuhong Sun
49415e4615 Don't replace citations in code blocks (#911) 2024-01-05 23:32:28 -08:00
Sam Jakos
885e698d5d Add Loopio Connector (#850)
Looks good! I couldn't verify that it end-to-end because Loopio still hasn't granted me API access but the code looks good. Thanks a bunch for the contribution!

Would you be open to also writing the docs page for the setup? It's just adding an md file with some images or gifs:
https://github.com/danswer-ai/danswer-docs

I can provide a template branch if that would make it easier, just let me know 🙏
2024-01-05 23:32:10 -08:00
Weves
30983657ec Fix indexing of whitespace only 2024-01-05 19:35:38 -08:00
Yuhong Sun
6b6b3daab7 Reenable option to run Danswer without Gen AI (#906) 2024-01-03 18:31:16 -08:00
Chris Weaver
20441df4a4 Add Tag Filter UI + other UI cleanup (#905) 2024-01-02 11:30:36 -08:00
Yuhong Sun
d7141df5fc Metadata and Title Search (#903) 2024-01-02 11:25:50 -08:00
Yuhong Sun
615bb7b095 Update CONTRIBUTING.md 2024-01-01 18:07:50 -08:00
Yuhong Sun
e759718c3e Update CONTRIBUTING.md 2024-01-01 18:06:56 -08:00
Yuhong Sun
06d8d0e53c Update CONTRIBUTING.md 2024-01-01 18:06:17 -08:00
Weves
ae9b556876 Revamp new chat screen for chat UI 2023-12-30 18:13:24 -08:00
Chris Weaver
f883611e94 Add query editing in Chat UI (#899) 2023-12-30 12:46:48 -08:00
Yuhong Sun
13c536c033 Final Backend CVEs (#900) 2023-12-30 11:57:49 -08:00
Yuhong Sun
2e6be57880 Model Server CVEs (#898) 2023-12-29 21:14:08 -08:00
Weves
b352d83b8c Increase max upload size 2023-12-29 21:11:57 -08:00
Yuhong Sun
aa67768c79 CVEs continued (#889) 2023-12-29 20:42:16 -08:00
Weves
6004e540f3 Improve Vespa invalid char cleanup 2023-12-29 20:36:03 -08:00
eukub
64d2cea396 reduced redunduncy and changed concatenation of strings to f-strings 2023-12-29 00:35:04 -08:00
Weves
b5947a1c74 Add illegal char stripping to title field 2023-12-29 00:17:40 -08:00
Weves
cdf260b277 FIx chat refresh + add stop button 2023-12-28 23:33:41 -08:00
Weves
73483b5e09 Fix more auth disabled flakiness 2023-12-27 01:23:29 -08:00
Yuhong Sun
a6a444f365 Bump Python Version for security (#887) 2023-12-26 16:15:14 -08:00
Yuhong Sun
449a403c73 Automatic Security Scan (#886) 2023-12-26 14:41:23 -08:00
Yuhong Sun
4aebf824d2 Fix broken build SHA issue (#885) 2023-12-26 14:36:40 -08:00
Weves
26946198de Fix disabled auth 2023-12-26 12:51:58 -08:00
Yuhong Sun
e5035b8992 Move some util functions around (#883) 2023-12-26 00:38:29 -08:00
Weves
2e9af3086a Remove old comment 2023-12-25 21:36:54 -08:00
Weves
dab3ba8a41 Add support for basic auth on FE 2023-12-25 21:19:59 -08:00
Yuhong Sun
1e84b0daa4 Fix escape character handling in DanswerBot (#880) 2023-12-25 12:28:35 -08:00
Yuhong Sun
f4c8abdf21 Remove Extraneous Persona Config (#878) 2023-12-24 22:48:48 -08:00
sweep-ai[bot]
ccc5bb1e67 Configure Sweep (#875)
* Create sweep.yaml

* Create sweep template

* Update sweep.yaml

---------

Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com>
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2023-12-24 19:04:52 -08:00
Yuhong Sun
c3cf9134bb Telemetry Revision (#868) 2023-12-24 17:39:37 -08:00
Weves
0370b9b38d Stop copying local node_modules / .next dir into web docker image 2023-12-24 15:27:11 -08:00
Weves
95bf1c13ad Add http2 dependency 2023-12-24 14:49:31 -08:00
Yuhong Sun
00c1f93b12 Zendesk Tiny Cleanup (#867) 2023-12-23 16:39:15 -08:00
Yuhong Sun
a122510cee Zendesk Connector Metadata and small batch fix (#866) 2023-12-23 16:34:48 -08:00
Weves
dca4f7a72b Adding http2 support to Vespa 2023-12-23 16:23:24 -08:00
Weves
535dc265c5 Fix boost resetting on document update + fix refresh on re-index 2023-12-23 15:23:21 -08:00
Weves
56882367ba Fix migrations 2023-12-23 12:58:00 -08:00
Weves
d9fbd7ffe2 Add hiding + re-ordering to personas 2023-12-22 23:04:43 -08:00
Yuhong Sun
8b7d01fb3b Allow Duplicate Naming for CC-Pair (#862) 2023-12-22 23:03:44 -08:00
voarsh2
016a087b10 Refactor environment variable handling using ConfigMap for Kubernetes deployment (#515)
---------

Co-authored-by: Reese Jenner <reesevader@hotmail.co.uk>
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2023-12-22 21:33:36 -08:00
Sam Jakos
241b886976 fix: parse INDEX_BATCH_SIZE to an int (#858) 2023-12-22 13:03:21 -08:00
Yuhong Sun
ff014e4f5a Bump Transformer Version (#857) 2023-12-22 01:47:18 -08:00
Aliaksandr_С
0318507911 Indexing settings and logging improve (#821)
---------

Co-authored-by: Aliaksandr Chernak <aliaksandr_chernak@epam.com>
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2023-12-22 01:13:24 -08:00
Yuhong Sun
6650f01dc6 Multilingual Docs Updates (#856) 2023-12-22 00:26:00 -08:00
Yuhong Sun
962e3f726a Slack Feedback Message Tweaks (#855) 2023-12-21 20:52:11 -08:00
mattboret
25a73b9921 Slack bot improve source feedback (#827)
---------

Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2023-12-21 20:33:20 -08:00
Yuhong Sun
dc0b3672ac git push --set-upstream origin danswerbot-format (#854) 2023-12-21 18:46:30 -08:00
Yuhong Sun
c4ad03a65d Handle DanswerBot case where no updated at (#853) 2023-12-21 18:33:42 -08:00
mattboret
c6f354fd03 Add the latest document update to the Slack bot answer (#817)
* Add the latest source update to the Slack bot answer

* fix mypy errors

---------

Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2023-12-21 18:16:05 -08:00
Yuhong Sun
2f001c23b7 Confluence add tag to replaced names (#852) 2023-12-21 18:03:56 -08:00
mattboret
4d950aa60d Replace user id by the user display name in the exported Confluence page (#815)
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2023-12-21 17:52:28 -08:00
Yuhong Sun
56406a0b53 Bump Vespa to 8.277.17 (#851) 2023-12-21 17:23:27 -08:00
sam lockart
eb31c08461 Update Vespa to 8.267.29 (#812) 2023-12-21 17:18:16 -08:00
Weves
26f94c9890 Improve re-sizing 2023-12-21 10:03:03 -08:00
Weves
a9570e01e2 Make document sidebar scrollbar darker 2023-12-21 10:03:03 -08:00
Weves
402d83e167 Make it so docs without links aren't clickable in chat citations 2023-12-21 10:03:03 -08:00
Ikko Eltociear Ashimine
10dcd49fc8 Update CONTRIBUTING.md
Nagivate -> Navigate
2023-12-21 09:10:52 -08:00
Yuhong Sun
0fdad0e777 Update Demo Video 2023-12-20 19:05:23 -08:00
Weves
fab767d794 Fix persona document sets 2023-12-20 15:24:32 -08:00
Weves
7dd70ca4c0 Change danswer header link in chat page 2023-12-20 11:38:33 -08:00
Weves
370760eeee Fix editing deleted personas, editing personas with no prompts, and model selection 2023-12-19 14:42:13 -08:00
Weves
24a62cb33d Fix persona + prompt apis 2023-12-19 10:23:06 -08:00
Weves
9e4a4ddf39 Update search helper styling 2023-12-19 07:08:11 -08:00
Yuhong Sun
c281859509 Google Drive handle invalid PDFs (#838) 2023-12-18 23:39:45 -08:00
Yuhong Sun
2180a40bd3 Disable Chain of Thought for now (#837) 2023-12-18 21:44:47 -08:00
Weves
997f9c3191 Fix ccPair pages crashing 2023-12-17 23:28:26 -08:00
Weves
677c32ea79 Fix issue where a message that errors out creates a bad state 2023-12-17 23:28:26 -08:00
Yuhong Sun
edfc849652 Search more frequently (#834) 2023-12-17 22:45:46 -08:00
Yuhong Sun
9d296b623b Shield Update (#833) 2023-12-17 22:17:44 -08:00
Yuhong Sun
5957b888a5 DanswerBot Chat (#831) 2023-12-17 18:18:48 -08:00
Chris Weaver
c7a91b1819 Allow re-sizing of document sidebar + make central chat smaller on small screens (#832) 2023-12-17 18:17:43 -08:00
Weves
a099f8e296 Rework header a bit + remove assumption of all personas having a prompt 2023-12-14 23:06:39 -08:00
Weves
16c8969028 Chat UI 2023-12-14 22:18:42 -08:00
Yuhong Sun
65fde8f1b3 Chat Backend (#801) 2023-12-14 22:14:37 -08:00
Yuhong Sun
229db47e5d Update LLM Key Check Logic (#825) 2023-12-09 13:41:31 -08:00
Weves
2e3397feb0 Check for slack bot token changes every 60 seconds 2023-12-08 14:14:22 -08:00
Weves
d5658ce477 Persona enhancements 2023-12-07 14:29:37 -08:00
Weves
ddf3f99da4 Add support for global API prefix env variable 2023-12-07 12:42:17 -08:00
Weves
56785e6065 Add model choice to Persona 2023-12-07 00:20:42 -08:00
Weves
26e808d2a1 Fix welcome modal 2023-12-06 21:07:34 -08:00
Yuhong Sun
e3ac373f05 Make Default Fast LLM not identical to main LLM (#818) 2023-12-06 16:14:04 -08:00
Yuhong Sun
9e9a578921 Option to speed up DanswerBot by turning off chain of thought (#816) 2023-12-05 00:43:45 -08:00
Weves
f7172612e1 Allow persona usage for Slack bots 2023-12-04 19:20:03 -08:00
Yuhong Sun
5aa2de7a40 Fix Weak Models Concurrency Issue (#811) 2023-12-04 15:40:10 -08:00
Yuhong Sun
e0b87d9d4e Fix Weak Model Prompt (#810) 2023-12-04 15:02:08 -08:00
Weves
5607fdcddd Make Slack Bot setup UI more similar to Persona setup 2023-12-03 23:36:54 -08:00
Yuhong Sun
651de071f7 Improve English rephrasing for multilingual use case (#808) 2023-12-03 14:34:12 -08:00
John Bergvall
5629ca7d96 Copy SearchQuery model with updated attribute due to Config.frozen=True (#806)
Fixes the following TypeError:

api_server_1     |   File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
api_server_1     |     return await get_asynclib().run_sync_in_worker_thread(
api_server_1     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api_server_1     |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
api_server_1     |     return await future
api_server_1     |            ^^^^^^^^^^^^
api_server_1     |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
api_server_1     |     result = context.run(func, *args)
api_server_1     |              ^^^^^^^^^^^^^^^^^^^^^^^^
api_server_1     |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 53, in _next
api_server_1     |     return next(iterator)
api_server_1     |            ^^^^^^^^^^^^^^
api_server_1     |   File "/app/danswer/utils/timing.py", line 47, in wrapped_func
api_server_1     |     value = next(gen)
api_server_1     |             ^^^^^^^^^
api_server_1     |   File "/app/danswer/direct_qa/answer_question.py", line 243, in answer_qa_query_stream
api_server_1     |     top_chunks = cast(list[InferenceChunk], next(search_generator))
api_server_1     |                                             ^^^^^^^^^^^^^^^^^^^^^^
api_server_1     |   File "/app/danswer/search/search_runner.py", line 469, in full_chunk_search_generator
api_server_1     |     retrieved_chunks = retrieve_chunks(
api_server_1     |                        ^^^^^^^^^^^^^^^^
api_server_1     |   File "/app/danswer/search/search_runner.py", line 353, in retrieve_chunks
api_server_1     |     q_copy.query = rephrase
api_server_1     |     ^^^^^^^^^^^^
api_server_1     |   File "pydantic/main.py", line 359, in pydantic.main.BaseModel.__setattr__
api_server_1     | TypeError: "SearchQuery" is immutable and does not support item assignment
2023-12-03 13:47:11 -08:00
Yuhong Sun
bc403d97f2 Organize Prompts for Chat implementation (#807) 2023-12-03 13:27:11 -08:00
Weves
292c78b193 Always pull latest data when visiting main search page 2023-12-03 03:25:13 -08:00
Weves
ac35719038 FE improvements to make initial setup more intuitive 2023-12-02 16:40:44 -08:00
Yuhong Sun
02095e9281 Restructure APIs (#803) 2023-12-02 14:48:08 -08:00
Yuhong Sun
8954a04602 Reorder Tables for cleaner extending (#800) 2023-12-01 17:46:13 -08:00
Yuhong Sun
8020db9e9a Update connector interface with optional Owners information (#798) 2023-11-30 23:08:16 -08:00
Yuhong Sun
17c2f06338 Add more metadata options for File connector (#797) 2023-11-30 13:24:22 -08:00
Weves
9cff294a71 Increase retries for google drive connector 2023-11-30 03:03:26 -08:00
Weves
e983aaeca7 Add more logging on existing jobs 2023-11-30 02:58:37 -08:00
Weves
7ea774f35b Change in-progress status color 2023-11-29 20:57:45 -08:00
Weves
d1846823ba Associate a user with web/file connectors 2023-11-29 18:18:56 -08:00
Yuhong Sun
fda89ac810 Expert Recommendation Heuristic Only (#791) 2023-11-29 15:53:57 -08:00
Yuhong Sun
006fd4c438 Ingestion API now always updates regardless of document updated_at (#786) 2023-11-29 02:08:50 -08:00
Weves
9b7069a043 Disallow re-indexing for File connector 2023-11-29 02:01:11 -08:00
Weves
c64c25b2e1 Fix temp file deletion 2023-11-29 02:00:20 -08:00
Yuhong Sun
c2727a3f19 Custom OpenAI Model Server (#782) 2023-11-29 01:41:56 -08:00
Chris Weaver
37daf4f3e4 Remove AI Thoughts by default (#783)
- Removes AI Thoughts by default - only shows when validation fails
- Removes punctuation "words" from queries in addition to stopwords (Vespa ignores punctuation anyways)
- Fixes Vespa deletion script for larger doc counts
2023-11-29 01:00:53 -08:00
Yuhong Sun
fcb7f6fcc0 Accept files with character issues (#781) 2023-11-28 22:43:58 -08:00
Weves
429016d4a2 Fix zulip page 2023-11-28 16:28:51 -08:00
Chris Weaver
c83a450ec4 Remove personal connectors page(#779) 2023-11-28 16:11:42 -08:00
Yuhong Sun
187b94a7d8 Blurb Key Error (#778) 2023-11-28 16:09:33 -08:00
Weves
30225fd4c5 Fix filter hiding 2023-11-28 04:13:11 -08:00
Weves
a4f053fa5b Fix persona refresh 2023-11-28 02:53:18 -08:00
Weves
eab4fe83a0 Remove Slack bot personas from web UI 2023-11-28 02:53:18 -08:00
Chris Weaver
78d1ae0379 Customizable personas (#772)
Also includes a small fix to LLM filtering when combined with reranking
2023-11-28 00:57:48 -08:00
Yuhong Sun
87beb1f4d1 Log LLM details on server start (#773) 2023-11-27 21:32:48 -08:00
Yuhong Sun
05c2b7d34e Update LLM related Libs (#771) 2023-11-26 19:54:16 -08:00
Yuhong Sun
39d09a162a Danswer APIs Document Ingestion Endpoint (#716) 2023-11-26 19:09:22 -08:00
Yuhong Sun
d291fea020 Turn off Reranking for Streaming Flows (#770) 2023-11-26 16:45:23 -08:00
Yuhong Sun
2665bff78e Option to turn off LLM for eval script (#769) 2023-11-26 15:31:03 -08:00
Yuhong Sun
65d38ac8c3 Slack to respect LLM chunk filter settings (#768) 2023-11-26 01:06:12 -08:00
Yuhong Sun
8391d89bea Fix Indexing Concurrency (#767) 2023-11-25 21:40:36 -08:00
Yuhong Sun
ac2ed31726 Indexing Jobs to have shorter lived DB sessions (#766) 2023-11-24 21:38:16 -08:00
Chris Weaver
47f947b045 Use torch.multiprocessing + enable SimpleJobClient by default (#765) 2023-11-24 18:29:28 -08:00
dependabot[bot]
63b051b342 Bump sharp from 0.32.5 to 0.32.6 in /web
Bumps [sharp](https://github.com/lovell/sharp) from 0.32.5 to 0.32.6.
- [Release notes](https://github.com/lovell/sharp/releases)
- [Changelog](https://github.com/lovell/sharp/blob/main/docs/changelog.md)
- [Commits](https://github.com/lovell/sharp/compare/v0.32.5...v0.32.6)

---
updated-dependencies:
- dependency-name: sharp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-24 18:14:45 -08:00
Weves
a5729e2fa6 Add new model server env vars to the compose file 2023-11-24 00:12:04 -08:00
Weves
3cec854c5c Allow different model servers for different models / indexing jobs 2023-11-23 23:39:03 -08:00
Weves
26c6651a03 Improve LLM answer parsing 2023-11-23 15:03:35 -08:00
Yuhong Sun
13001ede98 Search Regression Test and Save/Load State updates (#761) 2023-11-23 00:00:30 -08:00
Yuhong Sun
fda377a2fa Regression Script for Search quality (#760) 2023-11-22 19:33:28 -08:00
Yuhong Sun
bdfb894507 Slack Role Override (#755) 2023-11-22 17:47:18 -08:00
Weves
35c3511daa Increase Vespa timeout 2023-11-22 01:42:59 -08:00
Chris Weaver
c1e19d0d93 Add selected docs in UI + rework the backend flow a bit(#754)
Changes the flow so that the selected docs are sent over in a separate packet rather than as part of the initial packet for the streaming QA endpoint.
2023-11-21 19:46:12 -08:00
mattboret
e78aefb408 Add script to analyse the sources selection (#721)
---------

Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2023-11-21 18:35:26 -08:00
Bryan Peterson
aa2e859b46 add missing dependencies in model_server dockerfile (#752)
Thanks for catching this! Super helpful!
2023-11-21 17:59:28 -08:00
Yuhong Sun
c0c8ae6c08 Minor Tuning for Filters (#753) 2023-11-21 15:47:58 -08:00
Weves
1225c663eb Add new env variable to compose file 2023-11-20 21:40:54 -08:00
Weves
e052d607d5 Add option to log Vespa timing info 2023-11-20 21:37:22 -08:00
Yuhong Sun
8e5e11a554 Add md files to File Connector (#749) 2023-11-20 19:56:06 -08:00
Yuhong Sun
57f0323f52 NLP Model Warmup Reworked (#748) 2023-11-20 17:28:23 -08:00
Weves
6e9f31d1e9 Fix ResourceLogger blocking main thread 2023-11-20 16:46:18 -08:00
Weves
eeb844e35e Fix bug with Google Drive shortcut error case 2023-11-20 16:34:07 -08:00
Sid Ravinutala
d6a84ab413 fix for url parsing google site 2023-11-20 16:08:43 -08:00
Weves
68160d49dd Small mods to enable deployment on AWS EKS 2023-11-20 01:42:48 -08:00
Yuhong Sun
0cc3d65839 Add option to run a faster/cheaper LLM for secondary flows (#742) 2023-11-19 17:48:42 -08:00
Weves
df37387146 Fix a couple bugs with google sites link finding 2023-11-19 15:35:54 -08:00
Yuhong Sun
f72825cd46 Provide Metadata to the LLM (#740) 2023-11-19 12:28:45 -08:00
Yuhong Sun
6fb07d20cc Multilingual Query Expansion (#737) 2023-11-19 10:55:55 -08:00
Chris Weaver
b258ec1bed Adjust checks for removal from existing_jobs dict + add more logging + only one scheduled job for a connector at a time (#739) 2023-11-19 02:03:17 -08:00
Yuhong Sun
4fd55b8928 Fix GPT4All (#738) 2023-11-18 21:21:02 -08:00
Yuhong Sun
b3ea53fa46 Fix Build Version (#736) 2023-11-18 17:16:25 -08:00
Yuhong Sun
fa0d19cc8c LLM Chunk Filtering (#735) 2023-11-18 17:12:24 -08:00
Weves
d5916e420c Fix duplicated query event for 'answer_qa_query_stream' and missing llm_answer in 'answer_qa_query' 2023-11-17 21:10:23 -08:00
Weves
39b912befd Enable show GPT answer option immediately 2023-11-17 17:08:38 -08:00
Weves
37c5f24d91 Fix logout redirect 2023-11-17 16:43:24 -08:00
Weves
ae72cd56f8 Add a bit more logging in indexing pipeline 2023-11-16 12:00:19 -08:00
Yuhong Sun
be5ef77896 Optional Anonymous Telemetry (#727) 2023-11-16 09:22:36 -08:00
Weves
0ed8f14015 Improve Vespa filtering performance 2023-11-15 14:30:12 -08:00
Weves
a03e443541 Add root_page_id option for Notion connector 2023-11-15 12:46:41 -08:00
Weves
4935459798 Fix hover being transparent 2023-11-15 11:52:40 -08:00
Weves
efb52873dd Prettier fix 2023-11-14 22:22:42 -08:00
Bradley
442f7595cc Added connector configuration link and external link icon to web connector page. 2023-11-14 22:19:00 -08:00
Weves
81cbcbb403 Fix connector deletion bug 2023-11-14 09:07:59 -08:00
Weves
0a0e672b35 Fix no letsencrypt 2023-11-13 14:32:51 -08:00
Yuhong Sun
69644b266e Hybrid Search Alpha Parameter (#714) 2023-11-09 17:11:10 -08:00
Yuhong Sun
5a4820c55f Skip Index on Docs with no newer updated at (#713) 2023-11-09 16:27:32 -08:00
Weves
a5d69bb392 Add back end time to Gong 2023-11-09 14:03:46 -08:00
Weves
23ee45c033 Enhance document explorer 2023-11-09 00:58:51 -08:00
Yuhong Sun
31bfd015ae Request Tracker Connector (#709)
Contributed by Evan! Thanks for the contribution!

- Minor linting and rebasing done by Yuhong, everything else from Evan

---------

Co-authored-by: Evan Sarmiento <e.sarmiento@soax.com>
Co-authored-by: Evan <esarmien@fas.harvard.edu>
2023-11-07 16:55:10 -08:00
Yuhong Sun
0125d8a0f6 Source Filter Extraction (#708) 2023-11-07 14:21:04 -08:00
Yuhong Sun
4f64444f0f Fix Version from Tag not picked up (#705) 2023-11-06 20:01:20 -08:00
Weves
abf9cc3248 Add timeout to all Notion calls 2023-11-06 19:29:42 -08:00
Chris Weaver
f5bf2e6374 Fix experimental checkpointing + move check for disabled connector to the start of the batch (#703) 2023-11-06 17:14:31 -08:00
Yuhong Sun
24b3b1fa9e Fix GitHub Actions Naming (#702) 2023-11-06 16:40:49 -08:00
Yuhong Sun
7433dddac3 Model Server (#695)
Provides the ability to pull out the NLP models into a separate model server which can then be hosted on a GPU instance if desired.
2023-11-06 16:36:09 -08:00
Weves
fe938b6fc6 Add experimental checkpointing 2023-11-04 14:51:28 -07:00
dependabot[bot]
2db029672b Bump pypdf from 3.16.4 to 3.17.0 in /backend/requirements (#667)
Bumps [pypdf](https://github.com/py-pdf/pypdf) from 3.16.4 to 3.17.0.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/3.16.4...3.17.0)

---
updated-dependencies:
- dependency-name: pypdf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-03 18:54:29 -07:00
Yuhong Sun
602f9c4a0a Default Version to 0.2-dev (#690) 2023-11-03 18:37:01 -07:00
Bradley
551705ad62 Implemented Danswer versioning system. (#649)
* Web & API server versioning system. Displayed on UI.

* Remove some debugging code.

* Integrated backend version into GitHub Action & Docker build workflow using env variables.

* Fixed web container environment variable name.

* Revise Dockerfiles for GitHub Actions workflow.

* Added system information page to admin panel with version info. Updated github workflows to include tagged version, and corresponding changes in the dockerfiles and codebases for web&backend to use env variables if present. Changed to 'dev' naming scheme if no env var is present to indicate local setup. Removed version from admin panel header.

* Added missing systeminfo dir to remote repo.
2023-11-03 18:02:39 -07:00
Weves
d9581ce0ae Fix Notion recursive search for non-shared database 2023-11-03 15:46:23 -07:00
Yuhong Sun
e27800d501 Formatting 2023-11-02 23:31:19 -07:00
Yuhong Sun
927dffecb5 Prompt Layer Rework (#688) 2023-11-02 23:26:47 -07:00
Weves
68b23b6339 Enable database reading in recursive notion crawl 2023-11-02 23:14:54 -07:00
Weves
174f54473e Fix notion recursive search for blocks with children 2023-11-02 22:21:55 -07:00
Weves
329824ab22 Address issue with links for Google Sites connector 2023-11-02 22:01:08 -07:00
Yuhong Sun
b0f76b97ef Guru and Productboard Time Updated (#683) 2023-11-02 14:27:06 -07:00
Weves
80eedebe86 Add env variables to dev docker compose file 2023-11-01 22:00:32 -07:00
Weves
e8786e1a20 Small formatting fixes 2023-11-01 21:46:23 -07:00
Bryan Peterson
44e3dcb19f support for zendesk help center (#661) 2023-11-01 21:11:56 -07:00
Weves
e8f778ccb5 Improve index attempt display 2023-11-01 18:33:54 -07:00
Weves
d9adee168b Add simple job client to try and get rid of some of the flakiness / weirdness that we are seeing with Dask 2023-11-01 17:43:58 -07:00
Yuhong Sun
73b653d324 More Cleanup and Deduplication (#675) 2023-11-01 16:03:48 -07:00
Weves
9cd0c197e7 Fix frozen jobs 2023-11-01 14:30:51 -07:00
Weves
0b07d615b1 Add env variable to control Gong start time 2023-11-01 14:09:13 -07:00
Weves
5c9c70dffb Remove more native enums 2023-11-01 12:51:33 -07:00
Yuhong Sun
61c9343a7e Clean Up Duplicate Code (#670) 2023-10-31 23:25:26 -07:00
Yuhong Sun
53353f9b62 Custom Model Server Note (#668) 2023-10-31 19:05:38 -07:00
Yuhong Sun
fbf7c642a3 Reworking the LLM layer (#666) 2023-10-31 18:22:42 -07:00
meherhendi
d9e5795b36 Removing unused codefrom gdrive connector
Signed-off-by: meherhendi <meherhendi0@gmail.com>
2023-10-31 14:48:39 -07:00
meherhendi
acb60f67e1 Adding credential.is_admin to fix Gdrive indexign bug 2023-10-31 14:48:39 -07:00
meherhendi
4990aacc0d google drive step3 indexing not starting bug fix 2023-10-31 14:48:39 -07:00
Yuhong Sun
947d4d0a2e Pin Litellm Version (#665) 2023-10-31 12:09:39 -07:00
dependabot[bot]
d7a90aeb2b Bump langchain from 0.0.312 to 0.0.325 in /backend/requirements (#658)
Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.0.312 to 0.0.325.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/v0.0.312...v0.0.325)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-31 12:05:55 -07:00
Krish Dholakia
ee0d092dcc Add LiteLLM Support - Anthropic, Bedrock, Huggingface, TogetherAI, Replicate, etc. (#510)
Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
2023-10-31 12:01:15 -07:00
Sam Jakos
c6663d83d5 Fix nginx conf in docker-compose.prod 2023-10-31 08:50:52 -07:00
Yuhong Sun
0618b59de6 Fix Indexing Frozen (#660) 2023-10-30 20:49:39 -07:00
Weves
517a539d7e Make indexing jobs use more cores again 2023-10-30 18:50:40 -07:00
Weves
a1da4dfac6 Fix document-search endpoint with auth disabled 2023-10-30 00:46:55 -07:00
Yuhong Sun
e968e1d14b Fix Rare Vespa Document ID Issue (#656) 2023-10-30 00:06:51 -07:00
Chris Weaver
8215a7859a Small UI fixes (#655) 2023-10-29 23:17:25 -07:00
Yuhong Sun
37bba3dbe9 Gong to accept workspace IDs (#654) 2023-10-29 22:46:01 -07:00
Yuhong Sun
52c0d6e68b Hybrid Search (#653) 2023-10-29 22:18:00 -07:00
Weves
08909b40b0 Add rate limiting wrapper + add to Document360 2023-10-29 18:00:17 -07:00
Yuhong Sun
64ebaf2dda Pin Vespa Version (#651) 2023-10-29 14:30:33 -07:00
Weves
815c30c9d0 Fix jobs erroring while waiting on queue 2023-10-29 01:35:04 -07:00
Yuhong Sun
57ecab0098 Fix Json Output Issue and Fix miscount of new docs per Index Attempt (#641) 2023-10-29 00:34:28 -07:00
Yuhong Sun
26b491fb0c Prep for Hybrid Search (#648) 2023-10-29 00:13:21 -07:00
Weves
bfa338e142 Adjust time_updated assignment + increase frozen timeout to 3hrs 2023-10-28 22:27:18 -07:00
Weves
e744c6b75a Re-style cc pair status table 2023-10-28 21:11:01 -07:00
Yuhong Sun
7d6a41243c Fix Use Keyword Default (#646) 2023-10-28 14:57:24 -07:00
Weves
25814d7a23 Go back to hiding filters if screen width is too small 2023-10-28 14:52:07 -07:00
Weves
59b16ac320 Upgrade to latest NextJS version 2023-10-28 14:52:07 -07:00
Yuhong Sun
11d96b2807 Rename DanswerBot (#644) 2023-10-28 14:41:36 -07:00
Yuhong Sun
fe117513b0 Reorganize and Cleanup for Hybrid Search (#643) 2023-10-28 14:24:28 -07:00
Chris Weaver
fcce2b5a60 Individual connector page (#640) 2023-10-27 21:32:18 -07:00
Weves
ad6ea1679a Sleep for a little before starting nginx 2023-10-27 16:40:33 -07:00
Yuhong Sun
fad311282b Remove extra missed Enum (#638) 2023-10-27 13:58:20 -07:00
Yuhong Sun
ca0f186b0e Remove all in-postgres Enums (#637) 2023-10-27 12:13:57 -07:00
Weves
c9edc2711c Add basic retries to Vespa insert calls 2023-10-26 14:20:38 -07:00
Weves
dcbb7b85d9 Fix null author for Confluence connector 2023-10-26 13:18:59 -07:00
Yuhong Sun
2df9f4d7fc Confluence Author Optional (#634) 2023-10-26 12:07:05 -07:00
Yuhong Sun
7bc34ce182 Fix Container Name (#633) 2023-10-25 23:22:24 -07:00
Chris Weaver
76275b29d4 Adjust the way LLM class is instantiated + fix issue where .env file GEN_AI_API_KEY wasn't being used (#630) 2023-10-25 22:33:18 -07:00
Yuhong Sun
604e511c09 Alternative solution to up the number of threads for torch (#632) 2023-10-25 22:30:57 -07:00
Yuhong Sun
379e71160a Confluence Data Center Edge Cases (#631) 2023-10-25 21:52:07 -07:00
Chris Weaver
a8b7155b5e Add support for non-letsencrypt-based https in docker compose setup (#628) 2023-10-25 20:35:47 -07:00
Yuhong Sun
9a51745fc9 Updated Contributing for Celery (#629) 2023-10-25 18:26:02 -07:00
Weves
fbb05e630d Add more retries in Google Drive connector 2023-10-24 20:24:45 -07:00
Chris Weaver
ef2b445201 Support Confluence data center + allow for specifying labels to ignore (#624) 2023-10-24 17:40:42 -07:00
Yuhong Sun
17bd68be4c Wrap errors in an object instead of plain dict (#623) 2023-10-24 16:07:45 -07:00
Yuhong Sun
890eb7901e Capping negative boost at 0.5 (#622) 2023-10-24 15:08:27 -07:00
Chris Weaver
0a6c2afb8a Notion extra logging + small improvements (#621) 2023-10-24 15:00:50 -07:00
meherhendi
7ffba2aa60 Google Drive shared files bug fix 2023-10-23 23:51:35 -07:00
Weves
816ec5e3ca Graceful failure for pages without a navbar links in Google Sites connector 2023-10-23 23:40:00 -07:00
Weves
3554e29b8d Add updated_at to UI + add time range selector 2023-10-23 23:32:16 -07:00
Yuhong Sun
88eaae62d9 Rework Boost and Time Decay Calculations for No-Reranker flow (#618) 2023-10-23 23:25:06 -07:00
Weves
a014cb7792 Fix admin search 2023-10-23 00:25:50 -07:00
Chris Weaver
89807c8c05 Fix deletion status display + add celery util + fix seg faults (#615) 2023-10-22 19:41:29 -07:00
Yuhong Sun
8403b94722 Default Personas to have Document Sets (#614) 2023-10-22 16:57:16 -07:00
Weves
4fa96788f6 Don't try to decrypt when no pw is specified 2023-10-22 15:34:23 -07:00
Yuhong Sun
e279918f95 Introduce Time Filters (#610) 2023-10-22 15:06:52 -07:00
Weves
8e3258981e Adjust default Tremor color 2023-10-21 13:16:29 -07:00
Weves
b14b220d89 Remove double import 2023-10-21 00:52:28 -07:00
Buglover
cc5d27bff7 Update connector.py
fix issue #606
2023-10-21 00:42:31 -07:00
Yuhong Sun
5ddc9b34ab Add Document UpdatedAt times for most connectors (#605) 2023-10-20 17:03:28 -07:00
Weves
a7099a1917 Add retrieved_document_ids to QueryEvent 2023-10-20 12:43:15 -07:00
Weves
47ab273353 Add tremor 2023-10-20 11:05:34 -07:00
Yuhong Sun
7be3730038 Fix LLM error reporting (#600) 2023-10-19 18:20:24 -07:00
Yuhong Sun
f6982b03b6 Handle PDF parse failures gracefully (#599) 2023-10-19 17:46:13 -07:00
Chris Weaver
76f1f17710 Fix hidden documents (#598) 2023-10-19 17:38:11 -07:00
Yuhong Sun
bc1de6562d Fix Explorer (#597) 2023-10-19 17:33:49 -07:00
dependabot[bot]
93d4eef61d Bump @babel/traverse from 7.22.11 to 7.23.2 in /web (#591)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.11 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 17:12:12 -07:00
dependabot[bot]
4ffbdbb8b0 Bump langchain from 0.0.308 to 0.0.312 in /backend/requirements (#551)
Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.0.308 to 0.0.312.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/v0.0.308...v0.0.312)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 17:11:42 -07:00
meherhendi
764aab3e53 increasing OpenAi api key verification timeout (#587) 2023-10-19 17:09:49 -07:00
Yuhong Sun
7c34744655 Use shared PDF utility function to not error on encrypted PDFs (#596) 2023-10-19 17:01:55 -07:00
Yuhong Sun
2037e11495 Replace PyPDF2 with pypdf (#595) 2023-10-19 16:12:31 -07:00
Yuhong Sun
6a449f1fb1 Introduce Recency Bias (#592) 2023-10-19 12:54:35 -07:00
Yuhong Sun
d9076a6ff6 Use strict=False for Parsing LLM Jsons (#594) 2023-10-19 12:28:16 -07:00
Chris Weaver
1bd76f528f Document explorer admin page (#590) 2023-10-18 18:41:39 -07:00
Yuhong Sun
a5d2759fbc Recreate Tables from HTML (#588) 2023-10-18 11:16:40 -07:00
Yuhong Sun
022f59e5b2 Fix Slack Link Parsing (#589) 2023-10-18 11:14:12 -07:00
Weves
5bf998219e Add missing arg 2023-10-17 20:19:33 -07:00
Chris Weaver
5da81a3d0d Add hiding of documents to feedback page (#585) 2023-10-17 20:06:12 -07:00
Yuhong Sun
e73739547a Fix Kubernetes Templates (#584) 2023-10-17 13:32:00 -07:00
Chris Weaver
e519dfc849 Torch more cpus (#583) 2023-10-17 09:53:20 -07:00
Yuhong Sun
bf5844578c Personas to have option to be aware of current date and time (#582) 2023-10-16 23:42:39 -07:00
Chris Weaver
37e9ccf864 Make docs indexed cnt more accurate (#579) 2023-10-16 20:18:19 -07:00
Yuhong Sun
bb9a18b22c Slack Connector to not Index Bots (#581) 2023-10-16 20:08:03 -07:00
Yuhong Sun
b5982c10c3 Celery Beat (#575) 2023-10-16 14:59:42 -07:00
Chris Weaver
a7ddb22e50 Only log vespa error on second attempt (#578) 2023-10-15 21:36:25 -07:00
Yuhong Sun
595f61ea3a Add Retrieval to Chat History (#577) 2023-10-15 13:40:07 -07:00
Weves
d2f7dff464 Add max upload size to HTTPS NGINX listener 2023-10-15 12:52:13 -07:00
Weves
ae0dbfadc6 Fix Google Drive Connector when using OAuth 2023-10-15 00:08:19 -07:00
Yuhong Sun
38d516cc7a Update Danswer Docs Pointers (#573) 2023-10-14 12:12:37 -07:00
Yuhong Sun
7f029a0304 Reorder Imports (#572) 2023-10-14 10:12:27 -07:00
Yuhong Sun
2c867b5143 Fix Slack premature Reacts and Notification (#571) 2023-10-13 22:52:21 -07:00
Yuhong Sun
af510cc965 API support for Chat to have citations (#569) 2023-10-13 17:38:25 -07:00
Weves
f0337d2eba Auto-delete unlinked connectors on creation of a new connector with the same name 2023-10-13 13:40:37 -07:00
Weves
17e00b186e Add back Gong connector to sidebar + fix formatting issues 2023-10-13 12:10:51 -07:00
Yuhong Sun
dbf59d2acc Dockerfile to build smaller Images (#567) 2023-10-12 13:08:47 -07:00
Weves
41964031bf Fix FE build 2023-10-12 11:05:43 -07:00
Yuhong Sun
a7578c9707 Fix SlackBot still tagging groups (#564) 2023-10-12 00:32:43 -07:00
Yuhong Sun
51490b5cd9 Favor tz aware objects (#562) 2023-10-11 21:19:09 -07:00
Chris Weaver
e6866c92cf Fix call to versioned_get_access_for_documents_fn args order (#563) 2023-10-11 21:18:22 -07:00
Yuhong Sun
8c61e6997b Document 360 Touchups (#561) 2023-10-11 20:16:42 -07:00
nlp8899
90828008e1 Document360 Connector (#552) 2023-10-11 20:10:01 -07:00
Weves
12442c1c06 Make it harder to use unversioned access functions 2023-10-11 17:52:38 -07:00
Weves
876c6fdaa6 Address bug with automatic document set cleanup on connector deletion 2023-10-11 14:42:45 -07:00
Yuhong Sun
3e05c4fa67 Move DanswerBot Configs (#559) 2023-10-11 10:24:16 -07:00
Yuhong Sun
90fbe1ab48 Comments on advanced DanswerBot options (#557) 2023-10-10 19:11:48 -07:00
Yuhong Sun
31d5fc6d31 Officially support Slack DMs to DanswerBot (#556) 2023-10-10 18:07:29 -07:00
Weves
fa460f4da1 Small tweak to the connector deletion flow 2023-10-10 16:38:36 -07:00
Weves
e7cc0f235c Add migration 2023-10-10 15:32:30 -07:00
Weves
091c2c8a80 Automatically delete document set relationships when deleting a ConnectorCredentialPair 2023-10-10 15:32:18 -07:00
Weves
3142e2eed2 Add user group prefix + access filter utility 2023-10-10 14:07:01 -07:00
Weves
5deb12523e Allow large file uploads 2023-10-10 09:11:07 -07:00
Yuhong Sun
744c95e1e1 Remove Stopword Highlighting (#546) 2023-10-09 18:54:40 -07:00
Yuhong Sun
0d505ffea1 Provide Env variable to have chat flow always use the tools prompt (#548) 2023-10-09 09:26:00 -07:00
Yuhong Sun
30cdc5c9de Slack Bot to respond very quickly to acknowledge seeing the question (#544) 2023-10-09 09:24:28 -07:00
Weves
dff7a4ba1e Fix Google sites doc link 2023-10-08 23:13:37 -07:00
Chris Weaver
d95da554ea Add Google Sites connector (#532) 2023-10-08 19:20:38 -07:00
Weves
fb1fbbee5c Add some additional FE components 2023-10-08 17:24:12 -07:00
Chris Weaver
f045bbed70 Add infinite retry for starting up Slack bot (#540) 2023-10-08 17:02:40 -07:00
Weves
ca74884bd7 Pin pytorch version to fix segmentation fault in Docker 2023-10-08 16:11:53 -07:00
Yuhong Sun
9b185f469f Vespa edge case ID does not follow expected format (#541) 2023-10-08 13:36:00 -07:00
Weves
e8d3190770 Fix really long words / strings 2023-10-08 11:56:29 -07:00
Yuhong Sun
a6e6be4037 Fix Divide by Zero Edge Case (#535) 2023-10-08 09:30:30 -07:00
Yuhong Sun
7d3f8b7c8c Gong Connector (#529)
---------

Co-authored-by: Weves <chrisweaver101@gmail.com>
2023-10-08 00:27:15 -07:00
Weves
c658ffd0b6 Fix drive connector for service accounts with shared files turned off 2023-10-08 00:24:56 -07:00
Weves
9425ccd043 Fix import 2023-10-07 23:36:35 -07:00
Weves
829b50571d Remove outdated experimental config in NextJS 2023-10-07 23:36:35 -07:00
Chris Weaver
d09c320538 Fix logout (#536) 2023-10-07 23:22:27 -07:00
Yuhong Sun
478fb4f999 Default to API key in file (#531) 2023-10-07 17:50:17 -07:00
dependabot[bot]
0fd51409ad Bump zod and next in /web (#530)
Removes [zod](https://github.com/colinhacks/zod). It's no longer used after updating ancestor dependency [next](https://github.com/vercel/next.js). These dependencies need to be updated together.


Removes `zod`

Updates `next` from 13.4.19 to 13.5.4
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.4.19...v13.5.4)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: indirect
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-07 17:19:49 -07:00
dependabot[bot]
21aa233170 Bump langchain from 0.0.273 to 0.0.308 in /backend/requirements (#516)
Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.0.273 to 0.0.308.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/v0.0.273...v0.0.308)

---
updated-dependencies:
- dependency-name: langchain
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-07 17:18:51 -07:00
dependabot[bot]
30efe3df88 Bump postcss from 8.4.29 to 8.4.31 in /web (#528)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-07 17:17:57 -07:00
Yuhong Sun
09ba0a49b3 Default not respond to every channel(#527) 2023-10-06 14:54:34 -07:00
Yuhong Sun
beb54eaa5d Fix migrations that went to the same revision (#525) 2023-10-05 21:58:14 -07:00
Yuhong Sun
0632e92144 Chat without tools should use a less complex prompt (#524) 2023-10-05 21:44:13 -07:00
Chris Weaver
9c89ae78ba Move is_public from Credential to ConnectorCredentialPair (#523) 2023-10-05 20:55:41 -07:00
Yuhong Sun
a85e73edbe Fix exception if no filters configured (#520) 2023-10-05 15:01:35 -07:00
Weves
5a63b689eb Add DANSWER_BOT_ONLY_ANSWER_WHEN_SLACK_BOT_CONFIG_IS_PRESENT to dev compose 2023-10-05 11:52:31 -07:00
Yuhong Sun
aee573cd76 Chat Feedback Backend (#513) 2023-10-04 20:52:24 -07:00
Weves
ec7697fcfe Add session description to get-user-chat-sessions endpoint 2023-10-04 17:09:36 -07:00
mattboret
b801937299 fix: remove \xa0 from code blocks (#509)
Co-authored-by: Matthieu Boret <matthieu.boret@fr.clara.net>
2023-10-04 09:46:32 -07:00
Yuhong Sun
499dfb59da Reenable Google Colab Model (#507) 2023-10-03 21:50:55 -07:00
Weves
7cc54eed0f Add env variable to make DanswerBot only respond when a config is present 2023-10-03 18:11:31 -07:00
Weves
d04716c99d Fix import ordering 2023-10-03 17:51:18 -07:00
Weves
732f5efb12 Fix AUTH_TYPE env variable bug on frontend 2023-10-03 17:35:50 -07:00
Weves
29a0a45518 Replace 'respond_sender_only' with 'respond_tag_only' + prettify UI 2023-10-03 16:26:02 -07:00
Yuhong Sun
59bac1ca8f Support more Slack Config Options (#494)
---------

Co-authored-by: Weves <chrisweaver101@gmail.com>
2023-10-03 14:55:29 -07:00
Yuhong Sun
c2721c7889 Option to have very verbose LLM logging (#500) 2023-10-02 22:56:24 -07:00
Yuhong Sun
ab65b19c4c Add OAuth configurability (#499) 2023-10-02 11:05:08 -07:00
nlp8899
c666f35cd0 create a hubspot connector (#482) 2023-10-02 10:13:23 -07:00
Weves
dbe33959c0 Move auto-ACL update to background job 2023-10-02 00:37:51 -07:00
Weves
829d04c904 Add multi-threading to improve speed of updates / indexing 2023-10-02 00:37:51 -07:00
Yuhong Sun
351475de28 Consolidate versions for easier extension (#495) 2023-10-01 23:49:38 -07:00
Jignesh Solanki
a808c733b8 allow pdf file in File Connector (#488) 2023-10-01 22:54:40 -07:00
Chris Weaver
2d06008f6f Add document set-based filters in UI (#497) 2023-10-01 10:46:04 -07:00
Weves
aa9071e441 Only run set_acl_for_vespa once 2023-09-30 14:20:41 -07:00
Weves
22f2398269 Make launch.json a template so that devs can customize 2023-09-30 13:45:54 -07:00
Weves
1abce83626 Add option to select Scrape Type in the web connector UI 2023-09-29 19:10:00 -07:00
Chris Weaver
0c6077ee7e Fix service accounts + shared drives (#490) 2023-09-29 17:26:42 -07:00
Weves
bfab9d1ee7 More notion testing 2023-09-28 16:24:51 -07:00
Weves
28859fe127 Try to explicitly use a root page for notion 2023-09-28 16:24:51 -07:00
Weves
79c28e1988 Fix backend Dockerfile 2023-09-26 22:53:01 -07:00
Weves
7afcf3489f Auto-populate ACL fields on server startup 2023-09-26 22:53:01 -07:00
Weves
c09f00990e Updatr CONTRIBUTING.md with celery cmds 2023-09-26 18:55:45 -07:00
Weves
5f25826a98 Handle document_set deletion better + prevent updates while syncing 2023-09-26 18:06:40 -07:00
Weves
60cddee310 Add better message in Slack management UI 2023-09-26 15:32:40 -07:00
Chris Weaver
d41d844116 Slack bot management dashboard (#483) 2023-09-26 14:03:27 -07:00
Chris Weaver
0c58c8d6cb Adding Document Sets (#477)
Adds:
- name for connector credential pairs + frontend changes to start populating this field
- document set table migration
- during indexing, document sets are now checked and inserted into Vespa
- background job to check if document sets need to be synced
- document set management APIs
- document set management dashboard in the UI
2023-09-26 12:53:19 -07:00
Chris Weaver
8594bac30b Transition to using access_control_list to manage access in Vespa (#450) 2023-09-26 12:26:39 -07:00
Weves
c4e4e88301 Add NOTION_CONNECTOR_ENABLE_RECURSIVE_PAGE_LOOKUP to the .dev deployment setup 2023-09-25 23:21:41 -07:00
Yuhong Sun
6d376d3cf6 Fix Type with new OpenAI Endpoint (#480) 2023-09-25 11:15:56 -07:00
Rajeesh
0c3ecbfa2f Ability to provide different base URL for the open AI LLM endpoint (#475) 2023-09-25 11:07:07 -07:00
Yuhong Sun
8b95e2631d Make Cross Encoders Optional (#476) 2023-09-23 17:17:54 -07:00
Yuhong Sun
3c65317538 Fix Slackbot Tagging people or groups (#473) 2023-09-21 21:44:35 -07:00
Yuhong Sun
5cc17d39f0 Chat Backend API edge cases handled (#472) 2023-09-21 20:24:47 -07:00
Yuhong Sun
b416c85f0f Add Metrics to Regression Test (#470) 2023-09-20 20:42:02 -07:00
Weves
4912beb283 Add recursive Notion search 2023-09-20 15:42:18 -07:00
Weves
db024ad7b7 Provide default value for 'retrieval_enabled' column in migration 2023-09-20 13:30:57 -07:00
Yuhong Sun
4b98e47036 Add more flexibility to the Web Connector (#462) 2023-09-19 20:18:25 -07:00
Yuhong Sun
da6dd5b617 Prefix Slack Channel Identifier with a pound sign (#461) 2023-09-19 15:04:10 -07:00
Yuhong Sun
32eee88628 Special Danswer flow for Chat (#459) 2023-09-18 21:10:20 -07:00
Yuhong Sun
3641102672 Verification prompt 3.5 tuneup (#458) 2023-09-18 13:16:26 -07:00
Weves
0fcedfec17 Fix dynamic summary parsing 2023-09-18 09:54:12 -07:00
Yuhong Sun
5b1109d5c1 Clean up Slack Bot formatting (#455) 2023-09-17 22:47:33 -07:00
Yuhong Sun
b337a521f8 Slack Bot Interface Rework (#454) 2023-09-17 19:23:59 -07:00
Yuhong Sun
d7b7714d86 Cleanup for Mintlify Websites (#453) 2023-09-16 23:43:24 -07:00
Yuhong Sun
6b305c56b3 Use Sentence Aware Splitter (#452) 2023-09-16 16:28:16 -07:00
Yuhong Sun
63215e9c9a Fix Migration Conflict (#449) 2023-09-15 17:56:03 -07:00
Yuhong Sun
f802351d85 Fix Vespa Issue where Documents with no Content could be retrieved via Vector Search (#448) 2023-09-15 13:03:14 -07:00
Weves
1d945becab Update node verison from 18 -> 20 to address security scan issues 2023-09-15 12:17:54 -07:00
Yuhong Sun
e549d2bb4a Chat with Context Backend (#441) 2023-09-15 12:17:05 -07:00
Weves
a16ce56f6b Fix for notion connector 2023-09-14 20:15:05 -07:00
Weves
c4e0face9b Move connector / credential pair deletion to celery 2023-09-14 16:23:13 -07:00
Weves
3fc7a13a31 Add extra logging for failure to fetch page blocks 2023-09-13 18:53:15 -07:00
Weves
e433e27bc8 Small highlighting fix 2023-09-13 18:23:46 -07:00
Weves
2bf38fa996 Fix slack link bug with non-thread messages 2023-09-13 17:48:01 -07:00
Chris Weaver
4e359bc731 Fix bugs in Notion connector (#440)
* Fix bad pagination
* Make each block be a section -> we can link to individual blocks 
* Don't have a page include all content from child pages
2023-09-13 13:30:41 -07:00
Weves
ffa24e2f09 Handle newlines + code blocks in answer 2023-09-12 15:54:16 -07:00
Yuhong Sun
9738e5e628 minor touchups 2023-09-12 15:44:15 -07:00
Weves
6f50f6710a Fix slack links for messages inside of a thread 2023-09-12 13:57:01 -07:00
Weves
d130a93b0f Fix small spacing issue with keyword highlighting 2023-09-12 13:10:10 -07:00
Weves
cf2bd8a40c highlighting 2023-09-12 11:35:37 -07:00
Yuhong Sun
b5fc2a5775 Regression Test (#434) 2023-09-11 19:06:01 -07:00
Yuhong Sun
101ff2f392 Fix LLM warm up (#433) 2023-09-11 14:47:36 -07:00
Yuhong Sun
9316b78f47 Evaluate LLM Answers via Reflexion (#430) 2023-09-11 14:45:13 -07:00
Weves
ddfa8cf8a6 Disable indexing for empty docs 2023-09-11 13:28:13 -07:00
Yuhong Sun
6c795dfa6c Slack CoT Scratchpad (#421) 2023-09-10 16:56:44 -07:00
Weves
1d847bfd23 Fix timeout for new LLM class 2023-09-10 11:18:05 -07:00
Weves
05a5419c8e Add backwards compatibility for users who don't have groups:read 2023-09-10 11:03:23 -07:00
Weves
e72f26ef53 Fix indexing job cleanup 2023-09-10 11:01:34 -07:00
Weves
67c26f89e8 Add new Github fields to FE 2023-09-10 10:34:35 -07:00
Yuhong Sun
f34f373b08 Fix Github Metadata (#427) 2023-09-10 10:27:01 -07:00
Yuhong Sun
f126dfdbd0 Add Github Polling and Issues (#424) 2023-09-09 23:11:00 -07:00
Yuhong Sun
4a0c2bf866 Vespa Save and Load (#422) 2023-09-09 20:25:31 -07:00
Andrea Nassi
0e65688166 Change max upload size setting (#410)
---------

Co-authored-by: Gabriele Capitani <gabrielecapitani2005@gmail.com>
2023-09-09 17:01:44 -07:00
Weves
eae6f58450 Fix slack bot retrieval 2023-09-09 12:57:23 -07:00
Weves
648706d48c Allow indexing of private channels 2023-09-08 17:18:07 -07:00
Yuhong Sun
b1fe120021 Make Vespa Deployment file as simple as possible (#416)
Make Vespa Deployment file as simple as possible
2023-09-08 00:47:33 -07:00
Yuhong Sun
4ae2680384 Minor Tweaks to Default Prompt (#415) 2023-09-07 23:42:34 -07:00
Yuhong Sun
20a6de0635 Fix Github Actions names (#414) 2023-09-07 22:33:17 -07:00
Yuhong Sun
c9492bf624 Split the build on Tag actions into two jobs (#413) 2023-09-07 22:13:38 -07:00
Yuhong Sun
52fa71eaff Better QA Prompts (#409) 2023-09-06 22:46:25 -07:00
Weves
ccbc69d153 Misc slack bot improvements 2023-09-06 18:12:31 -07:00
Yuhong Sun
7972c8a71e Make Boosting give more consistent scores (#406) 2023-09-06 15:50:53 -07:00
Weves
2d077a9544 Improve quote hover display 2023-09-06 15:45:53 -07:00
Weves
78e1806688 Add more logging for notion connector + add retries 2023-09-06 11:45:46 -07:00
Chris Weaver
6a79ddce37 New prompt + show quotes on hover (#404) 2023-09-06 01:44:48 -07:00
Yuhong Sun
5977a28f58 No Context Chat Backend (#397) 2023-09-05 22:32:00 -07:00
Chris Weaver
630386c8c4 Remove tornado key + remove nodejs once copied into playwright + remove old semver module (#402) 2023-09-05 19:18:35 -07:00
Chris Weaver
b06e53a51e Feed in docs till we reach a token limit (#401) 2023-09-05 15:20:42 -07:00
Weves
58b75122f1 Fix deletion for overlapping connectors 2023-09-04 21:12:08 -07:00
Yuhong Sun
d593818996 Use Vespa Doc ID directly instead of from fields (#399) 2023-09-04 17:24:31 -07:00
Weves
f7cc7190fe Allow connectors that have documents with feedback to be deleted 2023-09-04 16:05:43 -07:00
Weves
adb22273b6 Fix Vespa limit 2023-09-04 15:49:11 -07:00
Weves
742a016175 Remove empty files from QA 2023-09-04 15:49:11 -07:00
Chris Weaver
0fcac74df1 Add WEB_DOMAIN env variable to dev compose file (#395) 2023-09-04 10:43:06 -07:00
Chris Weaver
50101a8cac Use newest version of LTS node for playwright (#393) 2023-09-04 10:42:49 -07:00
Yuhong Sun
f4866bfefc Remove libc-dev and uninstall py (#392) 2023-09-03 17:18:41 -07:00
Yuhong Sun
c28f4d4527 Remove py library due to denial of service CVE (#391) 2023-09-03 16:36:13 -07:00
Weves
884f746211 Fix oauth redirect 2023-09-02 15:28:22 -07:00
Weves
f4d55479c4 Fix popup overlap 2023-09-02 14:26:56 -07:00
Yuhong Sun
28480d19de Fix Web Connector Docker Dependencies (#388) 2023-09-02 14:20:41 -07:00
Weves
2885240183 Default to semantic search 2023-09-02 11:59:32 -07:00
Yuhong Sun
c95cf5ca74 Playwright only install Chrome (#386) 2023-09-02 10:15:15 -07:00
Yuhong Sun
4aebb69883 Upgrade packages for security reasons (#384) 2023-09-01 20:35:48 -07:00
Chris Weaver
c68afbe9d0 UI for AI thoughts (#385) 2023-09-01 20:32:22 -07:00
Yuhong Sun
06c1afce42 Remove ANSWERABLE text from model out (#383) 2023-09-01 15:10:14 -07:00
Yuhong Sun
d73d81c867 Scripts to Reset Postgres and Vespa (#382) 2023-09-01 14:43:04 -07:00
Yuhong Sun
493648d28b Reduce Slack Bot Log Spamming (#381) 2023-09-01 10:43:57 -07:00
Weves
b89a06f03b Allow admins to connect public credentials to connectors 2023-09-01 10:42:49 -07:00
Weves
0d4244f990 Fix API key specification bug 2023-09-01 10:30:02 -07:00
Yuhong Sun
bddf03cd54 Tag Latest Image on Code Tag (#380) 2023-09-01 10:22:04 -07:00
Weves
5a6abbf39e Fix query ID when giving feedback 2023-08-31 20:05:07 -07:00
Yuhong Sun
e1fbffd141 Index all Google Drive file types (#373) 2023-08-31 19:20:32 -07:00
Yuhong Sun
6bae93ad3c Notion connector test separately (#372) 2023-08-31 18:18:19 -07:00
Yuhong Sun
43efa9da94 Mark incomplete Index Attempts as Failed on job restart (#371) 2023-08-31 17:43:03 -07:00
Yuhong Sun
dac5aaea94 Fix Ruff generated mistake (#370) 2023-08-31 17:03:57 -07:00
Yuhong Sun
80a08bbf0c Return empty string for encrypted PDF (#369) 2023-08-31 16:59:28 -07:00
Yohann Fabri
d6e87df548 gdrive connector ignore encrypted pdf file (#353) (#362)
Thanks for your contribution!
2023-08-31 16:57:08 -07:00
Yuhong Sun
ac2a4f9051 Ruff Styling (#368) 2023-08-31 15:55:01 -07:00
Yuhong Sun
51ec2517cb LLM to validate user Query (#365)
Backend Only
2023-08-31 15:33:39 -07:00
Patrick Decat
0a7775860c feat(dev): use ruff for python linting (#355) 2023-08-31 15:29:59 -07:00
Yuhong Sun
8bf82ac144 Better logging for Google Drive follow shortcuts (#367) 2023-08-31 15:24:23 -07:00
Yuhong Sun
c1727e63ad bug squashed 2023-08-31 14:32:13 -07:00
Weves
5dc855c4fc Fix null document ID 2023-08-31 13:04:43 -07:00
Weves
f316c8569f Show scores 2023-08-31 11:25:02 -07:00
Weves
4bce20b5c4 Switchup icons 2023-08-31 11:25:02 -07:00
Weves
996420f92c Fix negative values for feedback page 2023-08-31 11:25:02 -07:00
Yuhong Sun
ec4d0b856c Added boost to rerank step (#360) 2023-08-30 23:12:55 -07:00
Weves
5b3abb4cb3 Update document boost UI 2023-08-30 20:02:21 -07:00
Weves
faa73b3088 Add env variables for slack bot to .dev compose file 2023-08-30 17:43:02 -07:00
Yuhong Sun
681eb6e9f2 Fix Multiarchitecture Docker (#358) 2023-08-30 16:00:32 -07:00
Weves
a6ea40714e Disable langchain retries 2023-08-30 14:28:14 -07:00
Weves
cea3e1f3d5 Add support for multiple allowed email domains + make slack bot logs go to stdout 2023-08-30 13:47:46 -07:00
Chris Weaver
038f646c09 Fe for feedback (#346) 2023-08-30 12:52:24 -07:00
Yuhong Sun
856061c7ea Fix ReDoS and Directory Traversal (#352)
Co-authored-by: Weves <chrisweaver101@gmail.com>
2023-08-29 21:20:15 -07:00
Weves
9e82dbf8bb Fix confluence connector styling 2023-08-29 14:45:52 -07:00
Weves
1c3d0a1f3d Add environment variable which disables answering when an answer is not found 2023-08-29 14:45:52 -07:00
Patrick Decat
3c5cdb07c1 fix(confluence): add missing import (#350) 2023-08-29 11:36:14 -07:00
Patrick Decat
681a8a423f fix(confluence): ignore empty pages (#349) 2023-08-29 09:45:35 -07:00
Yuhong Sun
548f0a41cb Confluence handle pages without body.storage.value (#347)
Workaround for: https://jira.atlassian.com/browse/CONFCLOUD-76433
2023-08-28 18:35:13 -07:00
Yuhong Sun
b2a51283d1 Learn from feedback backend (#343)
---------

Co-authored-by: Weves <chrisweaver101@gmail.com>
2023-08-28 13:29:29 -07:00
Chris Weaver
c43a403b71 Update README.md 2023-08-28 02:43:46 -07:00
Chris Weaver
cddd86dd1c Update README.md
Add embeds + update features / roadmap
2023-08-28 02:42:01 -07:00
Yuhong Sun
96575bf893 Remove Unused Imports and Variables (#344) 2023-08-27 17:39:41 -07:00
Weves
4469447fde Add LangChain-based LLM 2023-08-26 21:57:15 -07:00
Weves
20b6369eea Add ability to respond with error message in slack thread 2023-08-26 15:47:01 -07:00
Yuhong Sun
a2ec1e2cda Vespa Deployment (#330)
Large Change!
2023-08-26 15:35:19 -07:00
Chris Weaver
642862bede Make public credentials accessible by all admins (#337) 2023-08-25 17:06:38 -07:00
Weves
b27107c184 Add user management page 2023-08-25 12:25:39 -07:00
Weves
8cda11c701 Respond to slack messages with file attachments 2023-08-25 11:12:26 -07:00
Yuhong Sun
384bf1befe Warm up models before first document indexed (#333) 2023-08-24 20:01:50 -07:00
Yuhong Sun
cb13f5b18b Fix non-json model output processing (#332) 2023-08-24 19:43:58 -07:00
Chris Weaver
6897416fe6 Support service accounts for Google Drive connector (#325) 2023-08-24 14:50:05 -07:00
Chris Weaver
8976ed3bcd Fix mypy (#331) 2023-08-24 12:23:04 -07:00
Yuhong Sun
81d2226b5f Minor Vespa Updates (#329) 2023-08-24 09:01:15 -07:00
Yuhong Sun
8159fdcdce Add Vespa and rework Document Indices (#317) 2023-08-24 08:46:28 -07:00
Weves
a2d3a3f116 Fix image build by pinning safetensors version 2023-08-23 22:23:45 -07:00
Weves
7836e91a20 Add extra logging in the case of null document_id 2023-08-23 18:16:19 -07:00
Chris Weaver
e307275774 Add support for multiple indexing workers (#322) 2023-08-22 18:11:31 -07:00
Weves
3ea205279f Fix bug where slack bot would tag users / everyone 2023-08-22 16:15:47 -07:00
Weves
e5352b6af8 Fix issue with Confluence errors not being ignored 2023-08-21 09:14:21 -07:00
Chris Weaver
9f1898c384 Add basic chain of thought PromptProcessor(#316) 2023-08-20 18:48:24 -07:00
Ikko Eltociear Ashimine
3ec602b47f Fix typo in indexing_pipeline.py (#318)
pipline -> pipeline
2023-08-20 09:15:23 -07:00
Weves
ab905e9fe6 Include channel name in slack bot logs 2023-08-19 22:23:57 -07:00
Chris Weaver
067503bc84 Background logs to stdout (#315) 2023-08-18 19:02:32 -07:00
Chris Weaver
f541a3ee85 Continue on some connector failures (#314) 2023-08-18 17:59:33 -07:00
Weves
70d7ca5c73 Better error for missing allowed_users / allowed_groups 2023-08-18 10:21:27 -07:00
Chris Weaver
bf4b63de19 Linear connector (#312) 2023-08-17 15:17:57 -07:00
Chris Weaver
f37ac76d3c Stop using untyped dicts to represent quotes (#310) 2023-08-17 14:53:55 -07:00
Sid Ravinutala
81a4934bb8 Google drive shared files fix + shortcuts (#300)
Also fixes foreign key constraint issue when manually wiping postgres + keeps track of accessed folders
2023-08-17 08:54:00 -07:00
1117 changed files with 121623 additions and 16288 deletions

View File

@@ -1,41 +0,0 @@
name: Build and Push Docker Images on Tagging
on:
push:
tags:
- '*'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Web Server Docker Build and Push
uses: docker/build-push-action@v2
with:
context: ./web
file: ./web/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: danswer/danswer-web-server:${{ github.ref_name }}
- name: Api Server Docker Build and Push
uses: docker/build-push-action@v2
with:
context: ./backend
file: ./backend/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: danswer/danswer-backend:${{ github.ref_name }}

View File

@@ -0,0 +1,33 @@
name: Build Backend Image on Merge Group
on:
merge_group:
types: [checks_requested]
env:
REGISTRY_IMAGE: danswer/danswer-backend
jobs:
build:
# TODO: make this a matrix build like the web containers
runs-on:
group: amd64-image-builders
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Backend Image Docker Build
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
platforms: linux/amd64,linux/arm64
push: false
tags: |
${{ env.REGISTRY_IMAGE }}:latest
build-args: |
DANSWER_VERSION=v0.0.1

View File

@@ -0,0 +1,49 @@
name: Build and Push Backend Image on Tag
on:
push:
tags:
- '*'
env:
REGISTRY_IMAGE: danswer/danswer-backend
jobs:
build-and-push:
# TODO: make this a matrix build like the web containers
runs-on:
group: amd64-image-builders
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Backend Image Docker Build and Push
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
${{ env.REGISTRY_IMAGE }}:latest
build-args: |
DANSWER_VERSION=${{ github.ref_name }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
# To run locally: trivy image --severity HIGH,CRITICAL danswer/danswer-backend
image-ref: docker.io/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
severity: 'CRITICAL,HIGH'
trivyignores: ./backend/.trivyignore

View File

@@ -0,0 +1,42 @@
name: Build and Push Model Server Image on Tag
on:
push:
tags:
- '*'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Model Server Image Docker Build and Push
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile.model_server
platforms: linux/amd64,linux/arm64
push: true
tags: |
danswer/danswer-model-server:${{ github.ref_name }}
danswer/danswer-model-server:latest
build-args: |
DANSWER_VERSION=${{ github.ref_name }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: docker.io/danswer/danswer-model-server:${{ github.ref_name }}
severity: 'CRITICAL,HIGH'

View File

@@ -0,0 +1,119 @@
name: Build and Push Web Image on Tag
on:
push:
tags:
- '*'
env:
REGISTRY_IMAGE: danswer/danswer-web-server
jobs:
build:
runs-on:
group: ${{ matrix.platform == 'linux/amd64' && 'amd64-image-builders' || 'arm64-image-builders' }}
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
type=raw,value=${{ env.REGISTRY_IMAGE }}:latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: ./web
file: ./web/Dockerfile
platforms: ${{ matrix.platform }}
push: true
build-args: |
DANSWER_VERSION=${{ github.ref_name }}
# needed due to weird interactions with the builds for different platforms
no-cache: true
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: docker.io/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
severity: 'CRITICAL,HIGH'

View File

@@ -0,0 +1,53 @@
name: Build Web Image on Merge Group
on:
merge_group:
types: [checks_requested]
env:
REGISTRY_IMAGE: danswer/danswer-web-server
jobs:
build:
runs-on:
group: ${{ matrix.platform == 'linux/amd64' && 'amd64-image-builders' || 'arm64-image-builders' }}
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=${{ env.REGISTRY_IMAGE }}:latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build by digest
id: build
uses: docker/build-push-action@v5
with:
context: ./web
file: ./web/Dockerfile
platforms: ${{ matrix.platform }}
push: false
build-args: |
DANSWER_VERSION=v0.0.1
# needed due to weird interactions with the builds for different platforms
no-cache: true
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -25,16 +25,8 @@ jobs:
- name: Pull, Tag and Push Web Server Image
run: |
docker pull danswer/danswer-web-server:${{ github.event.inputs.version }}
docker tag danswer/danswer-web-server:${{ github.event.inputs.version }} danswer/danswer-web-server:latest
docker push danswer/danswer-web-server:latest
docker manifest create danswer/danswer-web-server:latest danswer/danswer-web-server:latest
docker manifest push danswer/danswer-web-server:latest
docker buildx imagetools create -t danswer/danswer-web-server:latest danswer/danswer-web-server:${{ github.event.inputs.version }}
- name: Pull, Tag and Push API Server Image
run: |
docker pull danswer/danswer-backend:${{ github.event.inputs.version }}
docker tag danswer/danswer-backend:${{ github.event.inputs.version }} danswer/danswer-backend:latest
docker push danswer/danswer-backend:latest
docker manifest create danswer/danswer-backend:latest danswer/danswer-backend:latest
docker manifest push danswer/danswer-backend:latest
docker buildx imagetools create -t danswer/danswer-backend:latest danswer/danswer-backend:${{ github.event.inputs.version }}

View File

@@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
@@ -20,16 +20,23 @@ jobs:
cache-dependency-path: |
backend/requirements/default.txt
backend/requirements/dev.txt
- run: |
backend/requirements/model_server.txt
- run: |
python -m pip install --upgrade pip
pip install -r backend/requirements/default.txt
pip install -r backend/requirements/dev.txt
pip install -r backend/requirements/model_server.txt
- name: Run MyPy
run: |
cd backend
mypy .
- name: Run ruff
run: |
cd backend
ruff .
- name: Check import order with reorder-python-imports
run: |
cd backend

35
.github/workflows/pr-python-tests.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Python Unit Tests
on:
pull_request:
branches: [ main ]
jobs:
backend-check:
runs-on: ubuntu-latest
env:
PYTHONPATH: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
backend/requirements/default.txt
backend/requirements/dev.txt
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements/default.txt
pip install -r backend/requirements/dev.txt
- name: Run Tests
shell: script -q -e -c "bash --noprofile --norc -eo pipefail {0}"
run: py.test -o junit_family=xunit2 -xv --ff backend/tests/unit

21
.github/workflows/pr-quality-checks.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Quality Checks PR
concurrency:
group: Quality-Checks-PR-${{ github.head_ref }}
cancel-in-progress: true
on:
pull_request: null
jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: pre-commit/action@v3.0.0
with:
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}

10
.gitignore vendored
View File

@@ -1 +1,9 @@
.env
.env
.DS_store
.venv
.mypy_cache
.idea
/deployment/data/nginx/app.conf
.vscode/launch.json
*.sw?
/backend/tests/regression/answer_quality/search_test_config.yaml

View File

@@ -15,10 +15,31 @@ repos:
# in the backend directory called `alembic`
exclude: ^backend/alembic/
# We would like to have a mypy pre-commit hook, but due to the fact that
# pre-commit runs in it's own isolated environment, we would need to install
# These settings will remove unused imports with side effects
# Note: The repo currently does not and should not have imports with side effects
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.0
hooks:
- id: autoflake
args: [ '--remove-all-unused-imports', '--remove-unused-variables', '--in-place' , '--recursive']
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.286
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [html, css, javascript, ts, tsx]
additional_dependencies:
- prettier
# We would like to have a mypy pre-commit hook, but due to the fact that
# pre-commit runs in it's own isolated environment, we would need to install
# and keep in sync all dependencies so mypy has access to the appropriate type
# stubs. This does not seem worth it at the moment, so for now we will stick to
# stubs. This does not seem worth it at the moment, so for now we will stick to
# having mypy run via Github Actions / manually by contributors
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.1.1
@@ -30,15 +51,15 @@ repos:
# # with requirements/dev.txt + requirements/default.txt
# additional_dependencies: [
# alembic==1.10.4,
# types-beautifulsoup4==4.12.0.3,
# types-html5lib==1.1.11.13,
# types-oauthlib==3.2.0.9,
# types-psycopg2==2.9.21.10,
# types-python-dateutil==2.8.19.13,
# types-regex==2023.3.23.1,
# types-requests==2.28.11.17,
# types-retry==0.9.9.3,
# types-beautifulsoup4==4.12.0.3,
# types-html5lib==1.1.11.13,
# types-oauthlib==3.2.0.9,
# types-psycopg2==2.9.21.10,
# types-python-dateutil==2.8.19.13,
# types-regex==2023.3.23.1,
# types-requests==2.28.11.17,
# types-retry==0.9.9.3,
# types-urllib3==1.26.25.11
# ]
# # TODO: add back once errors are addressed
# # args: [--strict]
# # args: [--strict]

52
.vscode/env_template.txt vendored Normal file
View File

@@ -0,0 +1,52 @@
# Copy this file to .env at the base of the repo and fill in the <REPLACE THIS> values
# This will help with development iteration speed and reduce repeat tasks for dev
# Also check out danswer/backend/scripts/restart_containers.sh for a script to restart the containers which Danswer relies on outside of VSCode/Cursor processes
# For local dev, often user Authentication is not needed
AUTH_TYPE=disabled
# Always keep these on for Dev
# Logs all model prompts to stdout
LOG_DANSWER_MODEL_INTERACTIONS=True
# More verbose logging
LOG_LEVEL=debug
# This passes top N results to LLM an additional time for reranking prior to answer generation
# This step is quite heavy on token usage so we disable it for dev generally
DISABLE_LLM_CHUNK_FILTER=True
# Useful if you want to toggle auth on/off (google_oauth/OIDC specifically)
OAUTH_CLIENT_ID=<REPLACE THIS>
OAUTH_CLIENT_SECRET=<REPLACE THIS>
# Generally not useful for dev, we don't generally want to set up an SMTP server for dev
REQUIRE_EMAIL_VERIFICATION=False
# Set these so if you wipe the DB, you don't end up having to go through the UI every time
GEN_AI_API_KEY=<REPLACE THIS>
# If answer quality isn't important for dev, use 3.5 turbo due to it being cheaper
GEN_AI_MODEL_VERSION=gpt-3.5-turbo
FAST_GEN_AI_MODEL_VERSION=gpt-3.5-turbo
# For Danswer Slack Bot, overrides the UI values so no need to set this up via UI every time
# Only needed if using DanswerBot
#DANSWER_BOT_SLACK_APP_TOKEN=<REPLACE THIS>
#DANSWER_BOT_SLACK_BOT_TOKEN=<REPLACE THIS>
# Python stuff
PYTHONPATH=./backend
PYTHONUNBUFFERED=1
# Internet Search
BING_API_KEY=<REPLACE THIS>
# Enable the full set of Danswer Enterprise Edition features
# NOTE: DO NOT ENABLE THIS UNLESS YOU HAVE A PAID ENTERPRISE LICENSE (or if you are using this for local testing/development)
ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=False

65
.vscode/launch.json vendored
View File

@@ -1,65 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Danswer backend",
"type": "python",
"request": "launch",
"module": "uvicorn",
"cwd": "${workspaceFolder}/backend",
"env": {
"LOG_LEVEL": "DEBUG",
"DISABLE_AUTH": "True",
"TYPESENSE_API_KEY": "typesense_api_key",
"DYNAMIC_CONFIG_DIR_PATH": "./dynamic_config_storage",
},
"args": [
"danswer.main:app",
"--reload",
"--port",
"8080"
]
},
{
"name": "Danswer indexer",
"type": "python",
"request": "launch",
"program": "danswer/background/update.py",
"cwd": "${workspaceFolder}/backend",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONPATH": ".",
"TYPESENSE_API_KEY": "typesense_api_key",
"DYNAMIC_CONFIG_DIR_PATH": "./dynamic_config_storage",
},
},
{
"name": "Danswer temp files deletion",
"type": "python",
"request": "launch",
"program": "danswer/background/file_deletion.py",
"cwd": "${workspaceFolder}/backend",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONPATH": "${workspaceFolder}/backend",
},
},
// For the listner to access the Slack API,
// DANSWER_BOT_SLACK_APP_TOKEN & DANSWER_BOT_SLACK_BOT_TOKEN need to be set in .env file located in the root of the project
{
"name": "Danswer slack bot listener",
"type": "python",
"request": "launch",
"program": "danswer/listeners/slack_listener.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONPATH": ".",
},
}
]
}

129
.vscode/launch.template.jsonc vendored Normal file
View File

@@ -0,0 +1,129 @@
/*
Copy this file into '.vscode/launch.json' or merge its
contents into your existing configurations.
*/
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Web Server",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/web",
"runtimeExecutable": "npm",
"envFile": "${workspaceFolder}/.env",
"runtimeArgs": [
"run", "dev"
],
"console": "integratedTerminal"
},
{
"name": "Model Server",
"type": "python",
"request": "launch",
"module": "uvicorn",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1"
},
"args": [
"model_server.main:app",
"--reload",
"--port",
"9000"
]
},
{
"name": "API Server",
"type": "python",
"request": "launch",
"module": "uvicorn",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_DANSWER_MODEL_INTERACTIONS": "True",
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1"
},
"args": [
"danswer.main:app",
"--reload",
"--port",
"8080"
]
},
{
"name": "Indexing",
"type": "python",
"request": "launch",
"program": "danswer/background/update.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"ENABLE_MINI_CHUNK": "false",
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
}
},
// Celery and all async jobs, usually would include indexing as well but this is handled separately above for dev
{
"name": "Background Jobs",
"type": "python",
"request": "launch",
"program": "scripts/dev_run_background_jobs.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_DANSWER_MODEL_INTERACTIONS": "True",
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
},
"args": [
"--no-indexing"
]
},
// For the listner to access the Slack API,
// DANSWER_BOT_SLACK_APP_TOKEN & DANSWER_BOT_SLACK_BOT_TOKEN need to be set in .env file located in the root of the project
{
"name": "Slack Bot",
"type": "python",
"request": "launch",
"program": "danswer/danswerbot/slack/listener.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
}
},
{
"name": "Pytest",
"type": "python",
"request": "launch",
"module": "pytest",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
},
"args": [
"-v"
// Specify a sepcific module/test to run or provide nothing to run all tests
//"tests/unit/danswer/llm/answering/test_prune_and_merge.py"
]
}
]
}

View File

@@ -1,3 +1,5 @@
<!-- DANSWER_METADATA={"link": "https://github.com/danswer-ai/danswer/blob/main/CONTRIBUTING.md"} -->
# Contributing to Danswer
Hey there! We are so excited that you're interested in Danswer.
@@ -6,7 +8,7 @@ As an open source project in a rapidly changing space, we welcome all contributi
## 💃 Guidelines
### Contribution Opportunities
The [GitHub issues](https://github.com/danswer-ai/danswer/issues) page is a great place to start for contribution ideas.
The [GitHub Issues](https://github.com/danswer-ai/danswer/issues) page is a great place to start for contribution ideas.
Issues that have been explicitly approved by the maintainers (aligned with the direction of the project)
will be marked with the `approved by maintainers` label.
@@ -19,7 +21,9 @@ If you have a new/different contribution in mind, we'd love to hear about it!
Your input is vital to making sure that Danswer moves in the right direction.
Before starting on implementation, please raise a GitHub issue.
And always feel free to message us (Chris Weaver / Yuhong Sun) on Slack / Discord directly about anything at all.
And always feel free to message us (Chris Weaver / Yuhong Sun) on
[Slack](https://join.slack.com/t/danswer/shared_invite/zt-2afut44lv-Rw3kSWu6_OmdAXRpCv80DQ) /
[Discord](https://discord.gg/TDJ59cGV2X) directly about anything at all.
### Contributing Code
@@ -36,7 +40,7 @@ Our goal is to make contributing as easy as possible. If you run into any issues
That way we can help future contributors and users can avoid the same issue.
We also have support channels and generally interesting discussions on our
[Slack](https://join.slack.com/t/danswer/shared_invite/zt-1u3h3ke3b-VGh1idW19R8oiNRiKBYv2w)
[Slack](https://join.slack.com/t/danswer/shared_invite/zt-2afut44lv-Rw3kSWu6_OmdAXRpCv80DQ)
and
[Discord](https://discord.gg/TDJ59cGV2X).
@@ -44,10 +48,9 @@ We would love to see you there!
## Get Started 🚀
Danswer being a fully functional app, relies on several external pieces of software, specifically:
- Postgres
- Vector DB ([Qdrant](https://github.com/qdrant/qdrant))
- Search Engine ([Typesense](https://github.com/typesense/typesense))
Danswer being a fully functional app, relies on some external pieces of software, specifically:
- [Postgres](https://www.postgresql.org/) (Relational DB)
- [Vespa](https://vespa.ai/) (Vector DB/Search Engine)
This guide provides instructions to set up the Danswer specific services outside of Docker because it's easier for
development purposes but also feel free to just use the containers and update with local changes by providing the
@@ -55,11 +58,10 @@ development purposes but also feel free to just use the containers and update wi
### Local Set Up
We've tested primarily with Python versions >= 3.11 but the code should work with Python >= 3.9.
It is recommended to use Python version 3.11
This guide skips a few optional features for simplicity, reach out if you need any of these:
- User Authentication feature
- File Connector background job
If using a lower version, modifications will have to be made to the code.
If using a higher version, the version of Tensorflow we use may not be available for your platform.
#### Installing Requirements
@@ -70,15 +72,24 @@ For convenience here's a command for it:
python -m venv .venv
source .venv/bin/activate
```
_For Windows activate via:_
--> Note that this virtual environment MUST NOT be set up WITHIN the danswer
directory
_For Windows, activate the virtual environment using Command Prompt:_
```bash
.venv\Scripts\activate
```
If using PowerShell, the command slightly differs:
```powershell
.venv\Scripts\Activate.ps1
```
Install the required python dependencies:
```bash
pip install -r danswer/backend/requirements/default.txt
pip install -r danswer/backend/requirements/dev.txt
pip install -r danswer/backend/requirements/model_server.txt
```
Install [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) for the frontend.
@@ -87,79 +98,68 @@ Once the above is done, navigate to `danswer/web` run:
npm i
```
Install Playwright (required by the Web Connector), with the python venv active, run:
Install Playwright (required by the Web Connector)
> Note: If you have just done the pip install, open a new terminal and source the python virtual-env again.
This will update the path to include playwright
Then install Playwright by running:
```bash
playwright install
```
#### Dependent Docker Containers
First navigate to `danswer/deployment/docker_compose`, then start up the containers with:
Postgres:
First navigate to `danswer/deployment/docker_compose`, then start up Vespa and Postgres with:
```bash
docker compose -f docker-compose.dev.yml -p danswer-stack up -d relational_db
docker compose -f docker-compose.dev.yml -p danswer-stack up -d index relational_db
```
Qdrant:
```bash
docker compose -f docker-compose.dev.yml -p danswer-stack up -d vector_db
```
Typesense:
```bash
docker compose -f docker-compose.dev.yml -p danswer-stack up -d search_engine
```
(index refers to Vespa and relational_db refers to Postgres)
#### Running Danswer
Setup a folder to store config. Navigate to `danswer/backend` and run:
```bash
mkdir dynamic_config_storage
```
To start the frontend, navigate to `danswer/web` and run:
```bash
DISABLE_AUTH=true npm run dev
npm run dev
```
_for Windows, run:_
Next, start the model server which runs the local NLP models.
Navigate to `danswer/backend` and run:
```bash
(SET "DISABLE_AUTH=true" && npm run dev)
uvicorn model_server.main:app --reload --port 9000
```
_For Windows (for compatibility with both PowerShell and Command Prompt):_
```bash
powershell -Command "
uvicorn model_server.main:app --reload --port 9000
"
```
The first time running Danswer, you will need to run the DB migrations for Postgres.
After the first time, this is no longer required unless the DB models change.
The first time running Danswer, you will need to run the DB migrations.
Navigate to `danswer/backend` and with the venv active, run:
```bash
alembic upgrade head
```
To run the backend API server, navigate to `danswer/backend` and run:
Next, start the task queue which orchestrates the background jobs.
Jobs that take more time are run async from the API server.
Still in `danswer/backend`, run:
```bash
DISABLE_AUTH=True TYPESENSE_API_KEY=typesense_api_key DYNAMIC_CONFIG_DIR_PATH=./dynamic_config_storage uvicorn danswer.main:app --reload --port 8080
python ./scripts/dev_run_background_jobs.py
```
To run the backend API server, navigate back to `danswer/backend` and run:
```bash
AUTH_TYPE=disabled uvicorn danswer.main:app --reload --port 8080
```
_For Windows (for compatibility with both PowerShell and Command Prompt):_
```bash
powershell -Command " $env:DISABLE_AUTH='True'; $env:TYPESENSE_API_KEY='typesense_api_key'; $env:DYNAMIC_CONFIG_DIR_PATH='./dynamic_config_storage'; uvicorn danswer.main:app --reload --port 8080 "
```
To run the background job to check for connector updates and index documents, navigate to `danswer/backend` and run:
```bash
PYTHONPATH=. TYPESENSE_API_KEY=typesense_api_key DYNAMIC_CONFIG_DIR_PATH=./dynamic_config_storage python danswer/background/update.py
```
_For Windows:_
```bash
powershell -Command " $env:PYTHONPATH='.'; $env:TYPESENSE_API_KEY='typesense_api_key'; $env:DYNAMIC_CONFIG_DIR_PATH='./dynamic_config_storage'; python danswer/background/update.py "
```
To run the background job which handles deletion of connectors, navigate to `danswer/backend` and run:
```bash
PYTHONPATH=. TYPESENSE_API_KEY=typesense_api_key DYNAMIC_CONFIG_DIR_PATH=./dynamic_config_storage python danswer/background/connector_deletion.py
```
_For Windows:_
```bash
powershell -Command " $env:PYTHONPATH='.'; $env:TYPESENSE_API_KEY='typesense_api_key'; $env:DYNAMIC_CONFIG_DIR_PATH='./dynamic_config_storage'; python danswer/background/connector_deletion.py "
powershell -Command "
$env:AUTH_TYPE='disabled'
uvicorn danswer.main:app --reload --port 8080
"
```
Note: if you need finer logging, add the additional environment variable `LOG_LEVEL=DEBUG` to the relevant services.
@@ -176,20 +176,16 @@ pre-commit install
Additionally, we use `mypy` for static type checking.
Danswer is fully type-annotated, and we would like to keep it that way!
Right now, there is no automated type checking at the moment (coming soon), but we ask you to manually run it before
creating a pull requests with `python -m mypy .` from the `danswer/backend` directory.
To run the mypy checks manually, run `python -m mypy .` from the `danswer/backend` directory.
#### Web
We use `prettier` for formatting. The desired version (2.8.8) will be installed via a `npm i` from the `danswer/web` directory.
To run the formatter, use `npx prettier --write .` from the `danswer/web` directory.
Like `mypy`, we have no automated formatting yet (coming soon), but we request that, for now,
you run this manually before creating a pull request.
Please double check that prettier passes before creating a pull request.
### Release Process
Danswer follows the semver versioning standard.
A set of Docker containers will be pushed automatically to DockerHub with every tag.
You can see the containers [here](https://hub.docker.com/search?q=danswer%2F).
As pre-1.0 software, even patch releases may contain breaking or non-backwards-compatible changes.

View File

@@ -1,6 +1,10 @@
MIT License
Copyright (c) 2023-present DanswerAI, Inc.
Copyright (c) 2023 Yuhong Sun, Chris Weaver
Portions of this software are licensed as follows:
* All content that resides under "ee" directories of this repository, if that directory exists, is licensed under the license defined in "backend/ee/LICENSE". Specifically all content under "backend/ee" and "web/src/app/ee" is licensed under the license defined in "backend/ee/LICENSE".
* All third party components incorporated into the Danswer Software are licensed under the original license provided by the owner of the applicable component.
* Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

119
README.md
View File

@@ -1,15 +1,17 @@
<!-- DANSWER_METADATA={"link": "https://github.com/danswer-ai/danswer/blob/main/README.md"} -->
<h2 align="center">
<a href="https://www.danswer.ai/"> <img width="50%" src="https://github.com/danswer-owners/danswer/blob/1fabd9372d66cd54238847197c33f091a724803b/DanswerWithName.png?raw=true)" /></a>
</h2>
<p align="center">
<p align="center">OpenSource Enterprise Question-Answering</p>
<p align="center">Open Source Gen-AI Chat + Unified Search.</p>
<p align="center">
<a href="https://docs.danswer.dev/" target="_blank">
<img src="https://img.shields.io/badge/docs-view-blue" alt="Documentation">
</a>
<a href="https://join.slack.com/t/danswer/shared_invite/zt-1u5ycen3o-6SJbWfivLWP5LPyp_jftuw" target="_blank">
<a href="https://join.slack.com/t/danswer/shared_invite/zt-2lcmqw703-071hBuZBfNEOGUsLa5PXvQ" target="_blank">
<img src="https://img.shields.io/badge/slack-join-blue.svg?logo=slack" alt="Slack">
</a>
<a href="https://discord.gg/TDJ59cGV2X" target="_blank">
@@ -20,25 +22,108 @@
</a>
</p>
<strong>[Danswer](https://www.danswer.ai/)</strong> allows you to ask natural language questions against internal documents and get back reliable answers backed by quotes and references from the source material so that you can always trust what you get back. You can connect to a number of common tools such as Slack, GitHub, Confluence, amongst others.
<strong>[Danswer](https://www.danswer.ai/)</strong> is the AI Assistant connected to your company's docs, apps, and people.
Danswer provides a Chat interface and plugs into any LLM of your choice. Danswer can be deployed anywhere and for any
scale - on a laptop, on-premise, or to cloud. Since you own the deployment, your user data and chats are fully in your
own control. Danswer is MIT licensed and designed to be modular and easily extensible. The system also comes fully ready
for production usage with user authentication, role management (admin/basic users), chat persistence, and a UI for
configuring Personas (AI Assistants) and their Prompts.
Check out our <strong><a href="https://www.youtube.com/watch?v=geNzY1nbCnU">Video Demo</a></strong>!
Danswer also serves as a Unified Search across all common workplace tools such as Slack, Google Drive, Confluence, etc.
By combining LLMs and team specific knowledge, Danswer becomes a subject matter expert for the team. Imagine ChatGPT if
it had access to your team's unique knowledge! It enables questions such as "A customer wants feature X, is this already
supported?" or "Where's the pull request for feature Y?"
<h3>Usage</h3>
Danswer Web App:
https://github.com/danswer-ai/danswer/assets/32520769/563be14c-9304-47b5-bf0a-9049c2b6f410
## Features 💃
* Direct QA powered by Generative AI models with answers backed by quotes and source links.
* Intelligent Document Retrieval (Semantic Search/Reranking) using the latest LLMs.
* An AI Helper backed by a custom Deep Learning model to interpret user intent.
* User authentication and document level access management.
* Connectors to Slack, GitHub, GoogleDrive, Confluence, local files, and web scraping, with more to come.
* Option to use Opensource LLMs like Orca, Falcon etc. in place of OpenAI GPT.
* Management Dashboard to manage connectors and set up features such as live update fetching.
* One line Docker Compose (or Kubernetes) deployment to host Danswer anywhere.
Or, plug Danswer into your existing Slack workflows (more integrations to come 😁):
## Upcoming
* Chat/Conversation support.
* Templates to easily build custom connectors.
* Personalized search
https://github.com/danswer-ai/danswer/assets/25087905/3e19739b-d178-4371-9a38-011430bdec1b
For more details on the Admin UI to manage connectors and users, check out our
<strong><a href="https://www.youtube.com/watch?v=geNzY1nbCnU">Full Video Demo</a></strong>!
## Deployment
Danswer can easily be run locally (even on a laptop) or deployed on a virtual machine with a single
`docker compose` command. Checkout our [docs](https://docs.danswer.dev/quickstart) to learn more.
We also have built-in support for deployment on Kubernetes. Files for that can be found [here](https://github.com/danswer-ai/danswer/tree/main/deployment/kubernetes).
## 💃 Main Features
* Chat UI with the ability to select documents to chat with.
* Create custom AI Assistants with different prompts and backing knowledge sets.
* Connect Danswer with LLM of your choice (self-host for a fully airgapped solution).
* Document Search + AI Answers for natural language queries.
* Connectors to all common workplace tools like Google Drive, Confluence, Slack, etc.
* Slack integration to get answers and search results directly in Slack.
## 🚧 Roadmap
* Chat/Prompt sharing with specific teammates and user groups.
* Multi-Model model support, chat with images, video etc.
* Choosing between LLMs and parameters during chat session.
* Tool calling and agent configurations options.
* Organizational understanding and ability to locate and suggest experts from your team.
## Other Noteable Benefits of Danswer
* User Authentication with document level access management.
* Best in class Hybrid Search across all sources (BM-25 + prefix aware embedding models).
* Admin Dashboard to configure connectors, document-sets, access, etc.
* Custom deep learning models + learn from user feedback.
* Easy deployment and ability to host Danswer anywhere of your choosing.
## 🔌 Connectors
Efficiently pulls the latest changes from:
* Slack
* GitHub
* Google Drive
* Confluence
* Jira
* Zendesk
* Gmail
* Notion
* Gong
* Slab
* Linear
* Productboard
* Guru
* Bookstack
* Document360
* Sharepoint
* Hubspot
* Local Files
* Websites
* And more ...
## 📚 Editions
There are two editions of Danswer:
* Danswer Community Edition (CE) is available freely under the MIT Expat license. This version has ALL the core features discussed above. This is the version of Danswer you will get if you follow the Deployment guide above.
* Danswer Enterprise Edition (EE) includes extra features that are primarily useful for larger organizations. Specifically, this includes:
* Single Sign-On (SSO), with support for both SAML and OIDC
* Role-based access control
* Document permission inheritance from connected sources
* Usage analytics and query history accessible to admins
* Whitelabeling
* API key authentication
* Encryption of secrets
* Any many more! Checkout [our website](https://www.danswer.ai/) for the latest.
To try the Danswer Enterprise Edition:
1. Checkout our [Cloud product](https://app.danswer.ai/signup).
2. For self-hosting, contact us at [founders@danswer.ai](mailto:founders@danswer.ai) or book a call with us on our [Cal](https://cal.com/team/danswer/founders).
## 💡 Contributing
Looking to contribute? Please check out the [Contribution Guide](CONTRIBUTING.md) for more details.

17
backend/.dockerignore Normal file
View File

@@ -0,0 +1,17 @@
**/__pycache__
venv/
env/
*.egg-info
.cache
.git/
.svn/
.vscode/
.idea/
*.log
log/
.env
secrets.yaml
build/
dist/
.coverage
htmlcov/

8
backend/.gitignore vendored
View File

@@ -1,9 +1,11 @@
__pycache__/
.mypy_cache
.idea/
site_crawls/
.ipynb_checkpoints/
api_keys.py
*ipynb
qdrant-data/
typesense-data/
.env
.env*
vespa-app.zip
dynamic_config_storage/
celerybeat-schedule*

46
backend/.trivyignore Normal file
View File

@@ -0,0 +1,46 @@
# https://github.com/madler/zlib/issues/868
# Pulled in with base Debian image, it's part of the contrib folder but unused
# zlib1g is fine
# Will be gone with Debian image upgrade
# No impact in our settings
CVE-2023-45853
# krb5 related, worst case is denial of service by resource exhaustion
# Accept the risk
CVE-2024-26458
CVE-2024-26461
CVE-2024-26462
CVE-2024-26458
CVE-2024-26461
CVE-2024-26462
CVE-2024-26458
CVE-2024-26461
CVE-2024-26462
CVE-2024-26458
CVE-2024-26461
CVE-2024-26462
# Specific to Firefox which we do not use
# No impact in our settings
CVE-2024-0743
# bind9 related, worst case is denial of service by CPU resource exhaustion
# Accept the risk
CVE-2023-50387
CVE-2023-50868
CVE-2023-50387
CVE-2023-50868
# libexpat1, XML parsing resource exhaustion
# We don't parse any user provided XMLs
# No impact in our settings
CVE-2023-52425
CVE-2024-28757
# sqlite, only used by NLTK library to grab word lemmatizer and stopwords
# No impact in our settings
CVE-2023-7104
# libharfbuzz0b, O(n^2) growth, worst case is denial of service
# Accept the risk
CVE-2023-25193

View File

@@ -1,23 +1,103 @@
FROM python:3.11-slim-bullseye
FROM python:3.11.7-slim-bookworm
RUN apt-get update \
&& apt-get install -y git cmake pkg-config libprotobuf-c-dev protobuf-compiler \
libprotobuf-dev libgoogle-perftools-dev libpq-dev build-essential cron curl \
supervisor \
&& rm -rf /var/lib/apt/lists/*
LABEL com.danswer.maintainer="founders@danswer.ai"
LABEL com.danswer.description="This image is the web/frontend container of Danswer which \
contains code for both the Community and Enterprise editions of Danswer. If you do not \
have a contract or agreement with DanswerAI, you are not permitted to use the Enterprise \
Edition features outside of personal development or testing purposes. Please reach out to \
founders@danswer.ai for more information. Please visit https://github.com/danswer-ai/danswer"
# Default DANSWER_VERSION, typically overriden during builds by GitHub Actions.
ARG DANSWER_VERSION=0.3-dev
ENV DANSWER_VERSION=${DANSWER_VERSION}
RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}"
# Install system dependencies
# cmake needed for psycopg (postgres)
# libpq-dev needed for psycopg (postgres)
# curl included just for users' convenience
# zip for Vespa step futher down
# ca-certificates for HTTPS
RUN apt-get update && \
apt-get install -y \
cmake \
curl \
zip \
ca-certificates \
libgnutls30=3.7.9-2+deb12u3 \
libblkid1=2.38.1-5+deb12u1 \
libmount1=2.38.1-5+deb12u1 \
libsmartcols1=2.38.1-5+deb12u1 \
libuuid1=2.38.1-5+deb12u1 \
libxmlsec1-dev \
pkg-config \
gcc && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
# Install Python dependencies
# Remove py which is pulled in by retry, py is not needed and is a CVE
COPY ./requirements/default.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
RUN playwright install
RUN playwright install-deps
COPY ./requirements/ee.txt /tmp/ee-requirements.txt
RUN pip install --no-cache-dir --upgrade \
-r /tmp/requirements.txt \
-r /tmp/ee-requirements.txt && \
pip uninstall -y py && \
playwright install chromium && \
playwright install-deps chromium && \
ln -s /usr/local/bin/supervisord /usr/bin/supervisord
# Cleanup for CVEs and size reduction
# https://github.com/tornadoweb/tornado/issues/3107
# xserver-common and xvfb included by playwright installation but not needed after
# perl-base is part of the base Python Debian image but not needed for Danswer functionality
# perl-base could only be removed with --allow-remove-essential
RUN apt-get update && \
apt-get remove -y --allow-remove-essential \
perl-base \
xserver-common \
xvfb \
cmake \
libldap-2.5-0 \
libxmlsec1-dev \
pkg-config \
gcc && \
apt-get install -y libxmlsec1-openssl && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
rm -f /usr/local/lib/python3.11/site-packages/tornado/test/test.key
# Pre-downloading models for setups with limited egress
RUN python -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('intfloat/e5-base-v2')"
# Pre-downloading NLTK for setups with limited egress
RUN python -c "import nltk; \
nltk.download('stopwords', quiet=True); \
nltk.download('wordnet', quiet=True); \
nltk.download('punkt', quiet=True);"
# Set up application files
WORKDIR /app
# Enterprise Version Files
COPY ./ee /app/ee
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set up application files
COPY ./danswer /app/danswer
COPY ./shared_configs /app/shared_configs
COPY ./alembic /app/alembic
COPY ./alembic.ini /app/alembic.ini
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY supervisord.conf /usr/etc/supervisord.conf
# Escape hatch
COPY ./scripts/force_delete_connector_by_id.py /app/scripts/force_delete_connector_by_id.py
# Put logo in assets
COPY ./assets /app/assets
ENV PYTHONPATH /app
# By default this container does nothing, it is used by api server and background which specify their own CMD
# Default command which does nothing
# This container is used by api server and background which specify their own CMD
CMD ["tail", "-f", "/dev/null"]

View File

@@ -0,0 +1,46 @@
FROM python:3.11.7-slim-bookworm
LABEL com.danswer.maintainer="founders@danswer.ai"
LABEL com.danswer.description="This image is for the Danswer model server which runs all of the \
AI models for Danswer. This container and all the code is MIT Licensed and free for all to use. \
You can find it at https://hub.docker.com/r/danswer/danswer-model-server. For more details, \
visit https://github.com/danswer-ai/danswer."
# Default DANSWER_VERSION, typically overriden during builds by GitHub Actions.
ARG DANSWER_VERSION=0.3-dev
ENV DANSWER_VERSION=${DANSWER_VERSION}
RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}"
COPY ./requirements/model_server.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
RUN apt-get remove -y --allow-remove-essential perl-base && \
apt-get autoremove -y
# Pre-downloading models for setups with limited egress
RUN python -c "from transformers import AutoModel, AutoTokenizer, TFDistilBertForSequenceClassification; \
from huggingface_hub import snapshot_download; \
AutoTokenizer.from_pretrained('danswer/intent-model'); \
AutoTokenizer.from_pretrained('intfloat/e5-base-v2'); \
AutoTokenizer.from_pretrained('mixedbread-ai/mxbai-rerank-xsmall-v1'); \
snapshot_download('danswer/intent-model'); \
snapshot_download('intfloat/e5-base-v2'); \
snapshot_download('mixedbread-ai/mxbai-rerank-xsmall-v1')"
WORKDIR /app
# Utils used by model server
COPY ./danswer/utils/logger.py /app/danswer/utils/logger.py
# Place to fetch version information
COPY ./danswer/__init__.py /app/danswer/__init__.py
# Shared between Danswer Backend and Model Server
COPY ./shared_configs /app/shared_configs
# Model Server main code
COPY ./model_server /app/model_server
ENV PYTHONPATH /app
CMD ["uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "9000"]

View File

@@ -1,4 +1,8 @@
Generic single-database configuration with an async dbapi.
<!-- DANSWER_METADATA={"link": "https://github.com/danswer-ai/danswer/blob/main/backend/alembic/README.md"} -->
# Alembic DB Migrations
These files are for creating/updating the tables in the Relational DB (Postgres).
Danswer migrations use a generic single-database configuration with an async dbapi.
## To generate new migrations:
run from danswer/backend:
@@ -7,7 +11,6 @@ run from danswer/backend:
More info can be found here: https://alembic.sqlalchemy.org/en/latest/autogenerate.html
## Running migrations
To run all un-applied migrations:
`alembic upgrade head`

View File

@@ -7,6 +7,7 @@ from danswer.db.models import Base
from sqlalchemy import pool
from sqlalchemy.engine import Connection
from sqlalchemy.ext.asyncio import create_async_engine
from celery.backends.database.session import ResultModelBase # type: ignore
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
@@ -21,7 +22,7 @@ if config.config_file_name is not None:
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
target_metadata = Base.metadata
target_metadata = [Base.metadata, ResultModelBase.metadata]
# other values from the config, defined by the needs of env.py,
# can be acquired:
@@ -44,7 +45,7 @@ def run_migrations_offline() -> None:
url = build_connection_string()
context.configure(
url=url,
target_metadata=target_metadata,
target_metadata=target_metadata, # type: ignore
literal_binds=True,
dialect_opts={"paramstyle": "named"},
)
@@ -54,7 +55,7 @@ def run_migrations_offline() -> None:
def do_run_migrations(connection: Connection) -> None:
context.configure(connection=connection, target_metadata=target_metadata)
context.configure(connection=connection, target_metadata=target_metadata) # type: ignore
with context.begin_transaction():
context.run_migrations()

View File

@@ -0,0 +1,31 @@
"""Add thread specific model selection
Revision ID: 0568ccf46a6b
Revises: e209dc5a8156
Create Date: 2024-06-19 14:25:36.376046
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "0568ccf46a6b"
down_revision = "e209dc5a8156"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"chat_session",
sa.Column("current_alternate_model", sa.String(), nullable=True),
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("chat_session", "current_alternate_model")
# ### end Alembic commands ###

View File

@@ -0,0 +1,32 @@
"""add search doc relevance details
Revision ID: 05c07bf07c00
Revises: b896bbd0d5a7
Create Date: 2024-07-10 17:48:15.886653
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "05c07bf07c00"
down_revision = "b896bbd0d5a7"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"search_doc",
sa.Column("is_relevant", sa.Boolean(), nullable=True),
)
op.add_column(
"search_doc",
sa.Column("relevance_explanation", sa.String(), nullable=True),
)
def downgrade() -> None:
op.drop_column("search_doc", "relevance_explanation")
op.drop_column("search_doc", "is_relevant")

View File

@@ -0,0 +1,31 @@
"""Add starter prompts
Revision ID: 0a2b51deb0b8
Revises: 5f4b8568a221
Create Date: 2024-03-02 23:23:49.960309
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "0a2b51deb0b8"
down_revision = "5f4b8568a221"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"persona",
sa.Column(
"starter_messages",
postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
),
)
def downgrade() -> None:
op.drop_column("persona", "starter_messages")

View File

@@ -0,0 +1,113 @@
"""Enable Encrypted Fields
Revision ID: 0a98909f2757
Revises: 570282d33c49
Create Date: 2024-05-05 19:30:34.317972
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table
from sqlalchemy.dialects import postgresql
import json
from danswer.utils.encryption import encrypt_string_to_bytes
# revision identifiers, used by Alembic.
revision = "0a98909f2757"
down_revision = "570282d33c49"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
connection = op.get_bind()
op.alter_column("key_value_store", "value", nullable=True)
op.add_column(
"key_value_store",
sa.Column(
"encrypted_value",
sa.LargeBinary,
nullable=True,
),
)
# Need a temporary column to translate the JSONB to binary
op.add_column("credential", sa.Column("temp_column", sa.LargeBinary()))
creds_table = table(
"credential",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"credential_json",
postgresql.JSONB(astext_type=sa.Text()),
nullable=False,
),
sa.Column(
"temp_column",
sa.LargeBinary(),
nullable=False,
),
)
results = connection.execute(sa.select(creds_table))
# This uses the MIT encrypt which does not actually encrypt the credentials
# In other words, this upgrade does not apply the encryption. Porting existing sensitive data
# and key rotation currently is not supported and will come out in the future
for row_id, creds, _ in results:
creds_binary = encrypt_string_to_bytes(json.dumps(creds))
connection.execute(
creds_table.update()
.where(creds_table.c.id == row_id)
.values(temp_column=creds_binary)
)
op.drop_column("credential", "credential_json")
op.alter_column("credential", "temp_column", new_column_name="credential_json")
op.add_column("llm_provider", sa.Column("temp_column", sa.LargeBinary()))
llm_table = table(
"llm_provider",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"api_key",
sa.String(),
nullable=False,
),
sa.Column(
"temp_column",
sa.LargeBinary(),
nullable=False,
),
)
results = connection.execute(sa.select(llm_table))
for row_id, api_key, _ in results:
llm_key = encrypt_string_to_bytes(api_key)
connection.execute(
llm_table.update()
.where(llm_table.c.id == row_id)
.values(temp_column=llm_key)
)
op.drop_column("llm_provider", "api_key")
op.alter_column("llm_provider", "temp_column", new_column_name="api_key")
def downgrade() -> None:
# Some information loss but this is ok. Should not allow decryption via downgrade.
op.drop_column("credential", "credential_json")
op.drop_column("llm_provider", "api_key")
op.add_column("llm_provider", sa.Column("api_key", sa.String()))
op.add_column(
"credential",
sa.Column("credential_json", postgresql.JSONB(astext_type=sa.Text())),
)
op.execute("DELETE FROM key_value_store WHERE value IS NULL")
op.alter_column("key_value_store", "value", nullable=False)
op.drop_column("key_value_store", "encrypted_value")

View File

@@ -0,0 +1,37 @@
"""Introduce Danswer APIs
Revision ID: 15326fcec57e
Revises: 77d07dffae64
Create Date: 2023-11-11 20:51:24.228999
"""
from alembic import op
import sqlalchemy as sa
from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "15326fcec57e"
down_revision = "77d07dffae64"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.alter_column("credential", "is_admin", new_column_name="admin_public")
op.add_column(
"document",
sa.Column("from_ingestion_api", sa.Boolean(), nullable=True),
)
op.alter_column(
"connector",
"source",
type_=sa.String(length=50),
existing_type=sa.Enum(DocumentSource, native_enum=False),
existing_nullable=False,
)
def downgrade() -> None:
op.drop_column("document", "from_ingestion_api")
op.alter_column("credential", "admin_public", new_column_name="is_admin")

View File

@@ -0,0 +1,29 @@
"""Port Config Store
Revision ID: 173cae5bba26
Revises: e50154680a5c
Create Date: 2024-03-19 15:30:44.425436
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "173cae5bba26"
down_revision = "e50154680a5c"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"key_value_store",
sa.Column("key", sa.String(), nullable=False),
sa.Column("value", postgresql.JSONB(astext_type=sa.Text()), nullable=False),
sa.PrimaryKeyConstraint("key"),
)
def downgrade() -> None:
op.drop_table("key_value_store")

View File

@@ -0,0 +1,86 @@
"""remove-feedback-foreignkey-constraint
Revision ID: 23957775e5f5
Revises: bc9771dccadf
Create Date: 2024-06-27 16:04:51.480437
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "23957775e5f5"
down_revision = "bc9771dccadf"
branch_labels = None # type: ignore
depends_on = None # type: ignore
def upgrade() -> None:
op.drop_constraint(
"chat_feedback__chat_message_fk", "chat_feedback", type_="foreignkey"
)
op.create_foreign_key(
"chat_feedback__chat_message_fk",
"chat_feedback",
"chat_message",
["chat_message_id"],
["id"],
ondelete="SET NULL",
)
op.alter_column(
"chat_feedback", "chat_message_id", existing_type=sa.Integer(), nullable=True
)
op.drop_constraint(
"document_retrieval_feedback__chat_message_fk",
"document_retrieval_feedback",
type_="foreignkey",
)
op.create_foreign_key(
"document_retrieval_feedback__chat_message_fk",
"document_retrieval_feedback",
"chat_message",
["chat_message_id"],
["id"],
ondelete="SET NULL",
)
op.alter_column(
"document_retrieval_feedback",
"chat_message_id",
existing_type=sa.Integer(),
nullable=True,
)
def downgrade() -> None:
op.alter_column(
"chat_feedback", "chat_message_id", existing_type=sa.Integer(), nullable=False
)
op.drop_constraint(
"chat_feedback__chat_message_fk", "chat_feedback", type_="foreignkey"
)
op.create_foreign_key(
"chat_feedback__chat_message_fk",
"chat_feedback",
"chat_message",
["chat_message_id"],
["id"],
)
op.alter_column(
"document_retrieval_feedback",
"chat_message_id",
existing_type=sa.Integer(),
nullable=False,
)
op.drop_constraint(
"document_retrieval_feedback__chat_message_fk",
"document_retrieval_feedback",
type_="foreignkey",
)
op.create_foreign_key(
"document_retrieval_feedback__chat_message_fk",
"document_retrieval",
"chat_message",
["chat_message_id"],
["id"],
)

View File

@@ -13,8 +13,8 @@ from alembic import op
# revision identifiers, used by Alembic.
revision = "2666d766cb9b"
down_revision = "6d387b3196c2"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -13,8 +13,8 @@ from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "27c6ecc08586"
down_revision = "2666d766cb9b"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,37 @@
"""Persona Datetime Aware
Revision ID: 30c1d5744104
Revises: 7f99be1cb9f5
Create Date: 2023-10-16 23:21:01.283424
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "30c1d5744104"
down_revision = "7f99be1cb9f5"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column("persona", sa.Column("datetime_aware", sa.Boolean(), nullable=True))
op.execute("UPDATE persona SET datetime_aware = TRUE")
op.alter_column("persona", "datetime_aware", nullable=False)
op.create_index(
"_default_persona_name_idx",
"persona",
["name"],
unique=True,
postgresql_where=sa.text("default_persona = true"),
)
def downgrade() -> None:
op.drop_index(
"_default_persona_name_idx",
table_name="persona",
postgresql_where=sa.text("default_persona = true"),
)
op.drop_column("persona", "datetime_aware")

View File

@@ -0,0 +1,45 @@
"""Add tool table
Revision ID: 3879338f8ba1
Revises: f1c6478c3fd8
Create Date: 2024-05-11 16:11:23.718084
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "3879338f8ba1"
down_revision = "f1c6478c3fd8"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"tool",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("description", sa.Text(), nullable=True),
sa.Column("in_code_tool_id", sa.String(), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"persona__tool",
sa.Column("persona_id", sa.Integer(), nullable=False),
sa.Column("tool_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["persona_id"],
["persona.id"],
),
sa.ForeignKeyConstraint(
["tool_id"],
["tool.id"],
),
sa.PrimaryKeyConstraint("persona_id", "tool_id"),
)
def downgrade() -> None:
op.drop_table("persona__tool")
op.drop_table("tool")

View File

@@ -0,0 +1,41 @@
"""Add chat session sharing
Revision ID: 38eda64af7fe
Revises: 776b3bbe9092
Create Date: 2024-03-27 19:41:29.073594
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "38eda64af7fe"
down_revision = "776b3bbe9092"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"chat_session",
sa.Column(
"shared_status",
sa.Enum(
"PUBLIC",
"PRIVATE",
name="chatsessionsharedstatus",
native_enum=False,
),
nullable=True,
),
)
op.execute("UPDATE chat_session SET shared_status='PRIVATE'")
op.alter_column(
"chat_session",
"shared_status",
nullable=False,
)
def downgrade() -> None:
op.drop_column("chat_session", "shared_status")

View File

@@ -0,0 +1,38 @@
"""add alternate assistant to chat message
Revision ID: 3a7802814195
Revises: 23957775e5f5
Create Date: 2024-06-05 11:18:49.966333
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "3a7802814195"
down_revision = "23957775e5f5"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"chat_message", sa.Column("alternate_assistant_id", sa.Integer(), nullable=True)
)
op.create_foreign_key(
"fk_chat_message_persona",
"chat_message",
"persona",
["alternate_assistant_id"],
["id"],
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint("fk_chat_message_persona", "chat_message", type_="foreignkey")
op.drop_column("chat_message", "alternate_assistant_id")

View File

@@ -0,0 +1,49 @@
"""Move is_public to cc_pair
Revision ID: 3b25685ff73c
Revises: e0a68a81d434
Create Date: 2023-10-05 18:47:09.582849
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "3b25685ff73c"
down_revision = "e0a68a81d434"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"connector_credential_pair",
sa.Column("is_public", sa.Boolean(), nullable=True),
)
# fill in is_public for existing rows
op.execute(
"UPDATE connector_credential_pair SET is_public = true WHERE is_public IS NULL"
)
op.alter_column("connector_credential_pair", "is_public", nullable=False)
op.add_column(
"credential",
sa.Column("is_admin", sa.Boolean(), nullable=True),
)
op.execute("UPDATE credential SET is_admin = true WHERE is_admin IS NULL")
op.alter_column("credential", "is_admin", nullable=False)
op.drop_column("credential", "public_doc")
def downgrade() -> None:
op.add_column(
"credential",
sa.Column("public_doc", sa.Boolean(), nullable=True),
)
# setting public_doc to false for all existing rows to be safe
# NOTE: this is likely not the correct state of the world but it's the best we can do
op.execute("UPDATE credential SET public_doc = false WHERE public_doc IS NULL")
op.alter_column("credential", "public_doc", nullable=False)
op.drop_column("connector_credential_pair", "is_public")
op.drop_column("credential", "is_admin")

View File

@@ -12,8 +12,8 @@ from alembic import op
# revision identifiers, used by Alembic.
revision = "3c5e35aa9af0"
down_revision = "27c6ecc08586"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
@@ -35,6 +35,7 @@ def upgrade() -> None:
"SUCCESS",
"FAILED",
name="indexingstatus",
native_enum=False,
),
nullable=False,
),

View File

@@ -0,0 +1,49 @@
"""Add tables for UI-based LLM configuration
Revision ID: 401c1ac29467
Revises: 703313b75876
Create Date: 2024-04-13 18:07:29.153817
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "401c1ac29467"
down_revision = "703313b75876"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"llm_provider",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("api_key", sa.String(), nullable=True),
sa.Column("api_base", sa.String(), nullable=True),
sa.Column("api_version", sa.String(), nullable=True),
sa.Column(
"custom_config",
postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
),
sa.Column("default_model_name", sa.String(), nullable=False),
sa.Column("fast_default_model_name", sa.String(), nullable=True),
sa.Column("is_default_provider", sa.Boolean(), unique=True, nullable=True),
sa.Column("model_names", postgresql.ARRAY(sa.String()), nullable=True),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
op.add_column(
"persona",
sa.Column("llm_model_provider_override", sa.String(), nullable=True),
)
def downgrade() -> None:
op.drop_column("persona", "llm_model_provider_override")
op.drop_table("llm_provider")

View File

@@ -0,0 +1,65 @@
"""add cloud embedding model and update embedding_model
Revision ID: 44f856ae2a4a
Revises: d716b0791ddd
Create Date: 2024-06-28 20:01:05.927647
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "44f856ae2a4a"
down_revision = "d716b0791ddd"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
# Create embedding_provider table
op.create_table(
"embedding_provider",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("api_key", sa.LargeBinary(), nullable=True),
sa.Column("default_model_id", sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
# Add cloud_provider_id to embedding_model table
op.add_column(
"embedding_model", sa.Column("cloud_provider_id", sa.Integer(), nullable=True)
)
# Add foreign key constraints
op.create_foreign_key(
"fk_embedding_model_cloud_provider",
"embedding_model",
"embedding_provider",
["cloud_provider_id"],
["id"],
)
op.create_foreign_key(
"fk_embedding_provider_default_model",
"embedding_provider",
"embedding_model",
["default_model_id"],
["id"],
)
def downgrade() -> None:
# Remove foreign key constraints
op.drop_constraint(
"fk_embedding_model_cloud_provider", "embedding_model", type_="foreignkey"
)
op.drop_constraint(
"fk_embedding_provider_default_model", "embedding_provider", type_="foreignkey"
)
# Remove cloud_provider_id column
op.drop_column("embedding_model", "cloud_provider_id")
# Drop embedding_provider table
op.drop_table("embedding_provider")

View File

@@ -0,0 +1,23 @@
"""added is_internet to DBDoc
Revision ID: 4505fd7302e1
Revises: c18cdf4b497e
Create Date: 2024-06-18 20:46:09.095034
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "4505fd7302e1"
down_revision = "c18cdf4b497e"
def upgrade() -> None:
op.add_column("search_doc", sa.Column("is_internet", sa.Boolean(), nullable=True))
op.add_column("tool", sa.Column("display_name", sa.String(), nullable=True))
def downgrade() -> None:
op.drop_column("tool", "display_name")
op.drop_column("search_doc", "is_internet")

View File

@@ -12,8 +12,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "465f78d9b7f9"
down_revision = "3c5e35aa9af0"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,31 @@
"""Remove Native Enum
Revision ID: 46625e4745d4
Revises: 9d97fecfab7f
Create Date: 2023-10-27 11:38:33.803145
"""
from alembic import op
from sqlalchemy import String
# revision identifiers, used by Alembic.
revision = "46625e4745d4"
down_revision = "9d97fecfab7f"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
# At this point, we directly changed some previous migrations,
# https://github.com/danswer-ai/danswer/pull/637
# Due to using Postgres native Enums, it caused some complications for first time users.
# To remove those complications, all Enums are only handled application side moving forward.
# This migration exists to ensure that existing users don't run into upgrade issues.
op.alter_column("index_attempt", "status", type_=String)
op.alter_column("connector_credential_pair", "last_attempt_status", type_=String)
op.execute("DROP TYPE IF EXISTS indexingstatus")
def downgrade() -> None:
# We don't want Native Enums, do nothing
pass

View File

@@ -0,0 +1,28 @@
"""PG File Store
Revision ID: 4738e4b3bae1
Revises: e91df4e935ef
Create Date: 2024-03-20 18:53:32.461518
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "4738e4b3bae1"
down_revision = "e91df4e935ef"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"file_store",
sa.Column("file_name", sa.String(), nullable=False),
sa.Column("lobj_oid", sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint("file_name"),
)
def downgrade() -> None:
op.drop_table("file_store")

View File

@@ -1,7 +1,7 @@
"""Create IndexAttempt table
Revision ID: 47433d30de82
Revises:
Revises:
Create Date: 2023-05-04 00:55:32.971991
"""
@@ -11,9 +11,9 @@ from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "47433d30de82"
down_revision = None
branch_labels = None
depends_on = None
down_revision: None = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
@@ -59,6 +59,7 @@ def upgrade() -> None:
"SUCCESS",
"FAILED",
name="indexingstatus",
native_enum=False,
),
nullable=False,
),
@@ -70,4 +71,3 @@ def upgrade() -> None:
def downgrade() -> None:
op.drop_table("index_attempt")
sa.Enum(name="indexingstatus").drop(op.get_bind(), checkfirst=False)

View File

@@ -0,0 +1,23 @@
"""Add name to api_key
Revision ID: 475fcefe8826
Revises: ecab2b3f1a3b
Create Date: 2024-04-11 11:05:18.414438
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "475fcefe8826"
down_revision = "ecab2b3f1a3b"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column("api_key", sa.Column("name", sa.String(), nullable=True))
def downgrade() -> None:
op.drop_column("api_key", "name")

View File

@@ -0,0 +1,61 @@
"""Add support for custom tools
Revision ID: 48d14957fe80
Revises: b85f02ec1308
Create Date: 2024-06-09 14:58:19.946509
"""
from alembic import op
import fastapi_users_db_sqlalchemy
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "48d14957fe80"
down_revision = "b85f02ec1308"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"tool",
sa.Column(
"openapi_schema",
postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
),
)
op.add_column(
"tool",
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
)
op.create_foreign_key("tool_user_fk", "tool", "user", ["user_id"], ["id"])
op.create_table(
"tool_call",
sa.Column("id", sa.Integer(), primary_key=True),
sa.Column("tool_id", sa.Integer(), nullable=False),
sa.Column("tool_name", sa.String(), nullable=False),
sa.Column(
"tool_arguments", postgresql.JSONB(astext_type=sa.Text()), nullable=False
),
sa.Column(
"tool_result", postgresql.JSONB(astext_type=sa.Text()), nullable=False
),
sa.Column(
"message_id", sa.Integer(), sa.ForeignKey("chat_message.id"), nullable=False
),
)
def downgrade() -> None:
op.drop_table("tool_call")
op.drop_constraint("tool_user_fk", "tool", type_="foreignkey")
op.drop_column("tool", "user_id")
op.drop_column("tool", "openapi_schema")

View File

@@ -0,0 +1,28 @@
"""Add additional retrieval controls to Persona
Revision ID: 50b683a8295c
Revises: 7da0ae5ad583
Create Date: 2023-11-27 17:23:29.668422
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "50b683a8295c"
down_revision = "7da0ae5ad583"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column("persona", sa.Column("num_chunks", sa.Integer(), nullable=True))
op.add_column(
"persona",
sa.Column("apply_llm_relevance_filter", sa.Boolean(), nullable=True),
)
def downgrade() -> None:
op.drop_column("persona", "apply_llm_relevance_filter")
op.drop_column("persona", "num_chunks")

View File

@@ -0,0 +1,27 @@
"""Track Danswerbot Explicitly
Revision ID: 570282d33c49
Revises: 7547d982db8f
Create Date: 2024-05-04 17:49:28.568109
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "570282d33c49"
down_revision = "7547d982db8f"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"chat_session", sa.Column("danswerbot_flow", sa.Boolean(), nullable=True)
)
op.execute("UPDATE chat_session SET danswerbot_flow = one_shot")
op.alter_column("chat_session", "danswerbot_flow", nullable=False)
def downgrade() -> None:
op.drop_column("chat_session", "danswerbot_flow")

View File

@@ -0,0 +1,59 @@
"""Add document set tables
Revision ID: 57b53544726e
Revises: 800f48024ae9
Create Date: 2023-09-20 16:59:39.097177
"""
from alembic import op
import fastapi_users_db_sqlalchemy
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "57b53544726e"
down_revision = "800f48024ae9"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"document_set",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("description", sa.String(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column("is_up_to_date", sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
op.create_table(
"document_set__connector_credential_pair",
sa.Column("document_set_id", sa.Integer(), nullable=False),
sa.Column("connector_credential_pair_id", sa.Integer(), nullable=False),
sa.Column("is_current", sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
["connector_credential_pair_id"],
["connector_credential_pair.id"],
),
sa.ForeignKeyConstraint(
["document_set_id"],
["document_set.id"],
),
sa.PrimaryKeyConstraint(
"document_set_id", "connector_credential_pair_id", "is_current"
),
)
def downgrade() -> None:
op.drop_table("document_set__connector_credential_pair")
op.drop_table("document_set")

View File

@@ -0,0 +1,85 @@
"""Add Chat Sessions
Revision ID: 5809c0787398
Revises: d929f0c1c6af
Create Date: 2023-09-04 15:29:44.002164
"""
import fastapi_users_db_sqlalchemy
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5809c0787398"
down_revision = "d929f0c1c6af"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"chat_session",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column("description", sa.Text(), nullable=False),
sa.Column("deleted", sa.Boolean(), nullable=False),
sa.Column(
"time_updated",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.Column(
"time_created",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"chat_message",
sa.Column("chat_session_id", sa.Integer(), nullable=False),
sa.Column("message_number", sa.Integer(), nullable=False),
sa.Column("edit_number", sa.Integer(), nullable=False),
sa.Column("parent_edit_number", sa.Integer(), nullable=True),
sa.Column("latest", sa.Boolean(), nullable=False),
sa.Column("message", sa.Text(), nullable=False),
sa.Column(
"message_type",
sa.Enum(
"SYSTEM",
"USER",
"ASSISTANT",
"DANSWER",
name="messagetype",
native_enum=False,
),
nullable=False,
),
sa.Column(
"time_sent",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.ForeignKeyConstraint(
["chat_session_id"],
["chat_session.id"],
),
sa.PrimaryKeyConstraint("chat_session_id", "message_number", "edit_number"),
)
def downgrade() -> None:
op.drop_table("chat_message")
op.drop_table("chat_session")

View File

@@ -12,8 +12,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5e84129c8be3"
down_revision = "e6a4bbc13fe4"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,27 @@
"""add removed documents to index_attempt
Revision ID: 5f4b8568a221
Revises: dbaa756c2ccf
Create Date: 2024-02-16 15:02:03.319907
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5f4b8568a221"
down_revision = "8987770549c0"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"index_attempt",
sa.Column("docs_removed_from_index", sa.Integer()),
)
op.execute("UPDATE index_attempt SET docs_removed_from_index = 0")
def downgrade() -> None:
op.drop_column("index_attempt", "docs_removed_from_index")

View File

@@ -0,0 +1,45 @@
"""Add user-configured names to LLMProvider
Revision ID: 643a84a42a33
Revises: 0a98909f2757
Create Date: 2024-05-07 14:54:55.493100
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "643a84a42a33"
down_revision = "0a98909f2757"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column("llm_provider", sa.Column("provider", sa.String(), nullable=True))
# move "name" -> "provider" to match the new schema
op.execute("UPDATE llm_provider SET provider = name")
# pretty up display name
op.execute("UPDATE llm_provider SET name = 'OpenAI' WHERE name = 'openai'")
op.execute("UPDATE llm_provider SET name = 'Anthropic' WHERE name = 'anthropic'")
op.execute("UPDATE llm_provider SET name = 'Azure OpenAI' WHERE name = 'azure'")
op.execute("UPDATE llm_provider SET name = 'AWS Bedrock' WHERE name = 'bedrock'")
# update personas to use the new provider names
op.execute(
"UPDATE persona SET llm_model_provider_override = 'OpenAI' WHERE llm_model_provider_override = 'openai'"
)
op.execute(
"UPDATE persona SET llm_model_provider_override = 'Anthropic' WHERE llm_model_provider_override = 'anthropic'"
)
op.execute(
"UPDATE persona SET llm_model_provider_override = 'Azure OpenAI' WHERE llm_model_provider_override = 'azure'"
)
op.execute(
"UPDATE persona SET llm_model_provider_override = 'AWS Bedrock' WHERE llm_model_provider_override = 'bedrock'"
)
def downgrade() -> None:
op.execute("UPDATE llm_provider SET name = provider")
op.drop_column("llm_provider", "provider")

View File

@@ -13,8 +13,8 @@ from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "6d387b3196c2"
down_revision = "47433d30de82"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,83 @@
"""Add TokenRateLimit Tables
Revision ID: 703313b75876
Revises: fad14119fb92
Create Date: 2024-04-15 01:36:02.952809
"""
import json
from typing import cast
from alembic import op
import sqlalchemy as sa
from danswer.dynamic_configs.factory import get_dynamic_config_store
# revision identifiers, used by Alembic.
revision = "703313b75876"
down_revision = "fad14119fb92"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"token_rate_limit",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("enabled", sa.Boolean(), nullable=False),
sa.Column("token_budget", sa.Integer(), nullable=False),
sa.Column("period_hours", sa.Integer(), nullable=False),
sa.Column(
"scope",
sa.String(length=10),
nullable=False,
),
sa.Column(
"created_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"token_rate_limit__user_group",
sa.Column("rate_limit_id", sa.Integer(), nullable=False),
sa.Column("user_group_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["rate_limit_id"],
["token_rate_limit.id"],
),
sa.ForeignKeyConstraint(
["user_group_id"],
["user_group.id"],
),
sa.PrimaryKeyConstraint("rate_limit_id", "user_group_id"),
)
try:
settings_json = cast(
str, get_dynamic_config_store().load("token_budget_settings")
)
settings = json.loads(settings_json)
is_enabled = settings.get("enable_token_budget", False)
token_budget = settings.get("token_budget", -1)
period_hours = settings.get("period_hours", -1)
if is_enabled and token_budget > 0 and period_hours > 0:
op.execute(
f"INSERT INTO token_rate_limit \
(enabled, token_budget, period_hours, scope) VALUES \
({is_enabled}, {token_budget}, {period_hours}, 'GLOBAL')"
)
# Delete the dynamic config
get_dynamic_config_store().delete("token_budget_settings")
except Exception:
# Ignore if the dynamic config is not found
pass
def downgrade() -> None:
op.drop_table("token_rate_limit__user_group")
op.drop_table("token_rate_limit")

View File

@@ -0,0 +1,68 @@
"""More Descriptive Filestore
Revision ID: 70f00c45c0f2
Revises: 3879338f8ba1
Create Date: 2024-05-17 17:51:41.926893
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "70f00c45c0f2"
down_revision = "3879338f8ba1"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column("file_store", sa.Column("display_name", sa.String(), nullable=True))
op.add_column(
"file_store",
sa.Column(
"file_origin",
sa.String(),
nullable=False,
server_default="connector", # Default to connector
),
)
op.add_column(
"file_store",
sa.Column(
"file_type", sa.String(), nullable=False, server_default="text/plain"
),
)
op.add_column(
"file_store",
sa.Column(
"file_metadata",
postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
),
)
op.execute(
"""
UPDATE file_store
SET file_origin = CASE
WHEN file_name LIKE 'chat__%' THEN 'chat_upload'
ELSE 'connector'
END,
file_name = CASE
WHEN file_name LIKE 'chat__%' THEN SUBSTR(file_name, 7)
ELSE file_name
END,
file_type = CASE
WHEN file_name LIKE 'chat__%' THEN 'image/png'
ELSE 'text/plain'
END
"""
)
def downgrade() -> None:
op.drop_column("file_store", "file_metadata")
op.drop_column("file_store", "file_type")
op.drop_column("file_store", "file_origin")
op.drop_column("file_store", "display_name")

View File

@@ -0,0 +1,81 @@
"""Permission Auto Sync Framework
Revision ID: 72bdc9929a46
Revises: 475fcefe8826
Create Date: 2024-04-14 21:15:28.659634
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "72bdc9929a46"
down_revision = "475fcefe8826"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"email_to_external_user_cache",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("external_user_id", sa.String(), nullable=False),
sa.Column("user_id", sa.UUID(), nullable=True),
sa.Column("user_email", sa.String(), nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"external_permission",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("user_id", sa.UUID(), nullable=True),
sa.Column("user_email", sa.String(), nullable=False),
sa.Column(
"source_type",
sa.String(),
nullable=False,
),
sa.Column("external_permission_group", sa.String(), nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"permission_sync_run",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"source_type",
sa.String(),
nullable=False,
),
sa.Column("update_type", sa.String(), nullable=False),
sa.Column("cc_pair_id", sa.Integer(), nullable=True),
sa.Column(
"status",
sa.String(),
nullable=False,
),
sa.Column("error_msg", sa.Text(), nullable=True),
sa.Column(
"updated_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.ForeignKeyConstraint(
["cc_pair_id"],
["connector_credential_pair.id"],
),
sa.PrimaryKeyConstraint("id"),
)
def downgrade() -> None:
op.drop_table("permission_sync_run")
op.drop_table("external_permission")
op.drop_table("email_to_external_user_cache")

View File

@@ -0,0 +1,51 @@
"""Chat Folders
Revision ID: 7547d982db8f
Revises: ef7da92f7213
Create Date: 2024-05-02 15:18:56.573347
"""
from alembic import op
import sqlalchemy as sa
import fastapi_users_db_sqlalchemy
# revision identifiers, used by Alembic.
revision = "7547d982db8f"
down_revision = "ef7da92f7213"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"chat_folder",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column("name", sa.String(), nullable=True),
sa.Column("display_priority", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.add_column("chat_session", sa.Column("folder_id", sa.Integer(), nullable=True))
op.create_foreign_key(
"chat_session_chat_folder_fk",
"chat_session",
"chat_folder",
["folder_id"],
["id"],
)
def downgrade() -> None:
op.drop_constraint(
"chat_session_chat_folder_fk", "chat_session", type_="foreignkey"
)
op.drop_column("chat_session", "folder_id")
op.drop_table("chat_folder")

View File

@@ -0,0 +1,26 @@
"""Count Chat Tokens
Revision ID: 767f1c2a00eb
Revises: dba7f71618f5
Create Date: 2023-09-21 10:03:21.509899
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "767f1c2a00eb"
down_revision = "dba7f71618f5"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"chat_message", sa.Column("token_count", sa.Integer(), nullable=False)
)
def downgrade() -> None:
op.drop_column("chat_message", "token_count")

View File

@@ -0,0 +1,32 @@
"""CC-Pair Name not Unique
Revision ID: 76b60d407dfb
Revises: b156fa702355
Create Date: 2023-12-22 21:42:10.018804
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "76b60d407dfb"
down_revision = "b156fa702355"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.execute("DELETE FROM connector_credential_pair WHERE name IS NULL")
op.drop_constraint(
"connector_credential_pair__name__key",
"connector_credential_pair",
type_="unique",
)
op.alter_column(
"connector_credential_pair", "name", existing_type=sa.String(), nullable=False
)
def downgrade() -> None:
# This wasn't really required by the code either, no good reason to make it unique again
pass

View File

@@ -0,0 +1,71 @@
"""Remove Remaining Enums
Revision ID: 776b3bbe9092
Revises: 4738e4b3bae1
Create Date: 2024-03-22 21:34:27.629444
"""
from alembic import op
import sqlalchemy as sa
from danswer.db.models import IndexModelStatus
from danswer.search.enums import RecencyBiasSetting
from danswer.search.models import SearchType
# revision identifiers, used by Alembic.
revision = "776b3bbe9092"
down_revision = "4738e4b3bae1"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.alter_column(
"persona",
"search_type",
type_=sa.String,
existing_type=sa.Enum(SearchType, native_enum=False),
existing_nullable=False,
)
op.alter_column(
"persona",
"recency_bias",
type_=sa.String,
existing_type=sa.Enum(RecencyBiasSetting, native_enum=False),
existing_nullable=False,
)
# Because the indexmodelstatus enum does not have a mapping to a string type
# we need this workaround instead of directly changing the type
op.add_column("embedding_model", sa.Column("temp_status", sa.String))
op.execute("UPDATE embedding_model SET temp_status = status::text")
op.drop_column("embedding_model", "status")
op.alter_column("embedding_model", "temp_status", new_column_name="status")
op.execute("DROP TYPE IF EXISTS searchtype")
op.execute("DROP TYPE IF EXISTS recencybiassetting")
op.execute("DROP TYPE IF EXISTS indexmodelstatus")
def downgrade() -> None:
op.alter_column(
"persona",
"search_type",
type_=sa.Enum(SearchType, native_enum=False),
existing_type=sa.String(length=50),
existing_nullable=False,
)
op.alter_column(
"persona",
"recency_bias",
type_=sa.Enum(RecencyBiasSetting, native_enum=False),
existing_type=sa.String(length=50),
existing_nullable=False,
)
op.alter_column(
"embedding_model",
"status",
type_=sa.Enum(IndexModelStatus, native_enum=False),
existing_type=sa.String(length=50),
existing_nullable=False,
)

View File

@@ -0,0 +1,35 @@
"""forcibly remove more enum types from postgres
Revision ID: 77d07dffae64
Revises: d61e513bef0a
Create Date: 2023-11-01 12:33:01.999617
"""
from alembic import op
from sqlalchemy import String
# revision identifiers, used by Alembic.
revision = "77d07dffae64"
down_revision = "d61e513bef0a"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
# In a PR:
# https://github.com/danswer-ai/danswer/pull/397/files#diff-f05fb341f6373790b91852579631b64ca7645797a190837156a282b67e5b19c2
# we directly changed some previous migrations. This caused some users to have native enums
# while others wouldn't. This has caused some issues when adding new fields to these enums.
# This migration manually changes the enum types to ensure that nobody uses native enums.
op.alter_column("query_event", "selected_search_flow", type_=String)
op.alter_column("query_event", "feedback", type_=String)
op.alter_column("document_retrieval_feedback", "feedback", type_=String)
op.execute("DROP TYPE IF EXISTS searchtype")
op.execute("DROP TYPE IF EXISTS qafeedbacktype")
op.execute("DROP TYPE IF EXISTS searchfeedbacktype")
def downgrade() -> None:
# We don't want Native Enums, do nothing
pass

View File

@@ -0,0 +1,48 @@
"""Task Tracking
Revision ID: 78dbe7e38469
Revises: 7ccea01261f6
Create Date: 2023-10-15 23:40:50.593262
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "78dbe7e38469"
down_revision = "7ccea01261f6"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"task_queue_jobs",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("task_id", sa.String(), nullable=False),
sa.Column("task_name", sa.String(), nullable=False),
sa.Column(
"status",
sa.Enum(
"PENDING",
"STARTED",
"SUCCESS",
"FAILURE",
name="taskstatus",
native_enum=False,
),
nullable=False,
),
sa.Column("start_time", sa.DateTime(timezone=True), nullable=True),
sa.Column(
"register_time",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.PrimaryKeyConstraint("id"),
)
def downgrade() -> None:
op.drop_table("task_queue_jobs")

View File

@@ -0,0 +1,48 @@
"""Add api_key table
Revision ID: 79acd316403a
Revises: 904e5138fffb
Create Date: 2024-01-11 17:56:37.934381
"""
from alembic import op
import fastapi_users_db_sqlalchemy
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "79acd316403a"
down_revision = "904e5138fffb"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"api_key",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("hashed_api_key", sa.String(), nullable=False),
sa.Column("api_key_display", sa.String(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.Column(
"owner_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column(
"created_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("api_key_display"),
sa.UniqueConstraint("hashed_api_key"),
)
def downgrade() -> None:
op.drop_table("api_key")

View File

@@ -0,0 +1,35 @@
"""added slack_auto_filter
Revision ID: 7aea705850d5
Revises: 4505fd7302e1
Create Date: 2024-07-10 11:01:23.581015
"""
from alembic import op
import sqlalchemy as sa
revision = "7aea705850d5"
down_revision = "4505fd7302e1"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"slack_bot_config",
sa.Column("enable_auto_filters", sa.Boolean(), nullable=True),
)
op.execute(
"UPDATE slack_bot_config SET enable_auto_filters = FALSE WHERE enable_auto_filters IS NULL"
)
op.alter_column(
"slack_bot_config",
"enable_auto_filters",
existing_type=sa.Boolean(),
nullable=False,
server_default=sa.false(),
)
def downgrade() -> None:
op.drop_column("slack_bot_config", "enable_auto_filters")

View File

@@ -0,0 +1,31 @@
"""Store Chat Retrieval Docs
Revision ID: 7ccea01261f6
Revises: a570b80a5f20
Create Date: 2023-10-15 10:39:23.317453
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "7ccea01261f6"
down_revision = "a570b80a5f20"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"chat_message",
sa.Column(
"reference_docs",
postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
),
)
def downgrade() -> None:
op.drop_column("chat_message", "reference_docs")

View File

@@ -0,0 +1,23 @@
"""Add description to persona
Revision ID: 7da0ae5ad583
Revises: e86866a9c78a
Create Date: 2023-11-27 00:16:19.959414
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "7da0ae5ad583"
down_revision = "e86866a9c78a"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column("persona", sa.Column("description", sa.String(), nullable=True))
def downgrade() -> None:
op.drop_column("persona", "description")

View File

@@ -0,0 +1,38 @@
"""Add SlackBotConfig table
Revision ID: 7da543f5672f
Revises: febe9eaa0644
Create Date: 2023-09-24 16:34:17.526128
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "7da543f5672f"
down_revision = "febe9eaa0644"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"slack_bot_config",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("persona_id", sa.Integer(), nullable=True),
sa.Column(
"channel_config",
postgresql.JSONB(astext_type=sa.Text()),
nullable=False,
),
sa.ForeignKeyConstraint(
["persona_id"],
["persona.id"],
),
sa.PrimaryKeyConstraint("id"),
)
def downgrade() -> None:
op.drop_table("slack_bot_config")

View File

@@ -0,0 +1,26 @@
"""Slack Followup
Revision ID: 7f726bad5367
Revises: 79acd316403a
Create Date: 2024-01-15 00:19:55.991224
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "7f726bad5367"
down_revision = "79acd316403a"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"chat_feedback",
sa.Column("required_followup", sa.Boolean(), nullable=True),
)
def downgrade() -> None:
op.drop_column("chat_feedback", "required_followup")

View File

@@ -0,0 +1,35 @@
"""Add index for getting documents just by connector id / credential id
Revision ID: 7f99be1cb9f5
Revises: 78dbe7e38469
Create Date: 2023-10-15 22:48:15.487762
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "7f99be1cb9f5"
down_revision = "78dbe7e38469"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_index(
op.f(
"ix_document_by_connector_credential_pair_pkey__connector_id__credential_id"
),
"document_by_connector_credential_pair",
["connector_id", "credential_id"],
unique=False,
)
def downgrade() -> None:
op.drop_index(
op.f(
"ix_document_by_connector_credential_pair_pkey__connector_id__credential_id"
),
table_name="document_by_connector_credential_pair",
)

View File

@@ -0,0 +1,60 @@
"""Add ID to ConnectorCredentialPair
Revision ID: 800f48024ae9
Revises: 767f1c2a00eb
Create Date: 2023-09-19 16:13:42.299715
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import Sequence, CreateSequence
# revision identifiers, used by Alembic.
revision = "800f48024ae9"
down_revision = "767f1c2a00eb"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
sequence = Sequence("connector_credential_pair_id_seq")
op.execute(CreateSequence(sequence)) # type: ignore
op.add_column(
"connector_credential_pair",
sa.Column(
"id", sa.Integer(), nullable=True, server_default=sequence.next_value()
),
)
op.add_column(
"connector_credential_pair",
sa.Column("name", sa.String(), nullable=True),
)
# fill in IDs for existing rows
op.execute(
"UPDATE connector_credential_pair SET id = nextval('connector_credential_pair_id_seq') WHERE id IS NULL"
)
op.alter_column("connector_credential_pair", "id", nullable=False)
op.create_unique_constraint(
"connector_credential_pair__name__key", "connector_credential_pair", ["name"]
)
op.create_unique_constraint(
"connector_credential_pair__id__key", "connector_credential_pair", ["id"]
)
def downgrade() -> None:
op.drop_constraint(
"connector_credential_pair__name__key",
"connector_credential_pair",
type_="unique",
)
op.drop_constraint(
"connector_credential_pair__id__key",
"connector_credential_pair",
type_="unique",
)
op.drop_column("connector_credential_pair", "name")
op.drop_column("connector_credential_pair", "id")
op.execute("DROP SEQUENCE connector_credential_pair_id_seq")

View File

@@ -0,0 +1,36 @@
"""Add chat session to query_event
Revision ID: 80696cf850ae
Revises: 15326fcec57e
Create Date: 2023-11-26 02:38:35.008070
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "80696cf850ae"
down_revision = "15326fcec57e"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"query_event",
sa.Column("chat_session_id", sa.Integer(), nullable=True),
)
op.create_foreign_key(
"fk_query_event_chat_session_id",
"query_event",
"chat_session",
["chat_session_id"],
["id"],
)
def downgrade() -> None:
op.drop_constraint(
"fk_query_event_chat_session_id", "query_event", type_="foreignkey"
)
op.drop_column("query_event", "chat_session_id")

View File

@@ -0,0 +1,34 @@
"""Add is_visible to Persona
Revision ID: 891cd83c87a8
Revises: 76b60d407dfb
Create Date: 2023-12-21 11:55:54.132279
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "891cd83c87a8"
down_revision = "76b60d407dfb"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"persona",
sa.Column("is_visible", sa.Boolean(), nullable=True),
)
op.execute("UPDATE persona SET is_visible = true")
op.alter_column("persona", "is_visible", nullable=False)
op.add_column(
"persona",
sa.Column("display_priority", sa.Integer(), nullable=True),
)
def downgrade() -> None:
op.drop_column("persona", "is_visible")
op.drop_column("persona", "display_priority")

View File

@@ -0,0 +1,25 @@
"""Add full exception stack trace
Revision ID: 8987770549c0
Revises: ec3ec2eabf7b
Create Date: 2024-02-10 19:31:28.339135
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "8987770549c0"
down_revision = "ec3ec2eabf7b"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"index_attempt", sa.Column("full_exception_trace", sa.Text(), nullable=True)
)
def downgrade() -> None:
op.drop_column("index_attempt", "full_exception_trace")

View File

@@ -0,0 +1,39 @@
"""Restructure Document Indices
Revision ID: 8aabb57f3b49
Revises: 5e84129c8be3
Create Date: 2023-08-18 21:15:57.629515
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "8aabb57f3b49"
down_revision = "5e84129c8be3"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.drop_table("chunk")
op.execute("DROP TYPE IF EXISTS documentstoretype")
def downgrade() -> None:
op.create_table(
"chunk",
sa.Column("id", sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column(
"document_store_type",
postgresql.ENUM("VECTOR", "KEYWORD", name="documentstoretype"),
autoincrement=False,
nullable=False,
),
sa.Column("document_id", sa.VARCHAR(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(
["document_id"], ["document.id"], name="chunk_document_id_fkey"
),
sa.PrimaryKeyConstraint("id", "document_store_type", name="chunk_pkey"),
)

View File

@@ -0,0 +1,40 @@
"""Chat Context Addition
Revision ID: 8e26726b7683
Revises: 5809c0787398
Create Date: 2023-09-13 18:34:31.327944
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "8e26726b7683"
down_revision = "5809c0787398"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"persona",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("system_text", sa.Text(), nullable=True),
sa.Column("tools_text", sa.Text(), nullable=True),
sa.Column("hint_text", sa.Text(), nullable=True),
sa.Column("default_persona", sa.Boolean(), nullable=False),
sa.Column("deleted", sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint("id"),
)
op.add_column("chat_message", sa.Column("persona_id", sa.Integer(), nullable=True))
op.create_foreign_key(
"fk_chat_message_persona_id", "chat_message", "persona", ["persona_id"], ["id"]
)
def downgrade() -> None:
op.drop_constraint("fk_chat_message_persona_id", "chat_message", type_="foreignkey")
op.drop_column("chat_message", "persona_id")
op.drop_table("persona")

View File

@@ -0,0 +1,32 @@
"""Store Tool Details
Revision ID: 904451035c9b
Revises: 3b25685ff73c
Create Date: 2023-10-05 12:29:26.620000
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "904451035c9b"
down_revision = "3b25685ff73c"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"persona",
sa.Column("tools", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
)
op.drop_column("persona", "tools_text")
def downgrade() -> None:
op.add_column(
"persona",
sa.Column("tools_text", sa.TEXT(), autoincrement=False, nullable=True),
)
op.drop_column("persona", "tools")

View File

@@ -0,0 +1,61 @@
"""Tags
Revision ID: 904e5138fffb
Revises: 891cd83c87a8
Create Date: 2024-01-01 10:44:43.733974
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "904e5138fffb"
down_revision = "891cd83c87a8"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"tag",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("tag_key", sa.String(), nullable=False),
sa.Column("tag_value", sa.String(), nullable=False),
sa.Column("source", sa.String(), nullable=False),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint(
"tag_key", "tag_value", "source", name="_tag_key_value_source_uc"
),
)
op.create_table(
"document__tag",
sa.Column("document_id", sa.String(), nullable=False),
sa.Column("tag_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["document_id"],
["document.id"],
),
sa.ForeignKeyConstraint(
["tag_id"],
["tag.id"],
),
sa.PrimaryKeyConstraint("document_id", "tag_id"),
)
op.add_column(
"search_doc",
sa.Column(
"doc_metadata",
postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
),
)
op.execute("UPDATE search_doc SET doc_metadata = '{}' WHERE doc_metadata IS NULL")
op.alter_column("search_doc", "doc_metadata", nullable=False)
def downgrade() -> None:
op.drop_table("document__tag")
op.drop_table("tag")
op.drop_column("search_doc", "doc_metadata")

View File

@@ -0,0 +1,36 @@
"""Remove DocumentSource from Tag
Revision ID: 91fd3b470d1a
Revises: 173cae5bba26
Create Date: 2024-03-21 12:05:23.956734
"""
from alembic import op
import sqlalchemy as sa
from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "91fd3b470d1a"
down_revision = "173cae5bba26"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.alter_column(
"tag",
"source",
type_=sa.String(length=50),
existing_type=sa.Enum(DocumentSource, native_enum=False),
existing_nullable=False,
)
def downgrade() -> None:
op.alter_column(
"tag",
"source",
type_=sa.Enum(DocumentSource, native_enum=False),
existing_type=sa.String(length=50),
existing_nullable=False,
)

View File

@@ -0,0 +1,31 @@
"""Added retrieved docs to query event
Revision ID: 9d97fecfab7f
Revises: ffc707a226b4
Create Date: 2023-10-20 12:22:31.930449
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "9d97fecfab7f"
down_revision = "ffc707a226b4"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"query_event",
sa.Column(
"retrieved_document_ids",
postgresql.ARRAY(sa.String()),
nullable=True,
),
)
def downgrade() -> None:
op.drop_column("query_event", "retrieved_document_ids")

View File

@@ -0,0 +1,27 @@
"""Add chosen_assistants to User table
Revision ID: a3bfd0d64902
Revises: ec85f2b3c544
Create Date: 2024-05-26 17:22:24.834741
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "a3bfd0d64902"
down_revision = "ec85f2b3c544"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"user",
sa.Column("chosen_assistants", postgresql.ARRAY(sa.Integer()), nullable=True),
)
def downgrade() -> None:
op.drop_column("user", "chosen_assistants")

View File

@@ -0,0 +1,67 @@
"""UserGroup tables
Revision ID: a570b80a5f20
Revises: 904451035c9b
Create Date: 2023-10-02 12:27:10.265725
"""
from alembic import op
import fastapi_users_db_sqlalchemy
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "a570b80a5f20"
down_revision = "904451035c9b"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"user_group",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("is_up_to_date", sa.Boolean(), nullable=False),
sa.Column("is_up_for_deletion", sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
op.create_table(
"user__user_group",
sa.Column("user_group_id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.ForeignKeyConstraint(
["user_group_id"],
["user_group.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("user_group_id", "user_id"),
)
op.create_table(
"user_group__connector_credential_pair",
sa.Column("user_group_id", sa.Integer(), nullable=False),
sa.Column("cc_pair_id", sa.Integer(), nullable=False),
sa.Column("is_current", sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
["cc_pair_id"],
["connector_credential_pair.id"],
),
sa.ForeignKeyConstraint(
["user_group_id"],
["user_group.id"],
),
sa.PrimaryKeyConstraint("user_group_id", "cc_pair_id", "is_current"),
)
def downgrade() -> None:
op.drop_table("user_group__connector_credential_pair")
op.drop_table("user__user_group")
op.drop_table("user_group")

View File

@@ -0,0 +1,47 @@
"""Add SAML Accounts
Revision ID: ae62505e3acc
Revises: 7da543f5672f
Create Date: 2023-09-26 16:19:30.933183
"""
import fastapi_users_db_sqlalchemy
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "ae62505e3acc"
down_revision = "7da543f5672f"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"saml",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.Column("encrypted_cookie", sa.Text(), nullable=False),
sa.Column("expires_at", sa.DateTime(timezone=True), nullable=True),
sa.Column(
"updated_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("encrypted_cookie"),
sa.UniqueConstraint("user_id"),
)
def downgrade() -> None:
op.drop_table("saml")

View File

@@ -6,14 +6,13 @@ Create Date: 2023-08-06 12:05:47.087325
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "b082fec533f0"
down_revision = "df0c7ad8a076"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,520 @@
"""Chat Reworked
Revision ID: b156fa702355
Revises: baf71f781b9e
Create Date: 2023-12-12 00:57:41.823371
"""
import fastapi_users_db_sqlalchemy
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import ENUM
from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "b156fa702355"
down_revision = "baf71f781b9e"
branch_labels: None = None
depends_on: None = None
searchtype_enum = ENUM(
"KEYWORD", "SEMANTIC", "HYBRID", name="searchtype", create_type=True
)
recencybiassetting_enum = ENUM(
"FAVOR_RECENT",
"BASE_DECAY",
"NO_DECAY",
"AUTO",
name="recencybiassetting",
create_type=True,
)
def upgrade() -> None:
bind = op.get_bind()
searchtype_enum.create(bind)
recencybiassetting_enum.create(bind)
# This is irrecoverable, whatever
op.execute("DELETE FROM chat_feedback")
op.execute("DELETE FROM document_retrieval_feedback")
op.create_table(
"search_doc",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("document_id", sa.String(), nullable=False),
sa.Column("chunk_ind", sa.Integer(), nullable=False),
sa.Column("semantic_id", sa.String(), nullable=False),
sa.Column("link", sa.String(), nullable=True),
sa.Column("blurb", sa.String(), nullable=False),
sa.Column("boost", sa.Integer(), nullable=False),
sa.Column(
"source_type",
sa.Enum(DocumentSource, native=False),
nullable=False,
),
sa.Column("hidden", sa.Boolean(), nullable=False),
sa.Column("score", sa.Float(), nullable=False),
sa.Column("match_highlights", postgresql.ARRAY(sa.String()), nullable=False),
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True),
sa.Column("primary_owners", postgresql.ARRAY(sa.String()), nullable=True),
sa.Column("secondary_owners", postgresql.ARRAY(sa.String()), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"prompt",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column("name", sa.String(), nullable=False),
sa.Column("description", sa.String(), nullable=False),
sa.Column("system_prompt", sa.Text(), nullable=False),
sa.Column("task_prompt", sa.Text(), nullable=False),
sa.Column("include_citations", sa.Boolean(), nullable=False),
sa.Column("datetime_aware", sa.Boolean(), nullable=False),
sa.Column("default_prompt", sa.Boolean(), nullable=False),
sa.Column("deleted", sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"persona__prompt",
sa.Column("persona_id", sa.Integer(), nullable=False),
sa.Column("prompt_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["persona_id"],
["persona.id"],
),
sa.ForeignKeyConstraint(
["prompt_id"],
["prompt.id"],
),
sa.PrimaryKeyConstraint("persona_id", "prompt_id"),
)
# Changes to persona first so chat_sessions can have the right persona
# The empty persona will be overwritten on server startup
op.add_column(
"persona",
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
)
op.add_column(
"persona",
sa.Column(
"search_type",
searchtype_enum,
nullable=True,
),
)
op.execute("UPDATE persona SET search_type = 'HYBRID'")
op.alter_column("persona", "search_type", nullable=False)
op.add_column(
"persona",
sa.Column("llm_relevance_filter", sa.Boolean(), nullable=True),
)
op.execute("UPDATE persona SET llm_relevance_filter = TRUE")
op.alter_column("persona", "llm_relevance_filter", nullable=False)
op.add_column(
"persona",
sa.Column("llm_filter_extraction", sa.Boolean(), nullable=True),
)
op.execute("UPDATE persona SET llm_filter_extraction = TRUE")
op.alter_column("persona", "llm_filter_extraction", nullable=False)
op.add_column(
"persona",
sa.Column(
"recency_bias",
recencybiassetting_enum,
nullable=True,
),
)
op.execute("UPDATE persona SET recency_bias = 'BASE_DECAY'")
op.alter_column("persona", "recency_bias", nullable=False)
op.alter_column("persona", "description", existing_type=sa.VARCHAR(), nullable=True)
op.execute("UPDATE persona SET description = ''")
op.alter_column("persona", "description", nullable=False)
op.create_foreign_key("persona__user_fk", "persona", "user", ["user_id"], ["id"])
op.drop_column("persona", "datetime_aware")
op.drop_column("persona", "tools")
op.drop_column("persona", "hint_text")
op.drop_column("persona", "apply_llm_relevance_filter")
op.drop_column("persona", "retrieval_enabled")
op.drop_column("persona", "system_text")
# Need to create a persona row so fk can work
result = bind.execute(sa.text("SELECT 1 FROM persona WHERE id = 0"))
exists = result.fetchone()
if not exists:
op.execute(
sa.text(
"""
INSERT INTO persona (
id, user_id, name, description, search_type, num_chunks,
llm_relevance_filter, llm_filter_extraction, recency_bias,
llm_model_version_override, default_persona, deleted
) VALUES (
0, NULL, '', '', 'HYBRID', NULL,
TRUE, TRUE, 'BASE_DECAY', NULL, TRUE, FALSE
)
"""
)
)
delete_statement = sa.text(
"""
DELETE FROM persona
WHERE name = 'Danswer' AND default_persona = TRUE AND id != 0
"""
)
bind.execute(delete_statement)
op.add_column(
"chat_feedback",
sa.Column("chat_message_id", sa.Integer(), nullable=False),
)
op.drop_constraint(
"chat_feedback_chat_message_chat_session_id_chat_message_me_fkey",
"chat_feedback",
type_="foreignkey",
)
op.drop_column("chat_feedback", "chat_message_edit_number")
op.drop_column("chat_feedback", "chat_message_chat_session_id")
op.drop_column("chat_feedback", "chat_message_message_number")
op.add_column(
"chat_message",
sa.Column(
"id",
sa.Integer(),
primary_key=True,
autoincrement=True,
nullable=False,
unique=True,
),
)
op.add_column(
"chat_message",
sa.Column("parent_message", sa.Integer(), nullable=True),
)
op.add_column(
"chat_message",
sa.Column("latest_child_message", sa.Integer(), nullable=True),
)
op.add_column(
"chat_message", sa.Column("rephrased_query", sa.Text(), nullable=True)
)
op.add_column("chat_message", sa.Column("prompt_id", sa.Integer(), nullable=True))
op.add_column(
"chat_message",
sa.Column("citations", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
)
op.add_column("chat_message", sa.Column("error", sa.Text(), nullable=True))
op.drop_constraint("fk_chat_message_persona_id", "chat_message", type_="foreignkey")
op.create_foreign_key(
"chat_message__prompt_fk", "chat_message", "prompt", ["prompt_id"], ["id"]
)
op.drop_column("chat_message", "parent_edit_number")
op.drop_column("chat_message", "persona_id")
op.drop_column("chat_message", "reference_docs")
op.drop_column("chat_message", "edit_number")
op.drop_column("chat_message", "latest")
op.drop_column("chat_message", "message_number")
op.add_column("chat_session", sa.Column("one_shot", sa.Boolean(), nullable=True))
op.execute("UPDATE chat_session SET one_shot = TRUE")
op.alter_column("chat_session", "one_shot", nullable=False)
op.alter_column(
"chat_session",
"persona_id",
existing_type=sa.INTEGER(),
nullable=True,
)
op.execute("UPDATE chat_session SET persona_id = 0")
op.alter_column("chat_session", "persona_id", nullable=False)
op.add_column(
"document_retrieval_feedback",
sa.Column("chat_message_id", sa.Integer(), nullable=False),
)
op.drop_constraint(
"document_retrieval_feedback_qa_event_id_fkey",
"document_retrieval_feedback",
type_="foreignkey",
)
op.create_foreign_key(
"document_retrieval_feedback__chat_message_fk",
"document_retrieval_feedback",
"chat_message",
["chat_message_id"],
["id"],
)
op.drop_column("document_retrieval_feedback", "qa_event_id")
# Relation table must be created after the other tables are correct
op.create_table(
"chat_message__search_doc",
sa.Column("chat_message_id", sa.Integer(), nullable=False),
sa.Column("search_doc_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["chat_message_id"],
["chat_message.id"],
),
sa.ForeignKeyConstraint(
["search_doc_id"],
["search_doc.id"],
),
sa.PrimaryKeyConstraint("chat_message_id", "search_doc_id"),
)
# Needs to be created after chat_message id field is added
op.create_foreign_key(
"chat_feedback__chat_message_fk",
"chat_feedback",
"chat_message",
["chat_message_id"],
["id"],
)
op.drop_table("query_event")
def downgrade() -> None:
op.drop_constraint(
"chat_feedback__chat_message_fk", "chat_feedback", type_="foreignkey"
)
op.drop_constraint(
"document_retrieval_feedback__chat_message_fk",
"document_retrieval_feedback",
type_="foreignkey",
)
op.drop_constraint("persona__user_fk", "persona", type_="foreignkey")
op.drop_constraint("chat_message__prompt_fk", "chat_message", type_="foreignkey")
op.drop_constraint(
"chat_message__search_doc_chat_message_id_fkey",
"chat_message__search_doc",
type_="foreignkey",
)
op.add_column(
"persona",
sa.Column("system_text", sa.TEXT(), autoincrement=False, nullable=True),
)
op.add_column(
"persona",
sa.Column(
"retrieval_enabled",
sa.BOOLEAN(),
autoincrement=False,
nullable=True,
),
)
op.execute("UPDATE persona SET retrieval_enabled = TRUE")
op.alter_column("persona", "retrieval_enabled", nullable=False)
op.add_column(
"persona",
sa.Column(
"apply_llm_relevance_filter",
sa.BOOLEAN(),
autoincrement=False,
nullable=True,
),
)
op.add_column(
"persona",
sa.Column("hint_text", sa.TEXT(), autoincrement=False, nullable=True),
)
op.add_column(
"persona",
sa.Column(
"tools",
postgresql.JSONB(astext_type=sa.Text()),
autoincrement=False,
nullable=True,
),
)
op.add_column(
"persona",
sa.Column("datetime_aware", sa.BOOLEAN(), autoincrement=False, nullable=True),
)
op.execute("UPDATE persona SET datetime_aware = TRUE")
op.alter_column("persona", "datetime_aware", nullable=False)
op.alter_column("persona", "description", existing_type=sa.VARCHAR(), nullable=True)
op.drop_column("persona", "recency_bias")
op.drop_column("persona", "llm_filter_extraction")
op.drop_column("persona", "llm_relevance_filter")
op.drop_column("persona", "search_type")
op.drop_column("persona", "user_id")
op.add_column(
"document_retrieval_feedback",
sa.Column("qa_event_id", sa.INTEGER(), autoincrement=False, nullable=False),
)
op.drop_column("document_retrieval_feedback", "chat_message_id")
op.alter_column(
"chat_session", "persona_id", existing_type=sa.INTEGER(), nullable=True
)
op.drop_column("chat_session", "one_shot")
op.add_column(
"chat_message",
sa.Column(
"message_number",
sa.INTEGER(),
autoincrement=False,
nullable=False,
primary_key=True,
),
)
op.add_column(
"chat_message",
sa.Column("latest", sa.BOOLEAN(), autoincrement=False, nullable=False),
)
op.add_column(
"chat_message",
sa.Column(
"edit_number",
sa.INTEGER(),
autoincrement=False,
nullable=False,
primary_key=True,
),
)
op.add_column(
"chat_message",
sa.Column(
"reference_docs",
postgresql.JSONB(astext_type=sa.Text()),
autoincrement=False,
nullable=True,
),
)
op.add_column(
"chat_message",
sa.Column("persona_id", sa.INTEGER(), autoincrement=False, nullable=True),
)
op.add_column(
"chat_message",
sa.Column(
"parent_edit_number",
sa.INTEGER(),
autoincrement=False,
nullable=True,
),
)
op.create_foreign_key(
"fk_chat_message_persona_id",
"chat_message",
"persona",
["persona_id"],
["id"],
)
op.drop_column("chat_message", "error")
op.drop_column("chat_message", "citations")
op.drop_column("chat_message", "prompt_id")
op.drop_column("chat_message", "rephrased_query")
op.drop_column("chat_message", "latest_child_message")
op.drop_column("chat_message", "parent_message")
op.drop_column("chat_message", "id")
op.add_column(
"chat_feedback",
sa.Column(
"chat_message_message_number",
sa.INTEGER(),
autoincrement=False,
nullable=False,
),
)
op.add_column(
"chat_feedback",
sa.Column(
"chat_message_chat_session_id",
sa.INTEGER(),
autoincrement=False,
nullable=False,
primary_key=True,
),
)
op.add_column(
"chat_feedback",
sa.Column(
"chat_message_edit_number",
sa.INTEGER(),
autoincrement=False,
nullable=False,
),
)
op.drop_column("chat_feedback", "chat_message_id")
op.create_table(
"query_event",
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column("query", sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column(
"selected_search_flow",
sa.VARCHAR(),
autoincrement=False,
nullable=True,
),
sa.Column("llm_answer", sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column("feedback", sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column("user_id", sa.UUID(), autoincrement=False, nullable=True),
sa.Column(
"time_created",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.Column(
"retrieved_document_ids",
postgresql.ARRAY(sa.VARCHAR()),
autoincrement=False,
nullable=True,
),
sa.Column("chat_session_id", sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(
["chat_session_id"],
["chat_session.id"],
name="fk_query_event_chat_session_id",
),
sa.ForeignKeyConstraint(
["user_id"], ["user.id"], name="query_event_user_id_fkey"
),
sa.PrimaryKeyConstraint("id", name="query_event_pkey"),
)
op.drop_table("chat_message__search_doc")
op.drop_table("persona__prompt")
op.drop_table("prompt")
op.drop_table("search_doc")
op.create_unique_constraint(
"uq_chat_message_combination",
"chat_message",
["chat_session_id", "message_number", "edit_number"],
)
op.create_foreign_key(
"chat_feedback_chat_message_chat_session_id_chat_message_me_fkey",
"chat_feedback",
"chat_message",
[
"chat_message_chat_session_id",
"chat_message_message_number",
"chat_message_edit_number",
],
["chat_session_id", "message_number", "edit_number"],
)
op.create_foreign_key(
"document_retrieval_feedback_qa_event_id_fkey",
"document_retrieval_feedback",
"query_event",
["qa_event_id"],
["id"],
)
op.execute("DROP TYPE IF EXISTS searchtype")
op.execute("DROP TYPE IF EXISTS recencybiassetting")
op.execute("DROP TYPE IF EXISTS documentsource")

View File

@@ -0,0 +1,28 @@
"""fix-file-type-migration
Revision ID: b85f02ec1308
Revises: a3bfd0d64902
Create Date: 2024-05-31 18:09:26.658164
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "b85f02ec1308"
down_revision = "a3bfd0d64902"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.execute(
"""
UPDATE file_store
SET file_origin = UPPER(file_origin)
"""
)
def downgrade() -> None:
# Let's not break anything on purpose :)
pass

View File

@@ -0,0 +1,23 @@
"""backfill is_internet data to False
Revision ID: b896bbd0d5a7
Revises: 44f856ae2a4a
Create Date: 2024-07-16 15:21:05.718571
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "b896bbd0d5a7"
down_revision = "44f856ae2a4a"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.execute("UPDATE search_doc SET is_internet = FALSE WHERE is_internet IS NULL")
def downgrade() -> None:
pass

View File

@@ -0,0 +1,26 @@
"""Add llm_model_version_override to Persona
Revision ID: baf71f781b9e
Revises: 50b683a8295c
Create Date: 2023-12-06 21:56:50.286158
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "baf71f781b9e"
down_revision = "50b683a8295c"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"persona",
sa.Column("llm_model_version_override", sa.String(), nullable=True),
)
def downgrade() -> None:
op.drop_column("persona", "llm_model_version_override")

View File

@@ -0,0 +1,51 @@
"""create usage reports table
Revision ID: bc9771dccadf
Revises: 0568ccf46a6b
Create Date: 2024-06-18 10:04:26.800282
"""
from alembic import op
import sqlalchemy as sa
import fastapi_users_db_sqlalchemy
# revision identifiers, used by Alembic.
revision = "bc9771dccadf"
down_revision = "0568ccf46a6b"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"usage_reports",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("report_name", sa.String(), nullable=False),
sa.Column(
"requestor_user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column(
"time_created",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.Column("period_from", sa.DateTime(timezone=True), nullable=True),
sa.Column("period_to", sa.DateTime(timezone=True), nullable=True),
sa.ForeignKeyConstraint(
["report_name"],
["file_store.file_name"],
),
sa.ForeignKeyConstraint(
["requestor_user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
def downgrade() -> None:
op.drop_table("usage_reports")

View File

@@ -0,0 +1,75 @@
"""Add standard_answer tables
Revision ID: c18cdf4b497e
Revises: 3a7802814195
Create Date: 2024-06-06 15:15:02.000648
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "c18cdf4b497e"
down_revision = "3a7802814195"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"standard_answer",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("keyword", sa.String(), nullable=False),
sa.Column("answer", sa.String(), nullable=False),
sa.Column("active", sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("keyword"),
)
op.create_table(
"standard_answer_category",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
op.create_table(
"standard_answer__standard_answer_category",
sa.Column("standard_answer_id", sa.Integer(), nullable=False),
sa.Column("standard_answer_category_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["standard_answer_category_id"],
["standard_answer_category.id"],
),
sa.ForeignKeyConstraint(
["standard_answer_id"],
["standard_answer.id"],
),
sa.PrimaryKeyConstraint("standard_answer_id", "standard_answer_category_id"),
)
op.create_table(
"slack_bot_config__standard_answer_category",
sa.Column("slack_bot_config_id", sa.Integer(), nullable=False),
sa.Column("standard_answer_category_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["slack_bot_config_id"],
["slack_bot_config.id"],
),
sa.ForeignKeyConstraint(
["standard_answer_category_id"],
["standard_answer_category.id"],
),
sa.PrimaryKeyConstraint("slack_bot_config_id", "standard_answer_category_id"),
)
op.add_column(
"chat_session", sa.Column("slack_thread_id", sa.String(), nullable=True)
)
def downgrade() -> None:
op.drop_column("chat_session", "slack_thread_id")
op.drop_table("slack_bot_config__standard_answer_category")
op.drop_table("standard_answer__standard_answer_category")
op.drop_table("standard_answer_category")
op.drop_table("standard_answer")

View File

@@ -0,0 +1,73 @@
"""Remove deletion_attempt table
Revision ID: d5645c915d0e
Revises: 8e26726b7683
Create Date: 2023-09-14 15:04:14.444909
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "d5645c915d0e"
down_revision = "8e26726b7683"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.drop_table("deletion_attempt")
def downgrade() -> None:
op.create_table(
"deletion_attempt",
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column("connector_id", sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column("credential_id", sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column(
"status",
postgresql.ENUM(
"NOT_STARTED",
"IN_PROGRESS",
"SUCCESS",
"FAILED",
name="deletionstatus",
),
autoincrement=False,
nullable=False,
),
sa.Column(
"num_docs_deleted",
sa.INTEGER(),
autoincrement=False,
nullable=False,
),
sa.Column("error_msg", sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column(
"time_created",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.Column(
"time_updated",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.ForeignKeyConstraint(
["connector_id"],
["connector.id"],
name="deletion_attempt_connector_id_fkey",
),
sa.ForeignKeyConstraint(
["credential_id"],
["credential.id"],
name="deletion_attempt_credential_id_fkey",
),
sa.PrimaryKeyConstraint("id", name="deletion_attempt_pkey"),
)

View File

@@ -0,0 +1,32 @@
"""Add Total Docs for Index Attempt
Revision ID: d61e513bef0a
Revises: 46625e4745d4
Create Date: 2023-10-27 23:02:43.369964
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "d61e513bef0a"
down_revision = "46625e4745d4"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"index_attempt",
sa.Column("new_docs_indexed", sa.Integer(), nullable=True),
)
op.alter_column(
"index_attempt", "num_docs_indexed", new_column_name="total_docs_indexed"
)
def downgrade() -> None:
op.alter_column(
"index_attempt", "total_docs_indexed", new_column_name="num_docs_indexed"
)
op.drop_column("index_attempt", "new_docs_indexed")

View File

@@ -12,8 +12,8 @@ from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "d7111c1238cd"
down_revision = "465f78d9b7f9"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,45 @@
"""combined slack id fields
Revision ID: d716b0791ddd
Revises: 7aea705850d5
Create Date: 2024-07-10 17:57:45.630550
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "d716b0791ddd"
down_revision = "7aea705850d5"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.execute(
"""
UPDATE slack_bot_config
SET channel_config = jsonb_set(
channel_config,
'{respond_member_group_list}',
coalesce(channel_config->'respond_team_member_list', '[]'::jsonb) ||
coalesce(channel_config->'respond_slack_group_list', '[]'::jsonb)
) - 'respond_team_member_list' - 'respond_slack_group_list'
"""
)
def downgrade() -> None:
op.execute(
"""
UPDATE slack_bot_config
SET channel_config = jsonb_set(
jsonb_set(
channel_config - 'respond_member_group_list',
'{respond_team_member_list}',
'[]'::jsonb
),
'{respond_slack_group_list}',
'[]'::jsonb
)
"""
)

View File

@@ -0,0 +1,94 @@
"""Feedback Feature
Revision ID: d929f0c1c6af
Revises: 8aabb57f3b49
Create Date: 2023-08-27 13:03:54.274987
"""
import fastapi_users_db_sqlalchemy
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "d929f0c1c6af"
down_revision = "8aabb57f3b49"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"query_event",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("query", sa.String(), nullable=False),
sa.Column(
"selected_search_flow",
sa.Enum("KEYWORD", "SEMANTIC", name="searchtype", native_enum=False),
nullable=True,
),
sa.Column("llm_answer", sa.String(), nullable=True),
sa.Column(
"feedback",
sa.Enum("LIKE", "DISLIKE", name="qafeedbacktype", native_enum=False),
nullable=True,
),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=True,
),
sa.Column(
"time_created",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"document_retrieval_feedback",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("qa_event_id", sa.Integer(), nullable=False),
sa.Column("document_id", sa.String(), nullable=False),
sa.Column("document_rank", sa.Integer(), nullable=False),
sa.Column("clicked", sa.Boolean(), nullable=False),
sa.Column(
"feedback",
sa.Enum(
"ENDORSE",
"REJECT",
"HIDE",
"UNHIDE",
name="searchfeedbacktype",
native_enum=False,
),
nullable=True,
),
sa.ForeignKeyConstraint(
["document_id"],
["document.id"],
),
sa.ForeignKeyConstraint(
["qa_event_id"],
["query_event.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.add_column("document", sa.Column("boost", sa.Integer(), nullable=False))
op.add_column("document", sa.Column("hidden", sa.Boolean(), nullable=False))
op.add_column("document", sa.Column("semantic_id", sa.String(), nullable=False))
op.add_column("document", sa.Column("link", sa.String(), nullable=True))
def downgrade() -> None:
op.drop_column("document", "link")
op.drop_column("document", "semantic_id")
op.drop_column("document", "hidden")
op.drop_column("document", "boost")
op.drop_table("document_retrieval_feedback")
op.drop_table("query_event")

View File

@@ -0,0 +1,29 @@
"""Danswer Custom Tool Flow
Revision ID: dba7f71618f5
Revises: d5645c915d0e
Create Date: 2023-09-18 15:18:37.370972
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "dba7f71618f5"
down_revision = "d5645c915d0e"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.add_column(
"persona",
sa.Column("retrieval_enabled", sa.Boolean(), nullable=True),
)
op.execute("UPDATE persona SET retrieval_enabled = true")
op.alter_column("persona", "retrieval_enabled", nullable=False)
def downgrade() -> None:
op.drop_column("persona", "retrieval_enabled")

View File

@@ -0,0 +1,139 @@
"""Embedding Models
Revision ID: dbaa756c2ccf
Revises: 7f726bad5367
Create Date: 2024-01-25 17:12:31.813160
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, String, Integer, Boolean
from danswer.db.embedding_model import (
get_new_default_embedding_model,
get_old_default_embedding_model,
user_has_overridden_embedding_model,
)
from danswer.db.models import IndexModelStatus
# revision identifiers, used by Alembic.
revision = "dbaa756c2ccf"
down_revision = "7f726bad5367"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"embedding_model",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("model_name", sa.String(), nullable=False),
sa.Column("model_dim", sa.Integer(), nullable=False),
sa.Column("normalize", sa.Boolean(), nullable=False),
sa.Column("query_prefix", sa.String(), nullable=False),
sa.Column("passage_prefix", sa.String(), nullable=False),
sa.Column("index_name", sa.String(), nullable=False),
sa.Column(
"status",
sa.Enum(IndexModelStatus, native=False),
nullable=False,
),
sa.PrimaryKeyConstraint("id"),
)
# since all index attempts must be associated with an embedding model,
# need to put something in here to avoid nulls. On server startup,
# this value will be overriden
EmbeddingModel = table(
"embedding_model",
column("id", Integer),
column("model_name", String),
column("model_dim", Integer),
column("normalize", Boolean),
column("query_prefix", String),
column("passage_prefix", String),
column("index_name", String),
column(
"status", sa.Enum(IndexModelStatus, name="indexmodelstatus", native=False)
),
)
# insert an embedding model row that corresponds to the embedding model
# the user selected via env variables before this change. This is needed since
# all index_attempts must be associated with an embedding model, so without this
# we will run into violations of non-null contraints
old_embedding_model = get_old_default_embedding_model()
op.bulk_insert(
EmbeddingModel,
[
{
"model_name": old_embedding_model.model_name,
"model_dim": old_embedding_model.model_dim,
"normalize": old_embedding_model.normalize,
"query_prefix": old_embedding_model.query_prefix,
"passage_prefix": old_embedding_model.passage_prefix,
"index_name": old_embedding_model.index_name,
"status": old_embedding_model.status,
}
],
)
# if the user has not overridden the default embedding model via env variables,
# insert the new default model into the database to auto-upgrade them
if not user_has_overridden_embedding_model():
new_embedding_model = get_new_default_embedding_model(is_present=False)
op.bulk_insert(
EmbeddingModel,
[
{
"model_name": new_embedding_model.model_name,
"model_dim": new_embedding_model.model_dim,
"normalize": new_embedding_model.normalize,
"query_prefix": new_embedding_model.query_prefix,
"passage_prefix": new_embedding_model.passage_prefix,
"index_name": new_embedding_model.index_name,
"status": IndexModelStatus.FUTURE,
}
],
)
op.add_column(
"index_attempt",
sa.Column("embedding_model_id", sa.Integer(), nullable=True),
)
op.execute(
"UPDATE index_attempt SET embedding_model_id=1 WHERE embedding_model_id IS NULL"
)
op.alter_column(
"index_attempt",
"embedding_model_id",
existing_type=sa.Integer(),
nullable=False,
)
op.create_foreign_key(
"index_attempt__embedding_model_fk",
"index_attempt",
"embedding_model",
["embedding_model_id"],
["id"],
)
op.create_index(
"ix_embedding_model_present_unique",
"embedding_model",
["status"],
unique=True,
postgresql_where=sa.text("status = 'PRESENT'"),
)
op.create_index(
"ix_embedding_model_future_unique",
"embedding_model",
["status"],
unique=True,
postgresql_where=sa.text("status = 'FUTURE'"),
)
def downgrade() -> None:
op.drop_constraint(
"index_attempt__embedding_model_fk", "index_attempt", type_="foreignkey"
)
op.drop_column("index_attempt", "embedding_model_id")
op.drop_table("embedding_model")
op.execute("DROP TYPE indexmodelstatus;")

Some files were not shown because too many files have changed in this diff Show More