Compare commits

..

546 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
Hagenoneill
73b063b66c added teams connector 2024-02-29 12:36:05 -05:00
902 changed files with 75351 additions and 14861 deletions

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

@@ -5,38 +5,45 @@ on:
tags:
- '*'
env:
REGISTRY_IMAGE: danswer/danswer-backend
jobs:
build-and-push:
runs-on: ubuntu-latest
# 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@v1
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
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@v2
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
danswer/danswer-backend:${{ github.ref_name }}
danswer/danswer-backend:latest
${{ 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:
image-ref: docker.io/danswer/danswer-backend:${{ github.ref_name }}
# 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

@@ -14,16 +14,16 @@ jobs:
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
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@v2
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile.model_server

View File

@@ -5,38 +5,115 @@ on:
tags:
- '*'
env:
REGISTRY_IMAGE: danswer/danswer-web-server
jobs:
build-and-push:
runs-on: ubuntu-latest
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: Checkout code
uses: actions/checkout@v2
- 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
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
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: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Web Image 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 }}
danswer/danswer-web-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-web-server:${{ github.ref_name }}
severity: 'CRITICAL,HIGH'
- 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

@@ -20,10 +20,12 @@ jobs:
cache-dependency-path: |
backend/requirements/default.txt
backend/requirements/dev.txt
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: |

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@
.idea
/deployment/data/nginx/app.conf
.vscode/launch.json
*.sw?
/backend/tests/regression/answer_quality/search_test_config.yaml

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

View File

@@ -11,17 +11,47 @@
// 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",
"DISABLE_AUTH": "True",
"TYPESENSE_API_KEY": "typesense_api_key",
"DYNAMIC_CONFIG_DIR_PATH": "./dynamic_config_storage"
"PYTHONUNBUFFERED": "1"
},
"args": [
"danswer.main:app",
@@ -31,52 +61,69 @@
]
},
{
"name": "Indexer",
"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",
"PYTHONPATH": ".",
"TYPESENSE_API_KEY": "typesense_api_key",
"DYNAMIC_CONFIG_DIR_PATH": "./dynamic_config_storage"
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
}
},
// Celery and all async jobs, usually would include indexing as well but this is handled separately above for dev
{
"name": "Temp File Deletion",
"name": "Background Jobs",
"type": "python",
"request": "launch",
"program": "danswer/background/file_deletion.py",
"program": "scripts/dev_run_background_jobs.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_DANSWER_MODEL_INTERACTIONS": "True",
"LOG_LEVEL": "DEBUG",
"PYTHONPATH": "${workspaceFolder}/backend"
}
"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 Listener",
"name": "Slack Bot",
"type": "python",
"request": "launch",
"program": "danswer/listeners/slack_listener.py",
"program": "danswer/danswerbot/slack/listener.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_LEVEL": "DEBUG"
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
}
},
{
"name": "Web Server",
"type": "node",
"name": "Pytest",
"type": "python",
"request": "launch",
"cwd": "${workspaceRoot}/web",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run", "dev"
],
"console": "integratedTerminal"
"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

@@ -72,6 +72,10 @@ For convenience here's a command for it:
python -m venv .venv
source .venv/bin/activate
```
--> 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
@@ -85,6 +89,7 @@ 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.
@@ -112,26 +117,24 @@ docker compose -f docker-compose.dev.yml -p danswer-stack up -d index relational
(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
npm run dev
```
Package the Vespa schema. This will only need to be done when the Vespa schema is updated locally.
Navigate to `danswer/backend/danswer/document_index/vespa/app_config` and run:
Next, start the model server which runs the local NLP models.
Navigate to `danswer/backend` and run:
```bash
zip -r ../vespa-app.zip .
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
"
```
- Note: If you don't have the `zip` utility, you will need to install it prior to running the above
The first time running Danswer, you will also need to run the DB migrations for Postgres.
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.
Navigate to `danswer/backend` and with the venv active, run:
@@ -149,17 +152,12 @@ python ./scripts/dev_run_background_jobs.py
To run the backend API server, navigate back to `danswer/backend` and run:
```bash
AUTH_TYPE=disabled \
DYNAMIC_CONFIG_DIR_PATH=./dynamic_config_storage \
VESPA_DEPLOYMENT_ZIP=./danswer/document_index/vespa/vespa-app.zip \
uvicorn danswer.main:app --reload --port 8080
AUTH_TYPE=disabled uvicorn danswer.main:app --reload --port 8080
```
_For Windows (for compatibility with both PowerShell and Command Prompt):_
```bash
powershell -Command "
$env:AUTH_TYPE='disabled'
$env:DYNAMIC_CONFIG_DIR_PATH='./dynamic_config_storage'
$env:VESPA_DEPLOYMENT_ZIP='./danswer/document_index/vespa/vespa-app.zip'
uvicorn danswer.main:app --reload --port 8080
"
```
@@ -178,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

View File

@@ -11,7 +11,7 @@
<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-2afut44lv-Rw3kSWu6_OmdAXRpCv80DQ" 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">
@@ -22,11 +22,12 @@
</a>
</p>
<strong>[Danswer](https://www.danswer.ai/)</strong> is the ChatGPT for teams. 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.
<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.
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
@@ -104,5 +105,25 @@ Efficiently pulls the latest changes from:
* 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.

4
backend/.gitignore vendored
View File

@@ -5,7 +5,7 @@ site_crawls/
.ipynb_checkpoints/
api_keys.py
*ipynb
.env
.env*
vespa-app.zip
dynamic_config_storage/
celerybeat-schedule
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,10 +1,17 @@
FROM python:3.11.7-slim-bookworm
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}"
RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}"
# Install system dependencies
# cmake needed for psycopg (postgres)
# libpq-dev needed for psycopg (postgres)
@@ -12,16 +19,32 @@ RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}"
# 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+deb12u2 && \
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 && \
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 && \
playwright install chromium && \
playwright install-deps chromium && \
ln -s /usr/local/bin/supervisord /usr/bin/supervisord
# Cleanup for CVEs and size reduction
@@ -29,19 +52,50 @@ RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt && \
# 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 remove -y --allow-remove-essential perl-base xserver-common xvfb cmake libldap-2.5-0 libldap-2.5-0 && \
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 /usr/local/lib/python3.11/site-packages/tornado/test/test.key
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_models /app/shared_models
COPY ./shared_configs /app/shared_configs
COPY ./alembic /app/alembic
COPY ./alembic.ini /app/alembic.ini
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
# Default command which does nothing

View File

@@ -1,5 +1,11 @@
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}
@@ -11,25 +17,26 @@ 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
WORKDIR /app
# 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')"
# Needed for model configs and defaults
COPY ./danswer/configs /app/danswer/configs
COPY ./danswer/dynamic_configs /app/danswer/dynamic_configs
WORKDIR /app
# Utils used by model server
COPY ./danswer/utils/logger.py /app/danswer/utils/logger.py
COPY ./danswer/utils/timing.py /app/danswer/utils/timing.py
COPY ./danswer/utils/telemetry.py /app/danswer/utils/telemetry.py
# Place to fetch version information
COPY ./danswer/__init__.py /app/danswer/__init__.py
# Shared implementations for running NLP models locally
COPY ./danswer/search/search_nlp_models.py /app/danswer/search/search_nlp_models.py
# Request/Response models
COPY ./shared_models /app/shared_models
# Shared between Danswer Backend and Model Server
COPY ./shared_configs /app/shared_configs
# Model Server main code
COPY ./model_server /app/model_server

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

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

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

@@ -13,8 +13,8 @@ from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "15326fcec57e"
down_revision = "77d07dffae64"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

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

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

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "30c1d5744104"
down_revision = "7f99be1cb9f5"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

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

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:

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

@@ -11,8 +11,8 @@ from sqlalchemy import String
# revision identifiers, used by Alembic.
revision = "46625e4745d4"
down_revision = "9d97fecfab7f"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

@@ -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:

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

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "50b683a8295c"
down_revision = "7da0ae5ad583"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

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

View File

@@ -13,8 +13,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5809c0787398"
down_revision = "d929f0c1c6af"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

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

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

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

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "76b60d407dfb"
down_revision = "b156fa702355"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

@@ -12,8 +12,8 @@ from sqlalchemy import String
# revision identifiers, used by Alembic.
revision = "77d07dffae64"
down_revision = "d61e513bef0a"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "78dbe7e38469"
down_revision = "7ccea01261f6"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

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

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

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

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "7da0ae5ad583"
down_revision = "e86866a9c78a"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

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

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "7f726bad5367"
down_revision = "79acd316403a"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ from alembic import op
# revision identifiers, used by Alembic.
revision = "7f99be1cb9f5"
down_revision = "78dbe7e38469"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -12,8 +12,8 @@ from sqlalchemy.schema import Sequence, CreateSequence
# revision identifiers, used by Alembic.
revision = "800f48024ae9"
down_revision = "767f1c2a00eb"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "80696cf850ae"
down_revision = "15326fcec57e"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "891cd83c87a8"
down_revision = "76b60d407dfb"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "8987770549c0"
down_revision = "ec3ec2eabf7b"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

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

View File

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

View File

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

View File

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

View File

@@ -12,8 +12,8 @@ from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "91fd3b470d1a"
down_revision = "173cae5bba26"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

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

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

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

View File

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

View File

@@ -11,8 +11,8 @@ 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

@@ -15,8 +15,8 @@ from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "b156fa702355"
down_revision = "baf71f781b9e"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
searchtype_enum = ENUM(

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

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "baf71f781b9e"
down_revision = "50b683a8295c"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

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

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "d61e513bef0a"
down_revision = "46625e4745d4"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

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

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

View File

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

View File

@@ -19,8 +19,8 @@ from danswer.db.models import IndexModelStatus
# revision identifiers, used by Alembic.
revision = "dbaa756c2ccf"
down_revision = "7f726bad5367"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

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

View File

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

View File

@@ -0,0 +1,22 @@
"""added-prune-frequency
Revision ID: e209dc5a8156
Revises: 48d14957fe80
Create Date: 2024-06-16 16:02:35.273231
"""
from alembic import op
import sqlalchemy as sa
revision = "e209dc5a8156"
down_revision = "48d14957fe80"
branch_labels = None # type: ignore
depends_on = None # type: ignore
def upgrade() -> None:
op.add_column("connector", sa.Column("prune_freq", sa.Integer(), nullable=True))
def downgrade() -> None:
op.drop_column("connector", "prune_freq")

View File

@@ -13,8 +13,8 @@ from danswer.configs.constants import DocumentSource
# revision identifiers, used by Alembic.
revision = "e50154680a5c"
down_revision = "fcd135795f21"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ from alembic import op
# revision identifiers, used by Alembic.
revision = "e6a4bbc13fe4"
down_revision = "b082fec533f0"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -11,8 +11,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "e86866a9c78a"
down_revision = "80696cf850ae"
branch_labels = None
depends_on = None
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:

View File

@@ -0,0 +1,118 @@
"""Private Personas DocumentSets
Revision ID: e91df4e935ef
Revises: 91fd3b470d1a
Create Date: 2024-03-17 11:47:24.675881
"""
import fastapi_users_db_sqlalchemy
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "e91df4e935ef"
down_revision = "91fd3b470d1a"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.create_table(
"document_set__user",
sa.Column("document_set_id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.ForeignKeyConstraint(
["document_set_id"],
["document_set.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("document_set_id", "user_id"),
)
op.create_table(
"persona__user",
sa.Column("persona_id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.ForeignKeyConstraint(
["persona_id"],
["persona.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("persona_id", "user_id"),
)
op.create_table(
"document_set__user_group",
sa.Column("document_set_id", sa.Integer(), nullable=False),
sa.Column(
"user_group_id",
sa.Integer(),
nullable=False,
),
sa.ForeignKeyConstraint(
["document_set_id"],
["document_set.id"],
),
sa.ForeignKeyConstraint(
["user_group_id"],
["user_group.id"],
),
sa.PrimaryKeyConstraint("document_set_id", "user_group_id"),
)
op.create_table(
"persona__user_group",
sa.Column("persona_id", sa.Integer(), nullable=False),
sa.Column(
"user_group_id",
sa.Integer(),
nullable=False,
),
sa.ForeignKeyConstraint(
["persona_id"],
["persona.id"],
),
sa.ForeignKeyConstraint(
["user_group_id"],
["user_group.id"],
),
sa.PrimaryKeyConstraint("persona_id", "user_group_id"),
)
op.add_column(
"document_set",
sa.Column("is_public", sa.Boolean(), nullable=True),
)
# fill in is_public for existing rows
op.execute("UPDATE document_set SET is_public = true WHERE is_public IS NULL")
op.alter_column("document_set", "is_public", nullable=False)
op.add_column(
"persona",
sa.Column("is_public", sa.Boolean(), nullable=True),
)
# fill in is_public for existing rows
op.execute("UPDATE persona SET is_public = true WHERE is_public IS NULL")
op.alter_column("persona", "is_public", nullable=False)
def downgrade() -> None:
op.drop_column("persona", "is_public")
op.drop_column("document_set", "is_public")
op.drop_table("persona__user")
op.drop_table("document_set__user")
op.drop_table("persona__user_group")
op.drop_table("document_set__user_group")

View File

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

View File

@@ -0,0 +1,31 @@
"""Remove Last Attempt Status from CC Pair
Revision ID: ec85f2b3c544
Revises: 3879338f8ba1
Create Date: 2024-05-23 21:39:46.126010
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "ec85f2b3c544"
down_revision = "70f00c45c0f2"
branch_labels: None = None
depends_on: None = None
def upgrade() -> None:
op.drop_column("connector_credential_pair", "last_attempt_status")
def downgrade() -> None:
op.add_column(
"connector_credential_pair",
sa.Column(
"last_attempt_status",
sa.VARCHAR(),
autoincrement=False,
nullable=True,
),
)

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