Compare commits

...

1147 Commits

Author SHA1 Message Date
dependabot[bot]
b076f14973 build(deps): bump the pip group in /application with 2 updates
Bumps the pip group in /application with 2 updates: [requests](https://github.com/psf/requests) and [torch](https://github.com/pytorch/pytorch).


Updates `requests` from 2.32.3 to 2.32.4
- [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.32.3...v2.32.4)

Updates `torch` from 2.7.0 to 2.7.1
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v2.7.0...v2.7.1)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.4
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: torch
  dependency-version: 2.7.1
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-10 09:35:15 +00:00
Alex
31baf181a3 fix: default optimisations 2025-06-05 12:21:40 +01:00
Alex
c0f693d35d remove abount 2025-06-03 15:40:16 +01:00
Alex
52a5f132c1 Merge pull request #1814 from siiddhantt/fix/agents-bugs
fix: shared agent redirect and pinned agents error
2025-06-03 15:37:20 +01:00
Siddhant Rai
f14eac6d10 Merge branch 'main' into fix/agents-bugs 2025-06-03 19:59:10 +05:30
Siddhant Rai
381d737d24 fix: correct vectorstore path in get_vectorstore function 2025-06-03 15:14:00 +05:30
Alex
b47af9600f Merge pull request #1821 from ManishMadan2882/main
Chore: Frontend refinements, i18n sync
2025-06-02 10:13:02 +01:00
GH Action - Upstream Sync
5acc54e609 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-06-01 01:58:40 +00:00
Manish Madan
9c6352dd5b Merge pull request #1823 from arc53/dependabot/npm_and_yarn/docs/next-15.3.3
build(deps): bump next from 14.2.26 to 15.3.3 in /docs
2025-05-31 16:08:57 +05:30
GH Action - Upstream Sync
8e29a07df5 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-31 01:39:33 +00:00
Manish Madan
bd88cd3a06 Merge pull request #1818 from arc53/dependabot/npm_and_yarn/frontend/eslint-config-prettier-10.1.5
build(deps-dev): bump eslint-config-prettier from 9.1.0 to 10.1.5 in /frontend
2025-05-31 02:58:41 +05:30
dependabot[bot]
f371b9702f build(deps-dev): bump eslint-config-prettier in /frontend
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.1.0 to 10.1.5.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.1.0...v10.1.5)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-version: 10.1.5
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 21:25:20 +00:00
Manish Madan
3ff4ae29af Merge pull request #1817 from arc53/dependabot/npm_and_yarn/frontend/eslint-plugin-react-7.37.5
build(deps-dev): bump eslint-plugin-react from 7.37.3 to 7.37.5 in /frontend
2025-05-31 02:53:20 +05:30
dependabot[bot]
eae0f2e7a9 build(deps-dev): bump eslint-plugin-react in /frontend
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.37.3 to 7.37.5.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.37.3...v7.37.5)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-version: 7.37.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 21:18:03 +00:00
Manish Madan
305a98bb79 Merge pull request #1815 from arc53/dependabot/npm_and_yarn/frontend/react-syntax-highlighter-15.6.1
build(deps): bump react-syntax-highlighter from 15.5.0 to 15.6.1 in /frontend
2025-05-31 02:46:15 +05:30
dependabot[bot]
8040a3ed60 build(deps): bump react-syntax-highlighter in /frontend
Bumps [react-syntax-highlighter](https://github.com/react-syntax-highlighter/react-syntax-highlighter) from 15.5.0 to 15.6.1.
- [Release notes](https://github.com/react-syntax-highlighter/react-syntax-highlighter/releases)
- [Changelog](https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/CHANGELOG.MD)
- [Commits](https://github.com/react-syntax-highlighter/react-syntax-highlighter/compare/15.5.0...v15.6.1)

---
updated-dependencies:
- dependency-name: react-syntax-highlighter
  dependency-version: 15.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 21:11:29 +00:00
dependabot[bot]
bb9de7d9b0 build(deps): bump next from 14.2.26 to 15.3.3 in /docs
Bumps [next](https://github.com/vercel/next.js) from 14.2.26 to 15.3.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.26...v15.3.3)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.3.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 21:10:55 +00:00
Manish Madan
d8e8bc0068 Merge pull request #1765 from arc53/dependabot/npm_and_yarn/frontend/vite-6.3.5
build(deps-dev): bump vite from 5.4.14 to 6.3.5 in /frontend
2025-05-31 02:39:41 +05:30
ManishMadan2882
6577e9d852 (chore) peer deps 2025-05-31 02:37:27 +05:30
dependabot[bot]
3f8625c65a build(deps-dev): bump vite from 5.4.14 to 6.3.5 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.14 to 6.3.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.3.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.3.5
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 20:08:19 +00:00
ManishMadan2882
92d69636a7 (fix/ui) minor adjustments 2025-05-30 19:33:07 +05:30
ManishMadan2882
9c28817fba (chore:i18n) sync all locales 2025-05-30 19:05:01 +05:30
Siddhant Rai
773788fb32 fix: correct vectorstore path and improve file existence checks in FaissStore 2025-05-30 14:30:51 +05:30
Siddhant Rai
a393ad8e04 refactor: standardize string quotes and improve retriever type handling in RetrieverCreator 2025-05-30 12:50:11 +05:30
ManishMadan2882
71d3714347 (fix:nav) tablets behave like mobile, use tailwind breakpoints 2025-05-29 17:17:29 +05:30
ManishMadan2882
b7e1329c13 (feat:chunksModal) i18n, use wrapperModal 2025-05-29 17:15:13 +05:30
ManishMadan2882
59e6d9d10e Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-29 15:47:42 +05:30
ManishMadan2882
46efb446fb (clean:about) purge route 2025-05-29 15:43:58 +05:30
ManishMadan2882
d31e3a54fd (feat:layout) tablet sidebar behave like mobile 2025-05-29 15:43:00 +05:30
Siddhant Rai
c4e471ac47 fix: ensure shared metadata is displayed only when available in SharedAgentCard 2025-05-29 11:16:38 +05:30
Siddhant Rai
3b8733e085 feat: add tool details resolution and update SharedAgentCard to display tool names 2025-05-29 10:58:49 +05:30
Alex
a7c67d83ca Merge pull request #1820 from ManishMadan2882/main
Chore:  Frontend Refinements
2025-05-29 00:53:59 +01:00
ManishMadan2882
8abc1de26d (feat:hooks) update useMediaQuery 2025-05-29 04:01:47 +05:30
ManishMadan2882
2ca9f708a6 (fix:menu) position smartly 2025-05-29 04:00:25 +05:30
ManishMadan2882
f8f369fbb2 (fix/tools) avoid max width for buttons, i18n 2025-05-29 03:58:34 +05:30
ManishMadan2882
3e9155767b (fix:input) placeholder overflow 2025-05-29 03:57:11 +05:30
Siddhant Rai
8cd4195657 feat: add SharedAgentCard to display selected agent in Conversation component 2025-05-28 14:25:37 +05:30
Siddhant Rai
ad1a944276 refactor: agents sharing and shared with me logic 2025-05-28 13:58:55 +05:30
ManishMadan2882
02ff4c5657 (fix:menu) larger strings break 2025-05-28 03:29:48 +05:30
ManishMadan2882
b1b27f2dde (feat:toolConfig) i18n 2025-05-28 01:10:10 +05:30
ManishMadan2882
5097f77469 (feat:toolConfig) ui details, no actions placeholder 2025-05-27 19:02:41 +05:30
Manish Madan
7e826d5002 Merge pull request #1778 from arc53/dependabot/npm_and_yarn/docs/multi-61ed51ac21
build(deps): bump estree-util-value-to-estree and remark-reading-time in /docs
2025-05-27 16:37:32 +05:30
dependabot[bot]
fe8143a56c build(deps): bump estree-util-value-to-estree and remark-reading-time
Bumps [estree-util-value-to-estree](https://github.com/remcohaszing/estree-util-value-to-estree) and [remark-reading-time](https://github.com/mattjennings/remark-reading-time). These dependencies needed to be updated together.

Updates `estree-util-value-to-estree` from 1.3.0 to 3.4.0
- [Release notes](https://github.com/remcohaszing/estree-util-value-to-estree/releases)
- [Commits](https://github.com/remcohaszing/estree-util-value-to-estree/compare/v1.3.0...v3.4.0)

Updates `remark-reading-time` from 2.0.1 to 2.0.2
- [Release notes](https://github.com/mattjennings/remark-reading-time/releases)
- [Commits](https://github.com/mattjennings/remark-reading-time/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: estree-util-value-to-estree
  dependency-version: 3.4.0
  dependency-type: indirect
- dependency-name: remark-reading-time
  dependency-version: 2.0.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 11:04:37 +00:00
Manish Madan
e5442a713a Merge pull request #1760 from arc53/dependabot/npm_and_yarn/extensions/react-widget/base-x-3.0.11
build(deps-dev): bump base-x from 3.0.9 to 3.0.11 in /extensions/react-widget
2025-05-27 16:32:38 +05:30
dependabot[bot]
1982a46f36 build(deps-dev): bump base-x in /extensions/react-widget
Bumps [base-x](https://github.com/cryptocoinjs/base-x) from 3.0.9 to 3.0.11.
- [Commits](https://github.com/cryptocoinjs/base-x/compare/v3.0.9...v3.0.11)

---
updated-dependencies:
- dependency-name: base-x
  dependency-version: 3.0.11
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 11:02:07 +00:00
Manish Madan
c8c3640baf Merge pull request #1743 from arc53/dependabot/npm_and_yarn/frontend/vite-5.4.18
build(deps-dev): bump vite from 5.4.14 to 5.4.18 in /frontend
2025-05-27 15:52:41 +05:30
dependabot[bot]
fdf47b3f2c build(deps-dev): bump vite from 5.4.14 to 5.4.18 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.14 to 5.4.18.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.18/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.18/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.18
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 10:18:54 +00:00
Manish Madan
93fa4b6a37 Merge pull request #1756 from arc53/dependabot/npm_and_yarn/frontend/multi-08a24af093
build(deps): bump react-router and react-router-dom in /frontend
2025-05-27 15:43:27 +05:30
dependabot[bot]
90e9ab70b0 build(deps): bump react-router and react-router-dom in /frontend
Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) to 7.5.3 and updates ancestor dependency [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom). These dependencies need to be updated together.


Updates `react-router` from 7.1.1 to 7.5.3
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router@7.5.3/packages/react-router)

Updates `react-router-dom` from 7.1.1 to 7.5.3
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.5.3/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router
  dependency-version: 7.5.3
  dependency-type: indirect
- dependency-name: react-router-dom
  dependency-version: 7.5.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 10:10:25 +00:00
Manish Madan
573c2386b7 Merge pull request #1736 from arc53/dependabot/npm_and_yarn/frontend/typescript-5.8.3
build(deps-dev): bump typescript from 5.7.2 to 5.8.3 in /frontend
2025-05-27 15:37:53 +05:30
dependabot[bot]
d2176aeeb9 build(deps-dev): bump typescript from 5.7.2 to 5.8.3 in /frontend
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.8.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 10:04:27 +00:00
Manish Madan
920aec5c3e Merge pull request #1706 from arc53/dependabot/npm_and_yarn/docs/babel/runtime-7.26.10
build(deps): bump @babel/runtime from 7.23.7 to 7.26.10 in /docs
2025-05-27 15:31:39 +05:30
dependabot[bot]
b792c5459a build(deps): bump @babel/runtime from 7.23.7 to 7.26.10 in /docs
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.23.7 to 7.26.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 10:00:19 +00:00
Manish Madan
87fbf05fa1 Merge pull request #1707 from arc53/dependabot/npm_and_yarn/extensions/react-widget/babel/helpers-7.26.10
build(deps): bump @babel/helpers from 7.24.6 to 7.26.10 in /extensions/react-widget
2025-05-27 15:28:08 +05:30
dependabot[bot]
67c53250c5 build(deps): bump @babel/helpers in /extensions/react-widget
Bumps [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) from 7.24.6 to 7.26.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-helpers)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 09:55:00 +00:00
Manish Madan
d657eea910 Merge pull request #1705 from arc53/dependabot/npm_and_yarn/docs/babel/helpers-7.26.10
build(deps): bump @babel/helpers from 7.24.0 to 7.26.10 in /docs
2025-05-27 15:23:01 +05:30
dependabot[bot]
b5fbb825ed build(deps): bump @babel/helpers from 7.24.0 to 7.26.10 in /docs
Bumps [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) from 7.24.0 to 7.26.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-helpers)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 09:51:46 +00:00
Manish Madan
d094e7a4c6 Merge pull request #1704 from arc53/dependabot/npm_and_yarn/frontend/babel/runtime-7.26.10
build(deps): bump @babel/runtime from 7.25.0 to 7.26.10 in /frontend
2025-05-27 15:19:39 +05:30
dependabot[bot]
945c155b17 build(deps): bump @babel/runtime from 7.25.0 to 7.26.10 in /frontend
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.25.0 to 7.26.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 09:44:53 +00:00
Manish Madan
f798072a1e Merge pull request #1632 from arc53/dependabot/npm_and_yarn/extensions/react-widget/dompurify-3.2.4
build(deps): bump dompurify from 3.1.5 to 3.2.4 in /extensions/react-widget
2025-05-27 15:04:39 +05:30
Manish Madan
f967214b57 Merge pull request #1524 from arc53/dependabot/npm_and_yarn/frontend/react-redux-9.2.0
build(deps): bump react-redux from 8.1.3 to 9.2.0 in /frontend
2025-05-27 15:03:56 +05:30
dependabot[bot]
d0b92e2540 build(deps): bump react-redux from 8.1.3 to 9.2.0 in /frontend
Bumps [react-redux](https://github.com/reduxjs/react-redux) from 8.1.3 to 9.2.0.
- [Release notes](https://github.com/reduxjs/react-redux/releases)
- [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reduxjs/react-redux/compare/v8.1.3...v9.2.0)

---
updated-dependencies:
- dependency-name: react-redux
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 09:25:20 +00:00
dependabot[bot]
8ddfe272bf build(deps): bump dompurify in /extensions/react-widget
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.1.5 to 3.2.4.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.1.5...3.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 09:20:40 +00:00
Siddhant Rai
b7a6bad7cd fix: minor bugs and route errors 2025-05-27 13:50:13 +05:30
Alex
e2f6c04406 (fix:AgentDetailsModal) update shared token URL format in AgentDetailsModal 2025-05-24 00:12:31 +01:00
Alex
c662725955 Merge pull request #1812 from ManishMadan2882/main
Tools redesign
2025-05-23 23:49:45 +01:00
ManishMadan2882
4b66ddfdef (fix:config) use default variant for confirm modal 2025-05-24 01:20:57 +05:30
ManishMadan2882
2d55b1f592 (fix:confirmModal) only close modal on click outisde 2025-05-24 01:19:14 +05:30
ManishMadan2882
14adfabf7e (feat:tools) reflect custom name on ui 2025-05-24 01:17:22 +05:30
Alex
e7a76ede76 Merge pull request #1813 from arc53/react-improve
React improve
2025-05-23 15:25:19 +01:00
Alex
de47df3bf9 fix: enhance ReActAgent's reasoning iterations and update planning prompt structure 2025-05-23 15:10:12 +01:00
Alex
5475e6f7c5 fix: enhance ReActAgent's response handling and update planning prompt 2025-05-23 14:21:02 +01:00
ManishMadan2882
8e3f3d74d4 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-23 18:22:20 +05:30
ManishMadan2882
046f6c66ed (feat:tools) warn on unsaved changes, deep compare 2025-05-23 18:22:06 +05:30
Manish Madan
79f9d6552e Merge branch 'arc53:main' into main 2025-05-23 03:37:53 +05:30
ManishMadan2882
56b4b63749 (fix/tools) custom actions only for api tool, allow delete 2025-05-23 03:36:27 +05:30
ManishMadan2882
b3246a48c7 (fix/addAction) duplicate placeholders 2025-05-23 03:11:54 +05:30
ManishMadan2882
71722ef6a3 (fix/config) correctly placed save btn 2025-05-23 00:57:42 +05:30
ManishMadan2882
ebf8f00302 (fix/input) minor details 2025-05-23 00:56:50 +05:30
Alex
7445928c7e (fix:stream) handle empty history input and improve user identification 2025-05-22 13:14:10 +01:00
ManishMadan2882
5ab7602f2f (feat:tools) ask for custom names 2025-05-22 17:14:52 +05:30
ManishMadan2882
a340aff63a (feat:tools) store custom names 2025-05-22 17:14:05 +05:30
ManishMadan2882
f82042ff00 (feat:config) custom name 2025-05-22 15:27:29 +05:30
ManishMadan2882
920422e28c Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-22 15:25:28 +05:30
ManishMadan2882
50d6b7a6f8 (fix/input) placeholder 2025-05-22 15:24:58 +05:30
Alex
41d624a36a Merge pull request #1810 from ManishMadan2882/main
(fix:layout) even action buttons
2025-05-21 18:59:01 +01:00
ManishMadan2882
f42c37c82e (fix:layout) even action buttons 2025-05-21 23:23:49 +05:30
Alex
119fcdf6f6 Merge pull request #1809 from ManishMadan2882/feat/sources-in-widget
(release-widget)0.5.1
2025-05-21 14:04:38 +01:00
ManishMadan2882
a5b093d1a9 (release-widget)0.5.1 2025-05-21 16:36:52 +05:30
Alex
e07cb44a3e Merge pull request #1806 from arc53/documentation-agents
Documentation agents
2025-05-21 11:44:05 +03:00
Alex
fec1bcfd5c Merge pull request #1789 from ManishMadan2882/main
Frontend Fixes
2025-05-21 01:05:47 +03:00
Alex
dbcf658343 Merge pull request #1808 from ManishMadan2882/feat/sources-in-widget
Glassmorphic effect on search widget
2025-05-21 01:00:49 +03:00
ManishMadan2882
d89e78c9ca (feat:search) minor adjust 2025-05-21 02:59:22 +05:30
ManishMadan2882
ec50650dfa (fix/searchwidget) prominent placeholder, sleek spinner 2025-05-21 02:00:47 +05:30
ManishMadan2882
7432e551f9 (fix/loader) drop on empty input 2025-05-21 01:40:03 +05:30
ManishMadan2882
4ee6bd44d1 (feat:glassy) search widget 2025-05-21 01:26:34 +05:30
Pavel
26f819098d agents and tools doc update 2025-05-20 20:32:38 +04:00
Alex
a1c79f93d7 Merge pull request #1801 from siiddhantt/feat/agents-enhance
feat: enhance agent sharing functionality and UI improvements
2025-05-20 18:40:22 +03:00
GH Action - Upstream Sync
9c1b202d74 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-20 01:42:17 +00:00
Pavel
8ad0f59f19 jwt update 2025-05-19 21:12:14 +04:00
Alex
50fbe3d5af Merge pull request #1798 from arc53/dependabot/pip/application/markdownify-1.1.0
build(deps): bump markdownify from 0.14.1 to 1.1.0 in /application
2025-05-19 14:01:13 +03:00
GH Action - Upstream Sync
af40a77d24 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-19 01:45:51 +00:00
dependabot[bot]
8af9a5e921 build(deps): bump markdownify from 0.14.1 to 1.1.0 in /application
Bumps [markdownify](https://github.com/matthewwithanm/python-markdownify) from 0.14.1 to 1.1.0.
- [Release notes](https://github.com/matthewwithanm/python-markdownify/releases)
- [Commits](https://github.com/matthewwithanm/python-markdownify/compare/0.14.1...1.1.0)

---
updated-dependencies:
- dependency-name: markdownify
  dependency-version: 1.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-18 12:07:13 +00:00
Alex
9807788ecb Merge pull request #1795 from arc53/dependabot/pip/application/pypdf-5.5.0
build(deps): bump pypdf from 5.2.0 to 5.5.0 in /application
2025-05-18 15:05:57 +03:00
dependabot[bot]
5e2f329f15 build(deps): bump pypdf from 5.2.0 to 5.5.0 in /application
Bumps [pypdf](https://github.com/py-pdf/pypdf) from 5.2.0 to 5.5.0.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/5.2.0...5.5.0)

---
updated-dependencies:
- dependency-name: pypdf
  dependency-version: 5.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-18 12:02:27 +00:00
Alex
9572a7adaa Merge pull request #1800 from arc53/dependabot/pip/application/boto3-1.38.18
build(deps): bump boto3 from 1.35.97 to 1.38.18 in /application
2025-05-18 15:00:45 +03:00
dependabot[bot]
1ba94f4f5f build(deps): bump boto3 from 1.35.97 to 1.38.18 in /application
Bumps [boto3](https://github.com/boto/boto3) from 1.35.97 to 1.38.18.
- [Release notes](https://github.com/boto/boto3/releases)
- [Commits](https://github.com/boto/boto3/compare/1.35.97...1.38.18)

---
updated-dependencies:
- dependency-name: boto3
  dependency-version: 1.38.18
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-18 11:54:08 +00:00
Alex
237afa0a3a Merge pull request #1799 from arc53/dependabot/pip/application/beautifulsoup4-4.13.4
build(deps): bump beautifulsoup4 from 4.12.3 to 4.13.4 in /application
2025-05-18 14:53:01 +03:00
GH Action - Upstream Sync
d80b7017cf Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-17 01:38:42 +00:00
Siddhant Rai
56793c8db7 feat: enhance agent sharing functionality and UI improvements
- Added shared agents state management in Navigation and AgentsList components.
- Implemented fetching and displaying shared agents in the AgentsList.
- Introduced functionality to hide shared agents with appropriate API integration.
- Updated the SharedAgent component layout for better UI consistency.
- Improved error handling in conversation fetching logic.
- Added new API endpoint for hiding shared agents.
- Updated Redux slice to manage shared agents state.
- Refactored AgentCard and AgentSection components for better code organization and readability.
2025-05-17 05:53:56 +05:30
ManishMadan2882
8edb217943 (fix) source.link is new source.source 2025-05-17 01:41:29 +05:30
ManishMadan2882
23ebcf1065 (fix:all_sources) inlined svg, dom heirarchy 2025-05-17 01:33:37 +05:30
ManishMadan2882
68a5a3d62a (feat:source_cards) enhance ux 2025-05-17 00:15:42 +05:30
ManishMadan2882
8d7236b0db (fix:action-buttons) redirect to conversations 2025-05-17 00:07:54 +05:30
ManishMadan2882
96c7daf818 (fix:modals) use portals 2025-05-16 16:15:02 +05:30
Alex
9d8073d468 Merge pull request #1794 from arc53/remove-duplicate-docs
remove duplicate chat widget page
2025-05-16 12:45:59 +03:00
ManishMadan2882
fc4942e189 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-16 14:33:55 +05:30
ManishMadan2882
ca69d025bd (fix:agents) adhere to new MessageInput 2025-05-16 14:33:30 +05:30
GH Action - Upstream Sync
ffa428e32a Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-16 01:41:33 +00:00
ManishMadan2882
c24e90eaae Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-16 04:12:27 +05:30
ManishMadan2882
ab32eff588 (fix/tool_calls) prevent overscroll somehow 2025-05-16 04:09:52 +05:30
ManishMadan2882
7f592f2b35 (fix/layout) prevent overlap in tab screen 2025-05-16 01:56:53 +05:30
dependabot[bot]
3bf7f67adf build(deps): bump beautifulsoup4 from 4.12.3 to 4.13.4 in /application
Bumps [beautifulsoup4](https://www.crummy.com/software/BeautifulSoup/bs4/) from 4.12.3 to 4.13.4.

---
updated-dependencies:
- dependency-name: beautifulsoup4
  dependency-version: 4.13.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-15 20:15:17 +00:00
Pavel
594ce05292 remove duplicate chat widget page 2025-05-15 21:32:59 +04:00
Alex
fe02ca68d5 fix: update API key for DocsGPTWidget 2025-05-15 18:18:12 +01:00
Alex
21ef27ee9b Merge pull request #1791 from arc53/fix-openai-conflict
fix for OPENAI_BASE_URL + ollama can't connect to container
2025-05-15 19:04:21 +03:00
Alex
09d37f669f Merge pull request #1793 from arc53/prompts-update
refactor: enhance AI assistant prompts for clarity and creativity
2025-05-15 16:19:32 +03:00
Pavel
416b776062 redundant f string 2025-05-15 16:57:41 +04:00
Alex
5ed05d4020 refactor: enhance AI assistant prompts for clarity and creativity 2025-05-15 13:30:18 +01:00
Alex
4004bfb5ef Merge pull request #1792 from arc53/read_webpage_tools
feat: add ReadWebpageTool for fetching and converting webpage content…
2025-05-15 15:14:02 +03:00
Alex
45aace8966 feat: add ReadWebpageTool for fetching and converting webpage content to Markdown 2025-05-15 12:56:06 +01:00
Alex
d9fc623dcb Merge pull request #1790 from ManishMadan2882/setup-fix
(fix:dockercompose) volumes, user
2025-05-15 13:37:11 +03:00
Pavel
dbb822f6b0 fix for OPENAI_BASE_URL + ollama can't connect to container
- fix for OpenAI trying to use base_url=""
- fix for ollama container error:
`Error code: 404 - {'error': {'message': 'model "MODEL_NAME" not found, try pulling it first', 'type': 'api_error', 'param': None, 'code': None}}`
2025-05-15 13:50:08 +04:00
ManishMadan2882
3d64dffc32 (fix:dockercompose) volumes, user 2025-05-15 15:19:34 +05:30
GH Action - Upstream Sync
130ece7bc0 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-15 01:38:39 +00:00
Alex
b2809b2e9a remove old deps 2025-05-14 22:03:27 +01:00
Alex
29e89d2965 Merge pull request #1785 from arc53/dependabot/pip/application/yarl-1.20.0
build(deps): bump yarl from 1.18.3 to 1.20.0 in /application
2025-05-14 23:55:09 +03:00
dependabot[bot]
e7d54a639e build(deps): bump yarl from 1.18.3 to 1.20.0 in /application
Bumps [yarl](https://github.com/aio-libs/yarl) from 1.18.3 to 1.20.0.
- [Release notes](https://github.com/aio-libs/yarl/releases)
- [Changelog](https://github.com/aio-libs/yarl/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/yarl/compare/v1.18.3...v1.20.0)

---
updated-dependencies:
- dependency-name: yarl
  dependency-version: 1.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-14 20:50:26 +00:00
Alex
22df98e9bb Merge pull request #1782 from arc53/dependabot/pip/application/prompt-toolkit-3.0.51
build(deps): bump prompt-toolkit from 3.0.50 to 3.0.51 in /application
2025-05-14 23:49:14 +03:00
dependabot[bot]
0d45c44c6f build(deps): bump prompt-toolkit from 3.0.50 to 3.0.51 in /application
Bumps [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) from 3.0.50 to 3.0.51.
- [Release notes](https://github.com/prompt-toolkit/python-prompt-toolkit/releases)
- [Changelog](https://github.com/prompt-toolkit/python-prompt-toolkit/blob/main/CHANGELOG)
- [Commits](https://github.com/prompt-toolkit/python-prompt-toolkit/compare/3.0.50...3.0.51)

---
updated-dependencies:
- dependency-name: prompt-toolkit
  dependency-version: 3.0.51
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-14 20:47:44 +00:00
Alex
63c6912841 lazy load elasticsearch 2025-05-14 21:45:30 +01:00
Alex
73bce73034 Merge pull request #1786 from arc53/dependabot/pip/application/flask-3.1.1
build(deps): bump flask from 3.1.0 to 3.1.1 in /application
2025-05-14 23:40:58 +03:00
Manish Madan
b2582796a2 Merge branch 'arc53:main' into main 2025-05-15 01:20:23 +05:30
Alex
8babb6e68f Merge pull request #1787 from siiddhantt/refactor/agents
refactor: handle empty sources and chunks in agent
2025-05-14 14:39:01 +03:00
Siddhant Rai
d1d28df8a1 fix: handle empty chunks and retriever values in agent creation and update 2025-05-14 09:26:36 +05:30
GH Action - Upstream Sync
cd556d5d43 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-14 01:40:32 +00:00
ManishMadan2882
2855283a2c (fix/shared) append to right state 2025-05-14 04:15:11 +05:30
ManishMadan2882
06c29500f2 (fix:input-lag) localised the input state to messageInput 2025-05-14 04:13:53 +05:30
ManishMadan2882
81104153a6 (feat:action-buttons) combine the buttons at the top of layout 2025-05-14 03:01:57 +05:30
dependabot[bot]
23bfd4683c build(deps): bump flask from 3.1.0 to 3.1.1 in /application
Bumps [flask](https://github.com/pallets/flask) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/3.1.0...3.1.1)

---
updated-dependencies:
- dependency-name: flask
  dependency-version: 3.1.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-13 20:32:17 +00:00
Alex
a52a3e3158 Merge pull request #1750 from arc53/dependabot/pip/application/packaging-25.0
build(deps): bump packaging from 24.1 to 25.0 in /application
2025-05-13 18:34:56 +03:00
Alex
44e524e3c3 build(deps): update langchain and openai dependencies 2025-05-13 16:29:24 +01:00
dependabot[bot]
9a430f73e2 build(deps): bump packaging from 24.1 to 25.0 in /application
Bumps [packaging](https://github.com/pypa/packaging) from 24.1 to 25.0.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/packaging/compare/24.1...25.0)

---
updated-dependencies:
- dependency-name: packaging
  dependency-version: '25.0'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-13 15:10:29 +00:00
Alex
fdea40ec11 Merge pull request #1735 from arc53/dependabot/pip/application/referencing-0.36.2
build(deps): bump referencing from 0.30.2 to 0.36.2 in /application
2025-05-13 18:09:10 +03:00
Alex
526d340849 fix: stale deps 2025-05-13 16:03:48 +01:00
dependabot[bot]
fe95f6ad81 build(deps): bump referencing from 0.30.2 to 0.36.2 in /application
Bumps [referencing](https://github.com/python-jsonschema/referencing) from 0.30.2 to 0.36.2.
- [Release notes](https://github.com/python-jsonschema/referencing/releases)
- [Changelog](https://github.com/python-jsonschema/referencing/blob/main/docs/changes.rst)
- [Commits](https://github.com/python-jsonschema/referencing/compare/v0.30.2...v0.36.2)

---
updated-dependencies:
- dependency-name: referencing
  dependency-version: 0.36.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-13 13:20:27 +00:00
Alex
39e73c37ab Merge pull request #1576 from arc53/dependabot/pip/application/portalocker-3.1.1
build(deps): bump portalocker from 2.10.1 to 3.1.1 in /application
2025-05-13 16:06:44 +03:00
Alex
39b36b6857 Feat: Add MD gen script, enable Qdrant lazy loading 2025-05-13 14:03:05 +01:00
dependabot[bot]
44e98748c5 build(deps): bump portalocker from 2.10.1 to 3.1.1 in /application
Bumps [portalocker](https://github.com/wolph/portalocker) from 2.10.1 to 3.1.1.
- [Release notes](https://github.com/wolph/portalocker/releases)
- [Changelog](https://github.com/wolph/portalocker/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/wolph/portalocker/compare/v2.10.1...v3.1.1)

---
updated-dependencies:
- dependency-name: portalocker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-13 12:44:30 +00:00
Alex
8a7aeee955 Merge pull request #1751 from arc53/dependabot/pip/application/torch-2.7.0
build(deps): bump torch from 2.5.1 to 2.7.0 in /application
2025-05-13 15:41:10 +03:00
dependabot[bot]
1c7befb8d3 build(deps): bump torch from 2.5.1 to 2.7.0 in /application
Bumps [torch](https://github.com/pytorch/pytorch) from 2.5.1 to 2.7.0.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v2.5.1...v2.7.0)

---
updated-dependencies:
- dependency-name: torch
  dependency-version: 2.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-13 12:20:22 +00:00
Alex
d5d59ac62c Merge pull request #1759 from arc53/dependabot/pip/application/transformers-4.51.3
build(deps): bump transformers from 4.49.0 to 4.51.3 in /application
2025-05-13 15:19:18 +03:00
Alex
562f0762a0 Merge pull request #1775 from siiddhantt/feat/enhance-agents
feat: share and pin agents
2025-05-13 11:54:29 +03:00
Siddhant Rai
e46aedce21 Merge branch 'feat/enhance-agents' of https://github.com/siiddhantt/DocsGPT into feat/enhance-agents 2025-05-13 13:05:50 +05:30
Siddhant Rai
57cc09b1d7 feat: update tool display name and improve SharedAgent component layout 2025-05-13 13:05:20 +05:30
ManishMadan2882
e1e608b744 (fix:bubble) sleeker source cards 2025-05-13 06:16:16 +05:30
Alex
cbfa5a5118 Delete .jwt_secret_key 2025-05-12 15:11:42 +03:00
ManishMadan2882
ea9ab5b27c (feat:sources) remove None option, don't close on select 2025-05-12 17:15:03 +05:30
ManishMadan2882
357ced6cba Revert "(fix:message-input) no badge buttons when shared"
This reverts commit d873539856.
2025-05-12 16:32:17 +05:30
ManishMadan2882
3ffda69651 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-12 14:38:33 +05:30
ManishMadan2882
e1bf4e0762 (fix/logs)log must render once 2025-05-12 14:38:15 +05:30
Siddhant Rai
ec7f14b82d Merge branch 'main' into feat/enhance-agents 2025-05-12 13:45:18 +05:30
Siddhant Rai
6520be5b85 feat: shared and pinning agents + fix for streaming tools 2025-05-12 06:06:11 +05:30
GH Action - Upstream Sync
17e4fad6fb Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-05-10 01:36:32 +00:00
Alex
d84c416421 Merge pull request #1774 from arc53/limit-yield-on-tools
fix: truncate tool call results to 50 characters for cleaner output
2025-05-10 00:53:28 +03:00
Alex
32803c89a3 fix: truncate tool call results to 50 characters for cleaner output 2025-05-09 22:52:17 +01:00
Alex
a86bcb5c29 Merge pull request #1773 from arc53/cols-agent-fix
fix:(style) update layout for agent list and card components
2025-05-10 00:21:05 +03:00
Alex
7d76a33790 fix:(style) update layout for agent list and card components 2025-05-09 22:15:55 +01:00
ManishMadan2882
8552e81022 (fix:input) sync with translations 2025-05-09 21:39:54 +05:30
ManishMadan2882
eacdde829f (fix/logs) abnormal scroll over page 2025-05-09 20:07:51 +05:30
ManishMadan2882
d873539856 (fix:message-input) no badge buttons when shared 2025-05-09 20:02:49 +05:30
Alex
24bb2e469d Merge pull request #1772 from ManishMadan2882/main
Bug Fixes
2025-05-09 11:01:01 +03:00
ManishMadan2882
e1aa2cc0b8 (fix:ingestion) store file name as metadata, not path 2025-05-09 02:26:35 +05:30
ManishMadan2882
d073947f3b Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-05-08 16:11:14 +05:30
ManishMadan2882
3243740dd1 (fix-bubble) inconsistent width with snippets 2025-05-08 16:10:31 +05:30
Alex
f9bd566a3b Merge pull request #1768 from ManishMadan2882/main
Attachments : File storage changes
2025-05-08 01:41:08 +03:00
Alex
183251487c lint: remove unused import of 'io' in worker.py 2025-05-07 23:37:35 +01:00
ManishMadan2882
ff532210f7 lint 2025-05-08 00:15:28 +05:30
ManishMadan2882
d0a04d9801 (fix/lint) empty methods 2025-05-08 00:14:42 +05:30
ManishMadan2882
ea6533db4e (fix:attachment) strictly use filename 2025-05-08 00:11:02 +05:30
ManishMadan2882
89d5e7bee5 (feat:attachment) store file in endpoint layer 2025-05-07 19:15:36 +05:30
Alex
7e6cdee592 Merge pull request #1732 from asminkarki012/feature/mermaid-integration
feat[mermaid]:integration of mermaid
2025-05-07 11:52:50 +03:00
ManishMadan2882
990c2fb416 Merge branch 'main' into 'feature/mermaid-integration' 2025-05-07 03:44:47 +05:30
ManishMadan2882
09e054c6aa (fix/scroll) bring back arrowDown button, smoother scroll 2025-05-07 02:48:49 +05:30
ManishMadan2882
23f648f53a (feat/mermaid) zoom as per the requirement 2025-05-07 02:07:57 +05:30
Siddhant Rai
07fa656e7c feat: implement pinning functionality for agents with UI updates 2025-05-06 16:12:55 +05:30
Alex
7858c48f11 fix: zip file uploads 2025-05-06 11:12:26 +01:00
Alex
e56d54c3f0 fix: improve source and description handling in GetAgent and GetAgents responses 2025-05-06 10:59:25 +01:00
ManishMadan2882
f37ca95c10 (fix/mermaid loading): load only the diagrams which stream 2025-05-06 15:16:14 +05:30
ManishMadan2882
72e51bb072 (feat:mermaid) dont pass isDarkTheme 2025-05-06 04:38:38 +05:30
Alex
dcfcbf54be Merge pull request #1767 from arc53/sources-icon-fix-agent-menu
fix: sources icon mini fix
2025-05-06 01:36:29 +03:00
Alex
204936b2d0 fix: sources icon mini fix 2025-05-05 23:34:13 +01:00
ManishMadan2882
98856b39ac (feat:mermaid) zoom onhover, throw syntax errors 2025-05-06 00:53:33 +05:30
Alex
ad5f707486 lint: ruff fix 2025-05-05 18:03:45 +01:00
Alex
5ecfb0ce6d fix: enhance error logging 2025-05-05 17:59:37 +01:00
Alex
2147b3f06f lint: mini fix 2025-05-05 13:14:56 +01:00
Alex
7daed3daaf Merge pull request #1764 from arc53/feat/better-logs
fix: enhance error logging with exception info across multiple modules
2025-05-05 15:13:21 +03:00
Alex
481df4d604 fix: enhance error logging with exception info across multiple modules 2025-05-05 13:12:39 +01:00
Alex
cf333873fd fix: json body 2025-05-05 00:08:56 +01:00
Alex
ae700e8f3a fix: display only 2 demos buttons on mobile 2025-05-04 18:56:33 +01:00
ManishMadan2882
16386a9524 (feat:mermaid) zoom on hover 2025-05-04 19:39:24 +05:30
ManishMadan2882
7e7ce276b2 (fix:mermaid/flicker) separated from markdown 2025-05-02 14:12:24 +05:30
Alex
71c6b41b83 Merge pull request #1762 from arc53/dartpain-patch-2
Update README.md
2025-05-01 17:19:10 +03:00
Alex
4b2faae29a Update README.md 2025-05-01 17:15:08 +03:00
ManishMadan2882
7e28e562d0 (fix:mermaid) download svg/png 2025-05-01 19:37:03 +05:30
dependabot[bot]
93c2e2a597 build(deps): bump transformers from 4.49.0 to 4.51.3 in /application
Bumps [transformers](https://github.com/huggingface/transformers) from 4.49.0 to 4.51.3.
- [Release notes](https://github.com/huggingface/transformers/releases)
- [Commits](https://github.com/huggingface/transformers/compare/v4.49.0...v4.51.3)

---
updated-dependencies:
- dependency-name: transformers
  dependency-version: 4.51.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-29 20:50:32 +00:00
Alex
c45d13d834 Merge pull request #1755 from siiddhantt/feat/agent-menu
feat: agent webhook and minor fixes
2025-04-29 00:41:36 +03:00
Alex
330276cdf7 fix: lint for ruff 2025-04-28 22:32:13 +01:00
Siddhant Rai
22c7015c69 refactor: webhook listener handle both POST and GET requests 2025-04-29 00:29:16 +05:30
Alex
cc67d4a1e2 process all request data implicitly 2025-04-28 17:49:29 +01:00
Siddhant Rai
eeb9da696f Merge remote-tracking branch 'upstream/main' into feat/agent-menu 2025-04-28 17:01:46 +05:30
Siddhant Rai
4979e1ac9a feat: add clsx dependency, enhance logging in agent logic, and improve agent logs component 2025-04-28 14:18:28 +05:30
ManishMadan2882
545353dabf (feat:mermaid) use contentLoaded to render 2025-04-27 03:42:28 +05:30
ManishMadan2882
545376740c (fix:re-render) useRef to check for bottom 2025-04-26 19:33:24 +05:30
Siddhant Rai
8289b02ab0 feat: add agent webhook endpoint and implement related functionality 2025-04-26 12:00:29 +05:30
ManishMadan2882
fc0060662b (fix:mermaid) suppress mermaid injected errors in DOM 2025-04-25 21:18:49 +05:30
Alex
df9d432d29 fix: mongo db database name in settings 2025-04-24 17:29:41 +01:00
Alex
76fd6e15cc Update Dockerfile 2025-04-24 18:54:58 +03:00
Alex
06982efda5 Merge pull request #1742 from ManishMadan2882/main
File System Abstraction
2025-04-24 01:32:27 +03:00
Alex
3cd9a72495 add storage type to the settings cofig 2025-04-23 23:13:39 +01:00
ManishMadan2882
0ce27f274a (feat:storage) file indexes/faiss 2025-04-23 04:28:45 +05:30
ManishMadan2882
e60f78ac4a (feat:storage) file uploads 2025-04-23 03:39:35 +05:30
ManishMadan2882
637d3a24a1 Revert "(feat:storage) file, indexes uploads"
This reverts commit 64c42f0ddf.
2025-04-23 00:52:55 +05:30
ManishMadan2882
24c8b24b1f Revert "(fix:indexes) look for the right path"
This reverts commit 5ad34e2216.
2025-04-23 00:52:22 +05:30
ManishMadan2882
5ad34e2216 (fix:indexes) look for the right path 2025-04-22 17:34:25 +05:30
ManishMadan2882
64c42f0ddf (feat:storage) file, indexes uploads 2025-04-22 05:18:07 +05:30
ManishMadan2882
0a31ddaae6 (feat:storage) use get storage 2025-04-22 01:41:53 +05:30
ManishMadan2882
38476cfeb8 (gfeat:storage) get storage instance based on settings 2025-04-22 00:57:57 +05:30
asminkarki012
decc31f1f0 update latest changes 2025-04-21 21:05:12 +05:45
asminkarki012
ea0aa64330 fix: added renderer in answer bubble 2025-04-21 20:50:04 +05:45
Manish Madan
e9a6044645 Merge branch 'main' into main 2025-04-20 16:01:13 +05:30
Alex
474d700df2 Merge pull request #1745 from arc53/dependabot/pip/application/google-generativeai-0.8.5
build(deps): bump google-generativeai from 0.8.3 to 0.8.5 in /application
2025-04-20 01:39:11 +03:00
ManishMadan2882
c50ff6faa3 (feat:fs abstract) googleLLM class 2025-04-18 21:03:28 +05:30
ManishMadan2882
c8efef8f04 (fix:openai) image uplads, use lambda in process_files 2025-04-18 18:27:02 +05:30
dependabot[bot]
1d22f77568 build(deps): bump google-generativeai in /application
Bumps [google-generativeai](https://github.com/google/generative-ai-python) from 0.8.3 to 0.8.5.
- [Release notes](https://github.com/google/generative-ai-python/releases)
- [Changelog](https://github.com/google-gemini/deprecated-generative-ai-python/blob/main/RELEASE.md)
- [Commits](https://github.com/google/generative-ai-python/compare/v0.8.3...v0.8.5)

---
updated-dependencies:
- dependency-name: google-generativeai
  dependency-version: 0.8.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-17 20:06:10 +00:00
ManishMadan2882
5aa51f5f36 (feat:file_abstract) openai attachments comply 2025-04-18 01:27:21 +05:30
ManishMadan2882
335c21c48a (fix:attachment) dont calculate MIME again 2025-04-17 16:36:40 +05:30
ManishMadan2882
c35d1cecfe (feat:file_abstract) return storage metadata after upload 2025-04-17 16:29:34 +05:30
ManishMadan2882
0d3e6157cd (feat:attachmentUpload) parse content before upload 2025-04-17 16:23:01 +05:30
ManishMadan2882
68e4cf4d14 (feat:fsabstract) add factory class 2025-04-17 02:40:53 +05:30
ManishMadan2882
9454150f7d (fix:s3) processor func 2025-04-17 02:36:55 +05:30
ManishMadan2882
0a0e16547e (feat:fs_abstract) attachment uploads 2025-04-17 02:35:45 +05:30
Alex
0aec1b9969 Merge pull request #1739 from siiddhantt/feat/agent-menu
feat: new agents section
2025-04-16 17:50:11 +03:00
Alex
3e1ec23409 fix: lint 2025-04-16 15:47:39 +01:00
Siddhant Rai
2f9f428a2f feat: add prompt management functionality with modal integration 2025-04-16 19:41:16 +05:30
Siddhant Rai
da15cde49c Merge branch 'main' into feat/agent-menu 2025-04-16 18:35:38 +05:30
Siddhant Rai
e6ed37139a feat: implement agent preview functionality and enhance conversation handling 2025-04-16 16:26:47 +05:30
ManishMadan2882
377e33c148 (feat:file_abstract) process files method 2025-04-16 03:36:45 +05:30
ManishMadan2882
e567d88951 ((feat:fs_abstact) s3 2025-04-16 03:31:42 +05:30
ManishMadan2882
89b2937b11 ((feat:fs_abstact) local 2025-04-16 03:31:28 +05:30
ManishMadan2882
142ed75468 ((feat:fs_abstact) base 2025-04-16 03:31:06 +05:30
Siddhant Rai
d80eeb044c feat: add agent timestamps and improve agent retrieval logic 2025-04-15 14:06:20 +05:30
Siddhant Rai
7c69e99914 feat: Enhance agent selection and conversation handling
- Added functionality to select agents in the Navigation component, allowing users to reset conversations and set the selected agent.
- Updated the MessageInput component to conditionally show source and tool buttons based on the selected agent.
- Modified the Conversation component to handle agent-specific queries and manage file uploads.
- Improved conversation fetching logic to include agent IDs and handle attachments.
- Introduced new types for conversation summaries and results to streamline API responses.
- Refactored Redux slices to manage selected agent state and improve overall state management.
- Enhanced error handling and loading states across components for better user experience.
2025-04-15 11:53:53 +05:30
Alex
5e1aaf5a44 Merge pull request #1733 from ManishMadan2882/main
Attachments: Enhancements , strategy specific to certain LLMs
2025-04-15 01:55:46 +03:00
Alex
ad610d2f90 fix: lint ruff 2025-04-14 23:49:40 +01:00
Alex
02934452d6 fix: remove comment 2025-04-14 23:48:17 +01:00
ManishMadan2882
8b054010e1 (Feat:input) sleek attachment pills 2025-04-15 03:30:11 +05:30
Alex
5b77f3839b fix: maybe 2025-04-14 20:24:05 +01:00
Alex
231b792452 fix: streaming with tools google and openai halfway 2025-04-14 18:54:40 +01:00
ManishMadan2882
b468e0c164 (fix:generation) attach + tools 2025-04-13 18:33:26 +05:30
Siddhant Rai
fa1f9d7009 feat: agents route replacing chatbots
- Removed API Keys tab from SettingsBar and adjusted tab layout.
- Improved styling for tab scrolling buttons and gradient indicators.
- Introduced AgentDetailsModal for displaying agent access details.
- Updated Analytics component to fetch agent data and handle analytics for selected agent.
- Refactored Logs component to accept agentId as a prop for filtering logs.
- Enhanced type definitions for InputProps to include textSize.
- Cleaned up unused imports and optimized component structure across various files.
2025-04-11 17:24:22 +05:30
asminkarki012
c5a8f3abcd refact:generate unique meraid id using crypto.randomUUID 2025-04-11 11:48:07 +05:45
ManishMadan2882
dfe6a8d3e3 (feat:attach) simplify the format for files 2025-04-11 01:53:17 +05:30
ManishMadan2882
292257770c (refactor:attach) centralize attachment state 2025-04-10 03:02:39 +05:30
ManishMadan2882
b4c6b2b08b (feat:utils) getOS, isTouchDevice 2025-04-10 01:44:49 +05:30
ManishMadan2882
6cb4577e1b (feat:input) hotkey for sources open 2025-04-10 01:43:46 +05:30
ManishMadan2882
456784db48 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-04-10 01:29:52 +05:30
ManishMadan2882
dd9ea46e58 (feat:attach) strategy specific to google genai 2025-04-10 01:29:01 +05:30
GH Action - Upstream Sync
ed3af2fac0 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-04-09 01:27:51 +00:00
Alex
02f8132f3a Update README.md 2025-04-08 15:56:34 +03:00
ManishMadan2882
55bd90fad9 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-04-08 17:51:27 +05:30
ManishMadan2882
cd7bbb45c3 (fix:popups) minor hover 2025-04-08 17:51:18 +05:30
Alex
6c7fc0ed22 Merge pull request #1729 from arc53/setup-windows
win-setup
2025-04-08 13:58:28 +03:00
ManishMadan2882
5421bc1386 (feat:attach) extend support for imgs 2025-04-08 15:51:37 +05:30
GH Action - Upstream Sync
051841e566 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-04-08 01:27:09 +00:00
ManishMadan2882
0c68815cf2 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-04-07 20:16:12 +05:30
ManishMadan2882
0c1138179b (feat:attch) store file mime type 2025-04-07 20:16:03 +05:30
ManishMadan2882
1f3d1cc73e (feat:attach) handle unsupported attachments 2025-04-07 20:15:11 +05:30
Alex
707d1332de Merge pull request #1734 from arc53/fix-thought-param
fix: thought param in /api/answer
2025-04-07 13:08:23 +03:00
Alex
f6c88da81b fix: thought param in /api/answer 2025-04-07 11:03:49 +01:00
GH Action - Upstream Sync
a651e6e518 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-04-07 01:37:46 +00:00
Alex
bea89b93eb Merge pull request #1730 from arc53/dependabot/pip/application/multidict-6.3.2
build(deps): bump multidict from 6.1.0 to 6.3.2 in /application
2025-04-06 22:00:31 +03:00
ManishMadan2882
244c9b96a2 (fix:attach) pass attachment docs as it is 2025-04-06 16:02:30 +05:30
ManishMadan2882
a37bd76950 (feat:storeAttach) store in inputs, raise errors from worker 2025-04-06 16:01:57 +05:30
ManishMadan2882
9d70032de8 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-04-06 15:57:26 +05:30
ManishMadan2882
e4945b41e9 (feat:files) link attachment to openai_api 2025-04-06 15:57:18 +05:30
Pavel
493dc8689c guide-updates 2025-04-05 17:49:56 +04:00
GH Action - Upstream Sync
bdac2ffa27 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-04-05 01:25:36 +00:00
asminkarki012
b1235f3ce0 feat[mermaid]:clean comment 2025-04-04 18:40:57 +05:45
asminkarki012
ba4bb63a1f feat[mermaid]:integration of mermaid 2025-04-04 18:36:45 +05:45
Alex
3227b0e69c Merge pull request #1722 from asminkarki012/fix/csv-parser-include-headers
fix[csv_parser]:missing header
2025-04-04 14:53:45 +03:00
ManishMadan2882
29c899627e Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-04-04 03:31:45 +05:30
ManishMadan2882
5923781484 (feat:attach) warning for error, progress, removal 2025-04-04 03:29:01 +05:30
dependabot[bot]
8bb263a2ec build(deps): bump multidict from 6.1.0 to 6.3.2 in /application
Bumps [multidict](https://github.com/aio-libs/multidict) from 6.1.0 to 6.3.2.
- [Release notes](https://github.com/aio-libs/multidict/releases)
- [Changelog](https://github.com/aio-libs/multidict/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/multidict/compare/v6.1.0...v6.3.2)

---
updated-dependencies:
- dependency-name: multidict
  dependency-version: 6.3.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-03 20:24:09 +00:00
Alex
94c7bba168 Merge pull request #1716 from ManishMadan2882/main
Sources + Tools
2025-04-03 02:03:47 +03:00
ManishMadan2882
f9ad4c068a (feat:attach) fallback strategy to process docs 2025-04-03 03:26:37 +05:30
ManishMadan2882
19d68252cd (fix/attach): inputs are created in application 2025-04-02 16:36:58 +05:30
ManishMadan2882
72bbe3b1ce Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-04-02 15:57:45 +05:30
ManishMadan2882
856824316b (feat: attach) handle them locally from message input 2025-04-02 15:33:35 +05:30
ManishMadan2882
95e189d1d8 (feat:base/agents) default attachment 2025-04-02 15:29:04 +05:30
ManishMadan2882
c629460acb (feat:attach) extract contents in endpoint layer 2025-04-02 15:21:33 +05:30
ManishMadan2882
f235a94986 (feat:attach) pass attachments for generation 2025-04-02 15:14:56 +05:30
GH Action - Upstream Sync
632cba86e9 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-04-02 01:36:06 +00:00
Alex
6b92c7eccc Update README.md 2025-04-01 12:27:55 +03:00
Alex
ab0da1abac Merge pull request #1721 from siiddhantt/feat/react-agent
feat: ReActAgent and agent refactor
2025-04-01 12:08:09 +03:00
Siddhant Rai
7f31ac7bcb refactor: minor changes 2025-04-01 12:33:43 +05:30
Pavel
57a6fb31b2 periodic header injection 2025-03-31 22:28:04 +04:00
Siddhant Rai
fd2b6c111c feat: enhance ClassicAgent and ReActAgent with tool preparation steps 2025-03-31 17:02:36 +05:30
GH Action - Upstream Sync
302458b505 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-30 01:40:32 +00:00
Alex
0e31329785 Merge pull request #1723 from arc53/dependabot/pip/application/langsmith-0.3.19 2025-03-29 21:14:46 +02:00
GH Action - Upstream Sync
8978a4cf2d Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-29 01:25:46 +00:00
dependabot[bot]
57d103116f build(deps): bump langsmith from 0.3.15 to 0.3.19 in /application
Bumps [langsmith](https://github.com/langchain-ai/langsmith-sdk) from 0.3.15 to 0.3.19.
- [Release notes](https://github.com/langchain-ai/langsmith-sdk/releases)
- [Commits](https://github.com/langchain-ai/langsmith-sdk/compare/v0.3.15...v0.3.19)

---
updated-dependencies:
- dependency-name: langsmith
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-28 20:55:06 +00:00
Alex
a4e9ee72d4 Merge pull request #1713 from arc53/dependabot/pip/application/pymongo-4.11.3 2025-03-28 22:45:04 +02:00
asminkarki012
c70be12bfd fix[csv_parser]:missing header 2025-03-28 22:46:11 +05:45
ManishMadan2882
4241307990 (fix:responsive/messageInput) sleek badge buttons, aligned send btn 2025-03-28 20:42:12 +05:30
ManishMadan2882
727a8ef13d (fix:responsive) tools and source pop 2025-03-28 20:40:46 +05:30
ManishMadan2882
7c92558ad1 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-28 18:13:42 +05:30
ManishMadan2882
45083d29a6 (feat:attach) show files on conversations 2025-03-28 18:13:24 +05:30
ManishMadan2882
5089d86095 (feat:attach) send attachment ids 2025-03-28 18:12:38 +05:30
ManishMadan2882
80e55ef385 (feat:attach) functionality to upload files 2025-03-28 18:10:18 +05:30
GH Action - Upstream Sync
b5ed98445f Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-28 01:26:07 +00:00
Siddhant Rai
82d377abf5 feat: add support for thought processing in conversation flow and introduce ReActAgent 2025-03-27 23:19:08 +05:30
ManishMadan2882
2dbea5d1b2 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-27 16:55:49 +05:30
ManishMadan2882
4ba35d6189 (feat: attachment) integrate upload on fe 2025-03-27 16:54:21 +05:30
Alex
1620b4f214 Merge pull request #1709 from Charlesnorris509/main
Update Navigation.tsx
2025-03-27 11:28:45 +02:00
GH Action - Upstream Sync
cec3f987f2 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-27 01:26:14 +00:00
GH Action - Upstream Sync
ec27445728 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-27 01:21:05 +00:00
ManishMadan2882
55050a9f58 (feat:attachment) upload single file 2025-03-27 03:28:03 +05:30
Alex
4b1f572b04 Merge pull request #1720 from arc53/dependabot/npm_and_yarn/docs/next-14.2.26
build(deps): bump next from 14.2.22 to 14.2.26 in /docs
2025-03-26 16:53:50 +02:00
ManishMadan2882
502dc9ec52 (feat:attachments) store and ingest files shared 2025-03-26 18:01:31 +05:30
dependabot[bot]
28f925ef75 build(deps): bump next from 14.2.22 to 14.2.26 in /docs
Bumps [next](https://github.com/vercel/next.js) from 14.2.22 to 14.2.26.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.22...v14.2.26)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-26 06:23:32 +00:00
ManishMadan2882
9c8999a3ae (fix:sources) doc selection for preLoaded 2025-03-25 19:04:31 +05:30
ManishMadan2882
90db42ce3a Revert "(fix:sources) preloaded docs have ids too"
This reverts commit 02c8bd06f5.
2025-03-25 16:08:59 +05:30
ManishMadan2882
551130f0e1 (feat:sources/tools) ui perfection for pop-ups 2025-03-25 03:22:21 +05:30
Charles Norris
98abeabc0d Update ConversationTile.tsx 2025-03-24 16:10:41 -04:00
ManishMadan2882
2940a60b3c (faet:input) tools pop-up 2025-03-24 17:16:24 +05:30
ManishMadan2882
76b9bc0d56 (feat:input) sources pop-up 2025-03-24 17:15:57 +05:30
ManishMadan2882
42422ccdcd (feat:settings) routes for tab 2025-03-24 13:56:12 +05:30
ManishMadan2882
e9702ae2de Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-21 23:57:09 +05:30
ManishMadan2882
5c54852ebe (fix:tools) no tools placeholder 2025-03-21 23:56:47 +05:30
GH Action - Upstream Sync
718a86ecda Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-21 01:26:21 +00:00
GH Action - Upstream Sync
e02f19058e Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-21 01:21:33 +00:00
Pavel
1223fd2149 win-setup 2025-03-20 21:48:59 +03:00
Alex
4095b2b674 Merge pull request #1714 from siiddhantt/fix/retrievers-broken
fix: brave and duckduckgo retrievers
2025-03-20 13:00:34 +00:00
Siddhant Rai
3be6e2132b refactor: remove outdated vector store tests 2025-03-20 17:27:18 +05:30
ManishMadan2882
b09386d102 (clean:nav) rm source dropdown 2025-03-20 11:26:45 +05:30
ManishMadan2882
6464698b6d Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-20 09:47:38 +05:30
ManishMadan2882
9230fd3bd6 Revert "(feat:nav) clean-up source dropdown"
This reverts commit 561a125c92.
2025-03-20 09:47:29 +05:30
ManishMadan2882
7771609ea0 (locales) udpate placeholder 2025-03-20 09:43:36 +05:30
ManishMadan2882
561a125c92 (feat:nav) clean-up source dropdown 2025-03-20 09:42:57 +05:30
ManishMadan2882
7149461d8e (feat:sources) add pop-up to switch sources 2025-03-20 09:42:08 +05:30
ManishMadan2882
02c8bd06f5 (fix:sources) preloaded docs have ids too 2025-03-20 09:39:30 +05:30
Siddhant Rai
0732d9b6c8 fix: brave and duckduckgo retrievers 2025-03-20 08:27:00 +05:30
GH Action - Upstream Sync
2952c1be08 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-20 01:19:59 +00:00
dependabot[bot]
96c4a13c93 build(deps): bump pymongo from 4.10.1 to 4.11.3 in /application
Bumps [pymongo](https://github.com/mongodb/mongo-python-driver) from 4.10.1 to 4.11.3.
- [Release notes](https://github.com/mongodb/mongo-python-driver/releases)
- [Changelog](https://github.com/mongodb/mongo-python-driver/blob/4.11.3/doc/changelog.rst)
- [Commits](https://github.com/mongodb/mongo-python-driver/compare/4.10.1...4.11.3)

---
updated-dependencies:
- dependency-name: pymongo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 08:40:51 +00:00
Alex
53abf1a79e Merge pull request #1701 from siiddhantt/feat/jwt-auth
feat: implement JWT authentication and token management
2025-03-19 08:39:29 +00:00
Siddhant Rai
f00802dd6b fix: llm tests failing 2025-03-19 10:25:46 +05:30
Siddhant Rai
ab95d90284 feat: pass decoded_token to llm and retrievers 2025-03-18 23:46:02 +05:30
ManishMadan2882
9f17eb1d28 feat(textInput) new design 2025-03-18 19:33:26 +05:30
Siddhant Rai
f4ab85a2bb feat: minor fixes after merge 2025-03-18 18:56:02 +05:30
Siddhant Rai
5b40c5a9d7 Merge branch 'main' into feat/jwt-auth 2025-03-18 18:26:29 +05:30
Siddhant Rai
6583aeff08 feat: update authentication handling and integrate token usage across frontend and backend 2025-03-18 08:29:57 +05:30
Charles Norris
b1c531fbcc Update Navigation.tsx
Typo on onCoversationClick() function it should be onConversationClick()
2025-03-17 16:51:33 -04:00
Siddhant Rai
4406426515 feat: implement session_jwt and enhance auth 2025-03-17 11:51:30 +05:30
Alex
af48782464 Merge pull request #1708 from ManishMadan2882/main
Refactor(fe): Conversation
2025-03-16 20:05:46 +00:00
Manish Madan
726d4ddd9f Merge branch 'arc53:main' into main 2025-03-16 04:08:26 +05:30
ManishMadan2882
adc637b689 (clean:unused) 2025-03-16 04:07:33 +05:30
ManishMadan2882
d6c9b4fbc9 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-16 04:02:12 +05:30
ManishMadan2882
e17cc8ea34 (fix:date) handle iso 8601 date 2025-03-16 04:01:19 +05:30
ManishMadan2882
574a0e2dba (fix:conv) perfect aligment 2025-03-16 03:57:31 +05:30
ManishMadan2882
fd0bd13b08 (refactor:conv) separate textarea 2025-03-16 02:01:32 +05:30
Alex
f8c92147cd deps: bump langchian things 2025-03-15 19:51:30 +00:00
Alex
8136cd78d3 Merge pull request #1698 from arc53/dependabot/pip/application/duckduckgo-search-7.5.2
build(deps): bump duckduckgo-search from 7.4.2 to 7.5.2 in /application
2025-03-15 19:16:39 +00:00
ManishMadan2882
d9c4331480 (refactor:conv) wrap msgs separately 2025-03-15 16:41:56 +05:30
Alex
7af726f4b2 Merge pull request #1702 from nickaggarwal/main
fix signature for AzureOpenAILLM
2025-03-14 22:08:36 +00:00
ManishMadan2882
a50f3bc55b (fix:sourceDropdown) ask before delete 2025-03-15 00:15:23 +05:30
Nilesh Agarwal
5438bf9754 fix signature for AzureOpenAILLM 2025-03-14 09:52:09 -07:00
Siddhant Rai
7fd377bdbe feat: implement JWT authentication and token management in frontend and backend 2025-03-14 17:07:15 +05:30
Alex
84620a7375 Merge pull request #1700 from ScriptScientist/main
fix: docker compose up doesn't use the env
2025-03-14 10:39:28 +00:00
rock.lee
6968317db2 fix: docker compose up doesn't use the env and setup script will not exit when service start success 2025-03-14 17:09:10 +08:00
dependabot[bot]
67a92428b5 build(deps): bump duckduckgo-search from 7.4.2 to 7.5.2 in /application
Bumps [duckduckgo-search](https://github.com/deedy5/duckduckgo_search) from 7.4.2 to 7.5.2.
- [Release notes](https://github.com/deedy5/duckduckgo_search/releases)
- [Commits](https://github.com/deedy5/duckduckgo_search/compare/v7.4.2...v7.5.2)

---
updated-dependencies:
- dependency-name: duckduckgo-search
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 20:19:41 +00:00
Alex
5bb639f0ad Merge pull request #1670 from ManishMadan2882/main
Figma consolidation
2025-03-13 15:21:03 +00:00
ManishMadan2882
5bc758aa2d (fix:ui) minor adjustments 2025-03-13 20:39:17 +05:30
Pavel
27b24f19de user-avatar-svg 2025-03-13 14:25:41 +03:00
GH Action - Upstream Sync
3dfde84827 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-13 01:25:22 +00:00
Alex
5e39be6a2c fix: tests anthropic 2025-03-13 00:32:24 +00:00
Alex
35248991e7 fix: cache 2025-03-13 00:25:52 +00:00
Alex
b76e820122 fix: ruff fix 2025-03-13 00:11:50 +00:00
Alex
51eced00aa fix: openai compatable with llama and gemini 2025-03-13 00:10:13 +00:00
ManishMadan2882
079a216f5b (fix:chunkDocs) alike purple action btn 2025-03-13 03:08:02 +05:30
ManishMadan2882
8b5df98f57 (fix:ui) minor adjust 2025-03-13 03:06:49 +05:30
ManishMadan2882
fb6fd5b5b2 (fix:input) unwanted autocomplete style 2025-03-13 03:06:22 +05:30
Alex
5d5ea3eb8f Merge pull request #1689 from ScriptScientist/main
feat: novita llms support
2025-03-12 21:03:09 +00:00
ManishMadan2882
21360981ee (fix:tool-cards) ui adjust 2025-03-13 01:39:51 +05:30
ManishMadan2882
0b3cad152f (fix:prompts) design specs 2025-03-13 00:43:56 +05:30
Alex
2c2dbe45a6 Merge pull request #1696 from arc53/fixes-cache
Fixes cache
2025-03-12 17:37:38 +00:00
ManishMadan2882
5c7a3a515c (fix:general) perfect labels, delete btn 2025-03-12 22:52:08 +05:30
Alex
f2b05ad56d fix: handle cache issues with more grace 2025-03-12 15:13:14 +00:00
Alex
5f9702b91c fix: /search 2025-03-12 13:47:16 +00:00
ManishMadan2882
93de4065c7 (fix:tables) table header, name table data 2025-03-12 17:32:05 +05:30
ManishMadan2882
8e0e55fe5e (fix:analytics) feedback title 2025-03-12 17:31:30 +05:30
ManishMadan2882
a8a8585570 (fix:purple-btn) hover to 976af3 2025-03-12 08:17:13 +05:30
ManishMadan2882
1f3c07979a (fix:bubble) color adjustments 2025-03-12 06:41:37 +05:30
ManishMadan2882
fa07b3349d (fix:sidebar) upload icon, bg perfect 2025-03-12 05:57:59 +05:30
GH Action - Upstream Sync
519ffe617b Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-11 01:24:52 +00:00
Alex
fe02bf9347 Merge pull request #1693 from siiddhantt/fix/response-and-sources
feat: agent use in answer and enhance search
2025-03-10 12:53:46 +00:00
Siddhant Rai
faa583864d feat: enhance conversation saving and response streaming with source handling 2025-03-10 14:19:43 +05:30
GH Action - Upstream Sync
1a7504eba0 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-10 01:11:30 +00:00
Alex
46d32b4072 Merge pull request #1682 from arc53/dependabot/pip/application/jinja2-3.1.6
build(deps): bump jinja2 from 3.1.5 to 3.1.6 in /application
2025-03-10 00:04:03 +00:00
Alex
18d8b9c395 Merge pull request #1692 from arc53/tool-ntfy
feat: ntfy tool
2025-03-09 01:28:00 +00:00
Alex
8b9b74464e feat: ntfy tool 2025-03-09 01:22:00 +00:00
rock.lee
867c375843 add novita provider 2025-03-08 15:45:49 +08:00
GH Action - Upstream Sync
54ca6acf5a Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-08 01:07:50 +00:00
ManishMadan2882
6ac2d6d228 (fix:tile) hover behaviour on rename 2025-03-08 00:48:53 +05:30
ManishMadan2882
10c7a5f36b (clean) comments 2025-03-07 20:24:38 +05:30
Alex
4fd6c52951 fix: api tool avoid sending body if empty 2025-03-07 14:34:23 +00:00
ManishMadan2882
93fea17918 (feat:config) color name update 2025-03-07 19:55:47 +05:30
ManishMadan2882
b3f6a3aae6 (fix:ui) mninor adjustments 2025-03-07 17:20:14 +05:30
ManishMadan2882
773147701d (fix:ui) tool cards 2025-03-07 17:19:14 +05:30
ManishMadan2882
d891c8dae2 (fix:ui) minor perfections 2025-03-07 17:18:28 +05:30
ManishMadan2882
101852c7d1 (feat:toggle) add id, aria props 2025-03-07 17:16:45 +05:30
ManishMadan2882
c1f13ba8b1 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-07 17:11:00 +05:30
ManishMadan2882
71e45860f3 (fix:input) remove ambiguous label prop 2025-03-07 17:10:48 +05:30
ManishMadan2882
25dfd63c4f (fix:ui) color adjust 2025-03-07 17:09:00 +05:30
ManishMadan2882
fc12d7b4c8 (fix:tool) rely on reusable components 2025-03-07 17:07:01 +05:30
GH Action - Upstream Sync
a6eedc6d84 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-07 01:24:48 +00:00
Alex
b523a98289 Merge pull request #1671 from aidanbennettjones/AidanComponentEditChat
Enables Enter Key Functionality to Submit Edited Chats
2025-03-06 16:44:06 -05:00
Alex
a0929c96ba fix: postgres tool migration 2025-03-06 16:20:19 +00:00
Alex
ae1f25379f Merge pull request #1684 from arc53/brave-tool
brave-tool
2025-03-06 11:17:47 -05:00
Pavel
1e3c8cb7b1 fix imports 2025-03-06 19:13:19 +03:00
Pavel
b9f28705c8 brave-tool 2025-03-06 18:46:50 +03:00
Alex
ad4f3ce379 Merge pull request #1648 from siiddhantt/feat/agent-refactor-and-logging
feat: agent-retriever workflow + logging stack
2025-03-06 09:32:18 -05:00
Alex
d4f53bf6bb fix: ruff check 2025-03-06 14:31:46 +00:00
dependabot[bot]
2ea2819477 build(deps): bump jinja2 from 3.1.5 to 3.1.6 in /application
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.5...3.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 04:47:24 +00:00
Alex
49a2b2ce6d fix: agent not forgotten 2025-03-05 16:11:06 -05:00
Alex
06edc261c0 fix: duplicates... 2025-03-05 16:09:13 -05:00
Alex
af69bc9d3c Merge branch 'main' into feat/agent-refactor-and-logging 2025-03-05 16:04:09 -05:00
ManishMadan2882
6eb8256220 (feat:docs,chatbots) danger delete btn 2025-03-06 02:00:05 +05:30
ManishMadan2882
ecf3067d67 (fix:analytics) rename feedback title 2025-03-06 01:58:37 +05:30
ManishMadan2882
3a7f23f75e (feat:logs) ui 2025-03-06 01:56:38 +05:30
Siddhant Rai
f88c34a0be feat: streaming responses with function call 2025-03-05 09:02:55 +05:30
ManishMadan2882
572c57e023 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-05 03:53:34 +05:30
ManishMadan2882
79cf2150d5 (fix:ui) minor adjustments 2025-03-05 03:15:50 +05:30
ManishMadan2882
68b868047e (feat:copy) prop to showText 2025-03-05 03:13:34 +05:30
ManishMadan2882
377670b34a (feat:docs) adding view option 2025-03-05 03:12:48 +05:30
ManishMadan2882
2b7f4de832 (feat:docs):add contextMenu to actions 2025-03-04 18:53:23 +05:30
GH Action - Upstream Sync
4a88a63fa0 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-04 01:24:01 +00:00
Alex
bf195051e2 Merge pull request #1663 from arc53/dependabot/pip/application/primp-0.14.0
build(deps): bump primp from 0.10.0 to 0.14.0 in /application
2025-03-03 14:50:26 +00:00
GH Action - Upstream Sync
c3ccd9feff Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-03 01:25:14 +00:00
Alex
2d0f0948fb Merge pull request #1673 from arc53/dependabot/pip/application/anthropic-0.49.0
build(deps): bump anthropic from 0.45.2 to 0.49.0 in /application
2025-03-02 22:44:03 +00:00
aidanbennettjones
fc7a5d098d Merge branch 'arc53:main' into AidanComponentEditChat 2025-03-02 13:35:20 -05:00
aidanbennettjones
b7f766ab82 Fix Number of Rows and Remove Comments 2025-03-02 13:34:55 -05:00
ManishMadan2882
bfffd5e4b3 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-03-01 20:15:24 +05:30
ManishMadan2882
63ba005f4d (fix:ui) minor color perfections 2025-03-01 20:15:10 +05:30
ManishMadan2882
f66ef05f2a (feat:barGraph) on hover opacity 2025-03-01 20:14:27 +05:30
ManishMadan2882
a3b28843b6 (feat:confirm-modal) danger variant 2025-03-01 20:12:40 +05:30
ManishMadan2882
b07ec8accb (feat:general) ui 2025-03-01 20:11:46 +05:30
GH Action - Upstream Sync
06f4b5823a Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-03-01 01:35:16 +00:00
Alex
99fe57f99a Merge pull request #1664 from arc53/dependabot/pip/application/langchain-core-0.3.40
build(deps): bump langchain-core from 0.3.29 to 0.3.40 in /application
2025-03-01 00:58:31 +00:00
dependabot[bot]
d1226031e1 build(deps): bump anthropic from 0.45.2 to 0.49.0 in /application
Bumps [anthropic](https://github.com/anthropics/anthropic-sdk-python) from 0.45.2 to 0.49.0.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases)
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.45.2...v0.49.0)

---
updated-dependencies:
- dependency-name: anthropic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-28 20:35:48 +00:00
aidanbennettjones
78f3e64d5a Merge branch 'arc53:main' into AidanComponentEditChat 2025-02-28 10:35:17 -05:00
ManishMadan2882
1d98e75b92 (fix:share) modal covers screen 2025-02-28 16:41:34 +05:30
ManishMadan2882
66d8d95763 (feat:input) floating input labels 2025-02-28 03:46:26 +05:30
ManishMadan2882
e2bf468195 (refactor) conv tile 2025-02-28 03:45:54 +05:30
ManishMadan2882
b7efc16257 (feat:menu) add reusable menu, ui 2025-02-28 03:44:14 +05:30
ManishMadan2882
ec6bcdff7e (feat:convBubble) minor adjustment 2025-02-28 03:42:34 +05:30
ManishMadan2882
3e65885e1f (feat:toggle) greener colors, flexible 2025-02-28 03:40:42 +05:30
Siddhant Rai
c6ce4d9374 feat: logging stacks 2025-02-27 19:14:10 +05:30
ManishMadan2882
0b437d0e8d (feat:ui) updating hero, code snippets 2025-02-27 03:04:55 +05:30
dependabot[bot]
e1df3be4b9 build(deps): bump langchain-core from 0.3.29 to 0.3.40 in /application
Bumps [langchain-core](https://github.com/langchain-ai/langchain) from 0.3.29 to 0.3.40.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-core==0.3.29...langchain-core==0.3.40)

---
updated-dependencies:
- dependency-name: langchain-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 20:16:15 +00:00
dependabot[bot]
b944769f8c build(deps): bump primp from 0.10.0 to 0.14.0 in /application
Bumps [primp](https://github.com/deedy5/primp) from 0.10.0 to 0.14.0.
- [Release notes](https://github.com/deedy5/primp/releases)
- [Commits](https://github.com/deedy5/primp/compare/v0.10.0...v0.14.0)

---
updated-dependencies:
- dependency-name: primp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 20:16:08 +00:00
Alex
56b8074c22 Merge pull request #1658 from ManishMadan2882/main
Widget upgrade to 0.5.0
2025-02-26 11:05:32 +00:00
ManishMadan2882
b577f322c9 Merge branch 'main' of https://github.com/arc53/docsgpt 2025-02-26 16:17:19 +05:30
ManishMadan2882
b007e2af8f (update:docs) docsgpt dep 2025-02-26 16:12:38 +05:30
ManishMadan2882
df89990aa5 (upgrade:widget) v0.5.0 2025-02-26 16:09:12 +05:30
Alex
c108a53b11 fix: default keys 2025-02-26 10:35:26 +00:00
ManishMadan2882
4831f5bb5d Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-26 14:52:59 +05:30
ManishMadan2882
987ef63e64 (feat:widget) simplify scrolling 2025-02-26 14:52:48 +05:30
Alex
e997e12bb9 Merge pull request #1656 from arc53/dependabot/pip/application/lxml-5.3.1
build(deps): bump lxml from 5.3.0 to 5.3.1 in /application
2025-02-25 22:29:56 +00:00
Alex
6ba0add265 Merge pull request #1655 from arc53/dependabot/pip/application/qdrant-client-1.13.2
build(deps): bump qdrant-client from 1.12.2 to 1.13.2 in /application
2025-02-25 22:29:40 +00:00
Alex
9160c13039 Merge pull request #1651 from arc53/dependabot/pip/application/elasticsearch-8.17.1
build(deps): bump elasticsearch from 8.17.0 to 8.17.1 in /application
2025-02-25 22:28:49 +00:00
Alex
40be9f65e4 Merge pull request #1647 from ManishMadan2882/main
Analytics and feedback
2025-02-25 22:28:16 +00:00
dependabot[bot]
0aae53524c build(deps): bump lxml from 5.3.0 to 5.3.1 in /application
Bumps [lxml](https://github.com/lxml/lxml) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-5.3.0...lxml-5.3.1)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-25 20:38:23 +00:00
dependabot[bot]
1d1efc00b5 build(deps): bump qdrant-client from 1.12.2 to 1.13.2 in /application
Bumps [qdrant-client](https://github.com/qdrant/qdrant-client) from 1.12.2 to 1.13.2.
- [Release notes](https://github.com/qdrant/qdrant-client/releases)
- [Commits](https://github.com/qdrant/qdrant-client/compare/v1.12.2...v1.13.2)

---
updated-dependencies:
- dependency-name: qdrant-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-25 20:38:17 +00:00
ManishMadan2882
7584305159 (feat:feedback) unset feedback when null 2025-02-26 01:01:30 +05:30
ManishMadan2882
554601d674 (fix:feedback) widget can handle feedback 2025-02-26 01:00:38 +05:30
Alex
6caf14f4b2 Merge pull request #1653 from asminkarki012/main
docs: Ensure --env-file .env is included for environment variable loa…
2025-02-25 17:16:58 +00:00
asminkarki012
edbd08be8a docs: Ensure --env-file .env is included for environment variable loading 2025-02-25 21:52:39 +05:45
ManishMadan2882
caed6df53b (feat:stream) save conversations optionally 2025-02-25 17:32:35 +05:30
ManishMadan2882
d823fba60b Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-25 16:23:55 +05:30
ManishMadan2882
92c8abe65d (fix:sharedConv) makes sure that response state updates 2025-02-25 16:23:35 +05:30
Alex
91e966b480 Merge pull request #1650 from arc53/dependabot/pip/application/transformers-4.49.0
build(deps): bump transformers from 4.48.0 to 4.49.0 in /application
2025-02-25 08:51:41 +00:00
Siddhant Rai
1f0b779c64 refactor: folder restructure for agent based workflow 2025-02-25 09:03:45 +05:30
GH Action - Upstream Sync
0ccd76074a Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-25 01:22:53 +00:00
Alex
07c6dcab4a Merge pull request #1652 from arc53/dependabot/pip/application/google-genai-1.3.0
build(deps): bump google-genai from 0.5.0 to 1.3.0 in /application
2025-02-24 22:34:16 +00:00
Alex
84cbc1201c fix: googles update 2025-02-24 22:30:09 +00:00
dependabot[bot]
495bbc2aba build(deps): bump google-genai from 0.5.0 to 1.3.0 in /application
Bumps [google-genai](https://github.com/googleapis/python-genai) from 0.5.0 to 1.3.0.
- [Release notes](https://github.com/googleapis/python-genai/releases)
- [Changelog](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/python-genai/compare/v0.5.0...v1.3.0)

---
updated-dependencies:
- dependency-name: google-genai
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 22:24:08 +00:00
dependabot[bot]
cb0bceacfa build(deps): bump elasticsearch from 8.17.0 to 8.17.1 in /application
Bumps [elasticsearch](https://github.com/elastic/elasticsearch-py) from 8.17.0 to 8.17.1.
- [Release notes](https://github.com/elastic/elasticsearch-py/releases)
- [Commits](https://github.com/elastic/elasticsearch-py/compare/v8.17.0...v8.17.1)

---
updated-dependencies:
- dependency-name: elasticsearch
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 22:23:48 +00:00
Alex
6799050718 Merge pull request #1601 from arc53/dependabot/pip/application/pydantic-2.10.6
build(deps): bump pydantic from 2.10.4 to 2.10.6 in /application
2025-02-24 22:23:46 +00:00
dependabot[bot]
4b892e8939 build(deps): bump transformers from 4.48.0 to 4.49.0 in /application
Bumps [transformers](https://github.com/huggingface/transformers) from 4.48.0 to 4.49.0.
- [Release notes](https://github.com/huggingface/transformers/releases)
- [Commits](https://github.com/huggingface/transformers/compare/v4.48.0...v4.49.0)

---
updated-dependencies:
- dependency-name: transformers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 22:23:30 +00:00
Alex
674001b499 Merge pull request #1583 from arc53/dependabot/pip/application/openapi-schema-validator-0.6.3
build(deps): bump openapi-schema-validator from 0.6.2 to 0.6.3 in /application
2025-02-24 22:23:27 +00:00
ManishMadan2882
c730777134 (fix:bubble) keeping feedback visible once submitted 2025-02-25 00:51:33 +05:30
ManishMadan2882
8148876249 (feat:message analytics) count individual queries 2025-02-25 00:45:19 +05:30
ManishMadan2882
4cf946f856 (feat:feedback) timestamp feedback 2025-02-24 18:53:29 +05:30
ManishMadan2882
05706f1641 (feat:feedback and tokens) count apiKey docs separately 2025-02-24 17:24:53 +05:30
Siddhant Rai
6fed84958e feat: agent-retriever workflow + query rephrase 2025-02-24 16:41:57 +05:30
ManishMadan2882
64011c5988 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-24 16:28:44 +05:30
ManishMadan2882
3e02d5a56f (feat:conv) save the conv with key 2025-02-24 16:28:24 +05:30
Alex
14f57bc3a4 Update README.md 2025-02-23 15:30:59 +00:00
aidanbennettjones
ac8f1b9aa3 Merge branch 'arc53:main' into AidanComponentEditChat 2025-02-21 15:02:39 -05:00
Alex
104c6ef457 Merge pull request #1645 from ManishMadan2882/main
Settings: Improving table layout
2025-02-20 22:47:25 +00:00
ManishMadan2882
84661cea36 lint 2025-02-21 00:54:06 +05:30
ManishMadan2882
c2b0ed85d2 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-21 00:42:56 +05:30
ManishMadan2882
5a081f2419 (feat/docs) prevent event bubble 2025-02-21 00:42:27 +05:30
ManishMadan2882
88016f9c35 (fix/chatbots) prevent overflow 2025-02-21 00:41:30 +05:30
ManishMadan2882
0d56e62bb8 (fix/tables) responsiveness issues 2025-02-20 14:48:16 +05:30
GH Action - Upstream Sync
567756edd3 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-20 01:21:11 +00:00
ManishMadan2882
7cc0a3620e (fix:docs) consistency 2025-02-20 03:33:35 +05:30
ManishMadan2882
b5587e458f Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-20 01:39:37 +05:30
ManishMadan2882
b22d965b7b (fix:chatbots) ui 2025-02-20 01:39:25 +05:30
Alex
cc0b41ddfb Merge pull request #1642 from siiddhantt/fix/minor-bugs
fix: minor bugs and enhancement
2025-02-19 16:16:05 +00:00
ManishMadan2882
006aeeebb0 (fix:typo) copy 2025-02-19 16:56:15 +05:30
ManishMadan2882
3cfb1abf62 (fix/merge) revert dropdown skeletons 2025-02-19 16:55:36 +05:30
ManishMadan2882
e1da69040d (fix/merge error) tool config modal 2025-02-19 16:44:35 +05:30
Siddhant Rai
5924693e90 fix: merge errors 2025-02-19 14:37:47 +05:30
Siddhant Rai
9ee7d659df Merge branch 'main' into fix/minor-bugs 2025-02-19 14:16:56 +05:30
Siddhant Rai
ac1b1c3cdd feat: add loading spinner to AddToolModal and improve label spacing in General settings 2025-02-19 13:58:40 +05:30
Alex
8440138ba0 Merge pull request #1641 from ManishMadan2882/main
Refactor: Apply base modal for UI consitency
2025-02-18 23:42:06 +00:00
ManishMadan2882
877b44ec0a (lint) 2025-02-19 04:49:22 +05:30
ManishMadan2882
cc4acb8766 (feat:createAPIModal): UI inconsistency 2025-02-19 04:38:49 +05:30
ManishMadan2882
3aa85bb51c (refactor:modals) reuse wrapper modal 2025-02-19 04:35:33 +05:30
ManishMadan2882
4e948d8bff (refactor:tools modal) reuse wrapper modal 2025-02-19 04:15:31 +05:30
ManishMadan2882
28489d244c (feat:input) consistent colors 2025-02-19 04:10:14 +05:30
ManishMadan2882
acf3dd2762 Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-19 04:01:23 +05:30
ManishMadan2882
8589303753 (feat:consitency)modals, dropdowns 2025-02-19 04:01:14 +05:30
ManishMadan2882
0d9fc26119 (refactor): purge unused files 2025-02-19 03:39:15 +05:30
Alex
9dd63c1da4 Merge pull request #1636 from arc53/dependabot/pip/application/duckduckgo-search-7.4.2
build(deps): bump duckduckgo-search from 6.3.0 to 7.4.2 in /application
2025-02-18 21:55:44 +00:00
aidanbennettjones
7ff03ab098 Enables "Enter" Key Functionality for Edit Chat Submission 2025-02-18 15:58:37 -05:00
Alex
750345d209 feat: architecrure guide 2025-02-18 14:51:17 +00:00
Alex
03ee16f5ca Update _app.mdx 2025-02-18 09:09:37 +00:00
Alex
586fc80c19 Merge pull request #1640 from ManishMadan2882/docs 2025-02-18 08:54:28 +00:00
ManishMadan2882
13cd221fe5 (feat:widget) udpate docs 2025-02-18 14:19:53 +05:30
Siddhant Rai
f35af54e9f refactor: clean up code and improve UI elements in various components 2025-02-18 13:10:35 +05:30
Alex
67e37f1ce1 bump docs widget docs 2025-02-17 23:46:23 +00:00
ManishMadan2882
49ff27a5fe Merge branch 'main' of https://github.com/manishmadan2882/docsgpt 2025-02-18 04:22:32 +05:30
ManishMadan2882
04730ba8c7 (feat:theme)exacting the designs 2025-02-18 04:20:20 +05:30
Alex
b2fcf91958 Merge pull request #1637 from arc53/feat/sources-in-widget
Feat/sources in widget
2025-02-17 21:55:02 +00:00
ManishMadan2882
b78d2bd4b1 (feat:widget) add optional sources 2025-02-18 02:09:13 +05:30
dependabot[bot]
2612ce5ad9 build(deps): bump duckduckgo-search from 6.3.0 to 7.4.2 in /application
Bumps [duckduckgo-search](https://github.com/deedy5/duckduckgo_search) from 6.3.0 to 7.4.2.
- [Release notes](https://github.com/deedy5/duckduckgo_search/releases)
- [Commits](https://github.com/deedy5/duckduckgo_search/compare/v6.3.0...v7.4.2)

---
updated-dependencies:
- dependency-name: duckduckgo-search
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 20:34:44 +00:00
Manish Madan
798913740e Merge pull request #1317 from utin-francis-peter/feat/sources-in-react-widget
Feat/sources in react widget
2025-02-17 16:26:43 +05:30
Manish Madan
7d0445cc20 Merge branch 'main' into feat/sources-in-react-widget 2025-02-17 15:41:34 +05:30
Alex
361f6895ee Merge pull request #1514 from ayaan-qadri/Fixing-1513 2025-02-16 20:10:33 +00:00
Alex
47442f4f58 fix: bandit workflow only on main repo 2025-02-15 15:06:18 +00:00
dependabot[bot]
307c2e1682 build(deps): bump openapi-schema-validator in /application
Bumps [openapi-schema-validator](https://github.com/python-openapi/openapi-schema-validator) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/python-openapi/openapi-schema-validator/releases)
- [Commits](https://github.com/python-openapi/openapi-schema-validator/compare/0.6.2...0.6.3)

---
updated-dependencies:
- dependency-name: openapi-schema-validator
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 14:49:26 +00:00
Alex
2190359e4d Merge pull request #1631 from arc53/dependabot/pip/application/anthropic-0.45.2
build(deps): bump anthropic from 0.40.0 to 0.45.2 in /application
2025-02-14 14:47:32 +00:00
Alex
27a933c7b7 Merge pull request #1628 from ManishMadan2882/main
Smoother transition in settings
2025-02-14 14:47:16 +00:00
ManishMadan2882
71970a0d1d (feat:transit): reduce delay to 250 2025-02-14 20:06:50 +05:30
ManishMadan2882
7661273cfd (fix/logs) append loader 2025-02-14 19:50:19 +05:30
ManishMadan2882
cd06334049 (feat:transitions) uniform color and animation 2025-02-14 17:38:58 +05:30
Alex
05319e36a7 Merge pull request #1630 from siiddhantt/feat/show-tool-execution
feat: tool calls tracking
2025-02-14 10:27:15 +00:00
ManishMadan2882
200a3b81e5 (feat:loaders) loader for logs, dropdown 2025-02-14 02:20:29 +05:30
dependabot[bot]
5647755762 build(deps): bump anthropic from 0.40.0 to 0.45.2 in /application
Bumps [anthropic](https://github.com/anthropics/anthropic-sdk-python) from 0.40.0 to 0.45.2.
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases)
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/anthropics/anthropic-sdk-python/compare/v0.40.0...v0.45.2)

---
updated-dependencies:
- dependency-name: anthropic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-13 20:24:49 +00:00
ManishMadan2882
adb2947b52 (feat:transitions): reshaped the tablular loaders 2025-02-14 01:01:07 +05:30
Siddhant Rai
7b05afab74 refactor: formatting + token limit for gemini-2.0-flash-exp 2025-02-14 00:27:27 +05:30
Siddhant Rai
5cf5bed6a8 feat: enhance tool call handling with structured message cleaning and improved UI display 2025-02-14 00:15:01 +05:30
Alex
095cb58df3 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-13 11:48:59 +00:00
ManishMadan2882
181bf69994 (feat:transitions) custom hook to loading state 2025-02-13 17:16:17 +05:30
Alex
927b513bf8 fix: error warning 2025-02-13 11:44:05 +00:00
Alex
05801cd90c Update README.md 2025-02-13 11:37:47 +00:00
Alex
a8ac00469d fix: bandit 2025-02-13 11:30:02 +00:00
Alex
1e3ae948a2 feat: add static code analysis 2025-02-13 11:25:03 +00:00
Alex
2d8aa229c6 fix: used for security comment 2025-02-13 11:10:44 +00:00
Alex
84f4812189 Update CONTRIBUTING.md 2025-02-13 10:48:49 +00:00
Siddhant Rai
8a3612e56c fix: improve tool call handling and UI adjustments 2025-02-13 05:02:10 +05:30
ManishMadan2882
d08861fb30 (fix/docs) revert effected portions 2025-02-13 01:16:11 +05:30
ManishMadan2882
ecc0f9d9f5 Merge branch 'main' of https://github.com/arc53/docsgpt 2025-02-13 00:17:58 +05:30
Siddhant Rai
e209699b19 feat: add tool calls tracking and show in frontend 2025-02-12 21:47:47 +05:30
Alex
c8d8690cfd Update README.md 2025-02-12 16:09:53 +00:00
Alex
59d05b698a Update README.md 2025-02-12 16:09:22 +00:00
Alex
1bcbfc8d18 Merge pull request #1629 from arc53/easy-deploy 2025-02-12 15:13:36 +00:00
Pavel
bafed63d40 super-final 2025-02-12 17:41:59 +03:00
ManishMadan2882
828a056e21 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-02-12 20:10:36 +05:30
ManishMadan2882
9424f6303a (feat:upload) smooth transitions on advanced fields 2025-02-12 20:10:21 +05:30
Pavel
c0dc5c3a4d finished 2025-02-12 17:33:11 +03:00
Alex
d0fb3da285 Merge pull request #1626 from arc53/dependabot/pip/application/prompt-toolkit-3.0.50
build(deps): bump prompt-toolkit from 3.0.48 to 3.0.50 in /application
2025-02-12 13:49:50 +00:00
Pavel
ccce01800d index-desc 2025-02-12 14:43:24 +03:00
Pavel
b44b9d8016 models+guide-upd+extentions 2025-02-12 14:38:21 +03:00
dependabot[bot]
7592c45bd9 build(deps): bump prompt-toolkit from 3.0.48 to 3.0.50 in /application
Bumps [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) from 3.0.48 to 3.0.50.
- [Release notes](https://github.com/prompt-toolkit/python-prompt-toolkit/releases)
- [Changelog](https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/CHANGELOG)
- [Commits](https://github.com/prompt-toolkit/python-prompt-toolkit/compare/3.0.48...3.0.50)

---
updated-dependencies:
- dependency-name: prompt-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-12 10:32:09 +00:00
Alex
b024936ad7 Update devc-welcome.md 2025-02-12 09:48:21 +00:00
Manish Madan
be2246283f Merge branch 'arc53:main' into main 2025-02-12 00:00:23 +05:30
ManishMadan2882
a7969f6ec8 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-02-11 23:58:14 +05:30
ManishMadan2882
ac447dd055 (feat:settings) smoother transitions 2025-02-11 23:55:30 +05:30
Pavel
28cdbe407c tools-remove 2025-02-11 21:19:09 +03:00
Alex
bf486082c9 fix: centering 2025-02-11 17:27:45 +00:00
Alex
41290b463c feat: cards 2025-02-11 17:17:12 +00:00
Pavel
385ebe234e setup+development-docs 2025-02-11 19:17:59 +03:00
Alex
72e9fcc895 Update README.md 2025-02-11 16:08:48 +00:00
Alex
5f42e4ac3f fix: default file codespace 2025-02-11 09:53:26 +00:00
Alex
926ec89f48 Create devc-welcome.md 2025-02-11 09:48:45 +00:00
GH Action - Upstream Sync
440e1b9156 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-11 01:19:54 +00:00
ManishMadan2882
ea0a6e413d (feat:bubble) formattedtable/inline code 2025-02-11 02:07:54 +05:30
Alex
0de4241b56 Merge pull request #1625 from arc53/handle-bad-tool-names
Handle bad tool names
2025-02-10 17:25:45 +00:00
Alex
6e8a53a204 fix: open new tool after its added 2025-02-10 16:52:59 +00:00
Alex
60772889d5 fix: handle bad tool name input 2025-02-10 16:20:37 +00:00
Alex
7db7c9e978 Merge pull request #1612 from arc53/dependabot/pip/application/marshmallow-3.26.1
build(deps): bump marshmallow from 3.24.1 to 3.26.1 in /application
2025-02-10 13:19:04 +00:00
dependabot[bot]
d85bf67103 build(deps): bump marshmallow from 3.24.1 to 3.26.1 in /application
Bumps [marshmallow](https://github.com/marshmallow-code/marshmallow) from 3.24.1 to 3.26.1.
- [Changelog](https://github.com/marshmallow-code/marshmallow/blob/dev/CHANGELOG.rst)
- [Commits](https://github.com/marshmallow-code/marshmallow/compare/3.24.1...3.26.1)

---
updated-dependencies:
- dependency-name: marshmallow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 13:06:17 +00:00
Alex
926f2e9f48 Merge pull request #1621 from ManishMadan2882/main
Refactor Upload
2025-02-10 13:04:53 +00:00
ManishMadan2882
2019f29e8c (clean) mock changes 2025-02-10 16:02:37 +05:30
ManishMadan2882
3b45b63d2a (fix:upload) ui adjust 2025-02-10 16:02:02 +05:30
Alex
1c08c53121 Merge pull request #1624 from siiddhantt/feat/edit-chunks
feat: view chunks for docs and add/delete them
2025-02-10 09:48:11 +00:00
Siddhant Rai
7623bde159 feat: add update chunk API endpoint and service method 2025-02-10 09:36:18 +05:30
GH Action - Upstream Sync
1ed0f5e78d Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-10 01:21:14 +00:00
Piotr Idzik
568ab33a37 style: use underscore for an unused loop variable (#1593)
This addresses the SC2034 warning.
2025-02-09 22:56:52 +00:00
Alex
f639b052e3 fix: remove debugging code 2025-02-09 12:08:19 +00:00
Alex
56f91948f8 feat: improve logging 2025-02-09 12:05:37 +00:00
GH Action - Upstream Sync
6c5e481318 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-09 01:24:07 +00:00
ManishMadan2882
f487f1e8c1 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-02-09 01:31:15 +05:30
ManishMadan2882
68ee9743fe (feat:upload) advanced fields 2025-02-09 01:31:01 +05:30
Alex
f4cb48ed0d fix: logging 2025-02-08 19:29:54 +00:00
Alex
ad77fe1116 fix: logging in submodules 2025-02-08 18:07:03 +00:00
Alex
28a0667da6 fix: minor logging issue 2025-02-08 12:49:42 +00:00
Siddhant Rai
1f0366c989 Merge branch 'feat/edit-chunks' of https://github.com/siiddhantt/DocsGPT into feat/edit-chunks 2025-02-08 15:00:20 +05:30
Siddhant Rai
3a51922650 fix: linting error 2025-02-08 15:00:02 +05:30
Siddhant Rai
82b2be5046 Merge branch 'main' into feat/edit-chunks 2025-02-08 14:56:34 +05:30
Siddhant Rai
0fc9718c35 feat: loading state and spinner + delete chunk option 2025-02-08 14:52:32 +05:30
GH Action - Upstream Sync
976733a3c3 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-08 01:17:57 +00:00
Alex
5d17072709 fix: readme space 2025-02-07 19:22:01 +00:00
Alex
fbad183d39 fix: post create devcontainers 2025-02-07 18:44:24 +00:00
Alex
7356a2ff07 fix: minor docker fixes 2025-02-07 18:39:07 +00:00
Alex
6ff948c107 fix: dockerfile in devcontainer build dir fix 2025-02-07 14:35:44 +00:00
Alex
e3ebce117b fix: devcontainer paths 2 2025-02-07 14:34:19 +00:00
Alex
ce69b09730 fix: devcontainer paths 2025-02-07 14:30:15 +00:00
Alex
c823cef405 fix: devcontainer codespaces correct api address 2025-02-07 14:25:09 +00:00
Siddhant Rai
0379b81d43 feat: view and add document chunks for mongodb and faiss 2025-02-07 19:39:07 +05:30
ManishMadan2882
6a997163fd Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-02-07 19:37:39 +05:30
ManishMadan2882
93f8466230 (feat:Upload): required form fields 2025-02-07 19:37:24 +05:30
ManishMadan2882
114c8d3c22 (feat:Input) required prop 2025-02-07 17:59:28 +05:30
GH Action - Upstream Sync
3e77e79194 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-02-07 01:20:29 +00:00
dependabot[bot]
ca91d36979 build(deps): bump pydantic from 2.10.4 to 2.10.6 in /application
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.10.4 to 2.10.6.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.10.4...v2.10.6)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-06 20:01:07 +00:00
Alex
d47232246a fix: remove old pypdf 2025-02-06 19:59:42 +00:00
Alex
d819222cf7 fix: remove unused import 2025-02-06 19:46:11 +00:00
Alex
0c4c4d5622 fix: improve error logging 2025-02-06 19:44:09 +00:00
Alex
ad051ed083 fix: docker compose files 2025-02-06 18:51:17 +00:00
ManishMadan2882
1aa0af3e58 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-02-06 20:16:31 +05:30
ManishMadan2882
72556b37f5 (refactor:upload) simplify call to /api/remote 2025-02-06 20:16:07 +05:30
Manish Madan
0bddae5775 Merge branch 'arc53:main' into main 2025-02-06 04:09:08 +05:30
ManishMadan2882
1f1e710a6d Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-02-06 04:07:51 +05:30
ManishMadan2882
b57d418b98 (refactor:upload) remove redundant types 2025-02-06 04:04:18 +05:30
Alex
0913c43219 feat: edit deploymen files locations 2025-02-05 18:04:41 +00:00
Alex
d754a43fba feat: devcontainer 2025-02-05 11:54:06 +00:00
Manish Madan
f97b56a87b (fix): date formatting (#1617) 2025-02-05 10:20:14 +00:00
Michele Grimaldi
2f78398914 Fixing issues #1445 (#1603)
* Fixing issues #1445

* Fixed issue #1445
2025-02-05 08:52:18 +00:00
Manish Madan
81b9a34e5e Merge branch 'arc53:main' into main 2025-02-05 03:33:20 +05:30
Alex
73ba078efc fix: init push to ghcr 2025-02-04 22:02:56 +00:00
ManishMadan2882
1ffe0ad85c (fix): date formatting 2025-02-05 03:31:17 +05:30
Alex
797b36a81e fix: container name 2025-02-04 21:56:26 +00:00
Alex
b82c14892e Arm builds (#1615)
* fix: matrix build

* fix: trigger build

* fix: trigger wrong name

* fix: runner name

* fix: manifest fix

* fix: yaml error

* fix: manifest build

* fix: build error

* feat: multi arch containers
2025-02-04 21:02:44 +00:00
Alex
a8891dabec feat: docker arm64 2025-02-04 17:46:44 +00:00
Alex
86ba797665 Merge pull request #1614 from arc53/documentation-footer
footer text with links
2025-02-04 17:35:22 +00:00
Pavel
3830dcb3f3 footer text with links 2025-02-04 19:42:24 +03:00
Alex
c20fe7a773 Update docker-compose.yaml 2025-02-03 13:21:28 +00:00
Alex
fa01f86b19 Merge pull request #1608 from siiddhantt/feat/api-tool
feat: API Tool
2025-02-03 11:48:57 +00:00
Alex
9583095734 Merge pull request #1586 from aalghooneh/main
websocket implementation of elevenlabs
2025-02-03 10:00:00 +00:00
Siddhant Rai
a5b2eb3a28 feat: api tool config section + agent refactor for more llm fields 2025-02-03 06:07:10 +05:30
Alex
72f2784588 Merge pull request #1610 from ManishMadan2882/main
Refactor: Ingestor types for remote resources in Upload Component
2025-02-01 11:30:54 +00:00
ManishMadan2882
5c5b730bb8 purge logs, unused 2025-02-01 00:40:30 +05:30
ManishMadan2882
b9ec6b4315 (refactor:upload) separate name from the configurations 2025-02-01 00:08:01 +05:30
ManishMadan2882
4b83fa3549 (refactor:remote types) enhance abstraction 2025-01-31 06:29:35 +05:30
ManishMadan2882
a69e81076a (feat:components) add label props 2025-01-31 06:23:54 +05:30
ManishMadan2882
4cd2b73f19 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-01-31 00:48:53 +05:30
ManishMadan2882
4ea0bebd92 (refactor:remote uploads) dynamic ingestor types 2025-01-31 00:48:03 +05:30
Alex
bbcdae25a1 Update README.md 2025-01-29 15:33:06 +00:00
Ayaan
220a801138 Requested changes 2025-01-29 20:29:39 +05:30
Ayaan
c6821d9cc3 Improve edit message interface 2025-01-29 20:11:55 +05:30
Ayaan
8b59245e6a Decreased margin right for message hover button 2025-01-29 20:06:10 +05:30
Manish Madan
9b5ee2e694 Merge pull request #1606 from arc53/dependabot/npm_and_yarn/frontend/reduxjs/toolkit-2.5.1
build(deps): bump @reduxjs/toolkit from 2.2.7 to 2.5.1 in /frontend
2025-01-29 16:57:17 +05:30
dependabot[bot]
e932d86b69 build(deps): bump @reduxjs/toolkit from 2.2.7 to 2.5.1 in /frontend
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 2.2.7 to 2.5.1.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v2.2.7...v2.5.1)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-29 09:38:06 +00:00
Manish Madan
96f05311b8 Merge pull request #1596 from arc53/dependabot/npm_and_yarn/frontend/vite-5.4.14
build(deps-dev): bump vite from 5.4.11 to 5.4.14 in /frontend
2025-01-29 14:58:18 +05:30
dependabot[bot]
3e2d68782c build(deps-dev): bump vite from 5.4.11 to 5.4.14 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.14.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-29 09:22:13 +00:00
Manish Madan
db2a4349cb Merge pull request #1590 from arc53/dependabot/npm_and_yarn/frontend/katex-0.16.21
build(deps): bump katex from 0.16.11 to 0.16.21 in /frontend
2025-01-29 14:46:47 +05:30
Ahmad Alghooneh
2014fe83a3 fixed the import error 2025-01-28 18:29:56 -05:00
Alex
55439aab5e Merge pull request #1607 from ManishMadan2882/main
Perfecting Settings/Documents
2025-01-28 10:08:32 +00:00
ManishMadan2882
8c91864f1c Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-01-28 13:53:05 +05:30
Siddhant Rai
9319ec5bb2 feat: api tool + fix google ai no parameters error 2025-01-28 09:53:32 +05:30
ManishMadan2882
83e4023c19 (feat:settings/docs) confirm on delete 2025-01-28 04:50:28 +05:30
GH Action - Upstream Sync
a14701bdd2 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-01-27 01:20:14 +00:00
ManishMadan2882
379dd011ff (fix:settings/docs) avoid refresh on modal close 2025-01-27 03:32:32 +05:30
ManishMadan2882
49b3ccfe2b Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-01-27 03:01:56 +05:30
ManishMadan2882
16608370a6 (feat:settings)docs table design perfection 2025-01-27 03:01:39 +05:30
Alex
53015c9d8e Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-01-26 15:43:01 +00:00
Alex
6d68b89ea0 fix: history bug on 2nd message 2025-01-26 15:42:47 +00:00
Alex
254582da89 Update README.md 2025-01-26 13:10:29 +00:00
Alex
af54b7cfef Update README.md 2025-01-26 13:06:00 +00:00
GH Action - Upstream Sync
f13149db8e Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-01-26 01:21:17 +00:00
Alex
79912a4067 Update README.md 2025-01-25 20:55:24 +00:00
Alex
c0b6b85ec0 Merge pull request #1604 from arc53/update-docs-readme
Update docs readme
2025-01-25 20:47:10 +00:00
Alex
a4895f5166 fix: add links to dev env instructions 2025-01-25 20:44:56 +00:00
Alex
4d7670a12e fix: name 2025-01-25 20:41:59 +00:00
Alex
8c21954049 feat: improved docs 2025-01-25 20:36:10 +00:00
Alex
132fab1c03 feat: improve readme 2025-01-25 20:14:23 +00:00
Alex
e7b8d71010 Update index.mdx 2025-01-25 15:10:30 +00:00
Alex
fff8cfdee0 Update index.mdx 2025-01-25 15:08:36 +00:00
Alex
3e45a3b4d8 Update README.md 2025-01-25 14:39:38 +00:00
GH Action - Upstream Sync
7c66e21356 Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-01-25 01:15:23 +00:00
Alex
c477a49777 Merge pull request #1600 from arc53/postgres-tool
feat: postgres tool
2025-01-24 15:11:08 +00:00
Alex
5a38c09f8d feat: postgres tool 2025-01-24 15:06:16 +00:00
ManishMadan2882
fe4657b122 (fix:analytics) updated to show feedback 2025-01-24 02:46:57 +05:30
GH Action - Upstream Sync
c1dcd2e57d Merge branch 'main' of https://github.com/arc53/DocsGPT 2025-01-23 01:18:56 +00:00
ManishMadan2882
26d993674e Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-01-23 02:50:52 +05:30
ManishMadan2882
9d475001ee (feat:chatbots) confirm before deletion 2025-01-23 02:50:24 +05:30
ManishMadan2882
34eb25b0ba (feat:documents) design perfection 2025-01-23 01:15:01 +05:30
ManishMadan2882
716b935177 (feat:documents) formatting date 2025-01-23 01:12:14 +05:30
Alex
92528af600 Update README.md 2025-01-22 19:14:40 +00:00
Alex
2606e6b82d Merge pull request #1594 from arc53/googleai-compatability-tools
Googleai compatability tools
2025-01-21 09:53:56 +00:00
Alex
b965ce7376 Merge branch 'main' into googleai-compatability-tools 2025-01-21 09:49:09 +00:00
Alex
048f1b53c0 Merge pull request #1581 from siiddhantt/refactor/parser-and-handler-in-tools
refactor: tool agent for action parser and handlers
2025-01-21 09:48:22 +00:00
Alex
43340c4aa8 fix: finale test 2025-01-21 09:44:53 +00:00
Alex
9f073fcbcf fix: tests 2025-01-21 09:39:02 +00:00
Alex
c0c60a4875 fix: ruff linting 2025-01-21 09:37:11 +00:00
Alex
94f682e461 fix roles in retriever layer 2025-01-21 09:31:38 +00:00
Siddhant Rai
1086bfe1ba fix: wrong role in req messages 2025-01-21 07:19:02 +05:30
Siddhant Rai
d441d5763f fix: decorators + client error 2025-01-20 19:44:14 +05:30
Alex
c0a2daa3a3 Delete HACKTOBERFEST.md 2025-01-20 13:09:38 +00:00
Alex
3de51b6a65 Merge pull request #1588 from arc53/web_loader_fix
web loader fix
2025-01-20 12:45:00 +00:00
Alex
a741388447 fix: system message 2025-01-19 22:21:50 +00:00
Alex
1ea9b87498 Merge pull request #1591 from ManishMadan2882/main
Sync locales
2025-01-18 22:30:18 +00:00
ManishMadan2882
0cab007c37 (fix:locale) missing text 2025-01-19 01:37:14 +05:30
Siddhant Rai
4a331db5fc fix: api_key attribute 2025-01-18 20:00:51 +05:30
Siddhant Rai
904b0bf2da fix: GoogleLLM, agent and handler according to the new genai SDK 2025-01-18 19:56:25 +05:30
ManishMadan2882
90425542f8 (fix:locales) missing translations 2025-01-18 18:58:12 +05:30
Alex
eae0141d50 Merge pull request #1589 from arc53/dependabot/npm_and_yarn/docs/katex-0.16.21
build(deps): bump katex from 0.16.10 to 0.16.21 in /docs
2025-01-18 12:37:29 +00:00
ManishMadan2882
9594c82005 (purge) unused file 2025-01-18 03:58:29 +05:30
ManishMadan2882
657aacceb5 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-01-18 03:46:21 +05:30
ManishMadan2882
a35dbf99a6 (sync:locales) with static content 2025-01-18 03:46:05 +05:30
dependabot[bot]
0d80f5d752 build(deps): bump katex from 0.16.11 to 0.16.21 in /frontend
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.11 to 0.16.21.
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](https://github.com/KaTeX/KaTeX/compare/v0.16.11...v0.16.21)

---
updated-dependencies:
- dependency-name: katex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 21:38:19 +00:00
dependabot[bot]
b36f4dfd08 build(deps): bump katex from 0.16.10 to 0.16.21 in /docs
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.10 to 0.16.21.
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](https://github.com/KaTeX/KaTeX/compare/v0.16.10...v0.16.21)

---
updated-dependencies:
- dependency-name: katex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 21:34:08 +00:00
Pavel
fddee69f92 web loader fix
Changes web loader to the correct output.
2025-01-17 19:13:23 +03:00
Siddhant Rai
ec270a3b54 update: requirements 2025-01-17 09:51:11 +05:30
Siddhant Rai
c97d1e3363 fix: google parser, llm handler and other errors 2025-01-17 09:22:41 +05:30
Ahmad Reza Alghooneh
554c1ed1f7 Merge branch 'main' into main 2025-01-16 20:42:54 -05:00
Alex
a90b286482 Merge pull request #1584 from arc53/dependabot/pip/application/primp-0.10.0
build(deps): bump primp from 0.9.3 to 0.10.0 in /application
2025-01-16 13:49:01 +00:00
ManishMadan2882
cc78ea7222 (fix:locales) sync static text 2025-01-16 18:24:27 +05:30
Ahmad Reza Alghooneh
7f2cc3b232 Delete application/tts/output_audio.mp3 2025-01-16 00:45:41 -05:00
Ahmad Alghooneh
00b10f17c1 eleven labs 2025-01-16 00:41:09 -05:00
dependabot[bot]
cab6305462 build(deps): bump primp from 0.9.3 to 0.10.0 in /application
Bumps [primp](https://github.com/deedy5/primp) from 0.9.3 to 0.10.0.
- [Release notes](https://github.com/deedy5/primp/releases)
- [Commits](https://github.com/deedy5/primp/compare/v0.9.3...v0.10.0)

---
updated-dependencies:
- dependency-name: primp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-15 20:59:45 +00:00
Alex
7218403ad7 Merge pull request #1582 from arc53/scraper-2
scraper with markdownify
2025-01-15 12:15:37 +00:00
Siddhant Rai
811dfecf98 refactor: tool agent for action parser and handlers 2025-01-15 16:35:26 +05:30
Alex
acbbf30a0e Merge pull request #1577 from arc53/dependabot/pip/application/flask-3.1.0
build(deps): bump flask from 3.0.3 to 3.1.0 in /application
2025-01-15 10:52:57 +00:00
Alex
4d29f8f679 Merge pull request #1578 from arc53/dependabot/pip/application/transformers-4.48.0
build(deps): bump transformers from 4.47.1 to 4.48.0 in /application
2025-01-15 10:52:42 +00:00
Pavel
13fcbe3e74 scraper with markdownify 2025-01-15 01:08:09 +03:00
dependabot[bot]
850b79f459 build(deps): bump transformers from 4.47.1 to 4.48.0 in /application
Bumps [transformers](https://github.com/huggingface/transformers) from 4.47.1 to 4.48.0.
- [Release notes](https://github.com/huggingface/transformers/releases)
- [Commits](https://github.com/huggingface/transformers/compare/v4.47.1...v4.48.0)

---
updated-dependencies:
- dependency-name: transformers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-14 20:35:19 +00:00
dependabot[bot]
9e6f970bc4 build(deps): bump flask from 3.0.3 to 3.1.0 in /application
Bumps [flask](https://github.com/pallets/flask) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-14 20:35:08 +00:00
ManishMadan2882
cbcb717aee (feat:locals) sync with en.json 2025-01-14 16:52:35 +05:30
ManishMadan2882
5aea46c214 (feat:settings) locale lang for analytics and logs 2025-01-14 15:49:01 +05:30
Alex
6394720c5a Merge pull request #1570 from ManishMadan2882/basic-ui
Widget fixes
2025-01-13 23:46:34 +00:00
Alex
6af627ea97 Merge pull request #1574 from arc53/dependabot/pip/application/langsmith-0.2.10
build(deps): bump langsmith from 0.2.6 to 0.2.10 in /application
2025-01-13 23:41:27 +00:00
Alex
85277f2b4f Merge pull request #1572 from arc53/dependabot/pip/application/openapi3-parser-1.1.19
build(deps): bump openapi3-parser from 1.1.18 to 1.1.19 in /application
2025-01-13 23:40:51 +00:00
Alex
7b0876204e Merge pull request #1571 from arc53/dependabot/pip/application/tqdm-4.67.1
build(deps): bump tqdm from 4.66.5 to 4.67.1 in /application
2025-01-13 23:40:28 +00:00
Alex
cf65942504 Merge pull request #1573 from arc53/dependabot/pip/application/elastic-transport-8.17.0
build(deps): bump elastic-transport from 8.15.1 to 8.17.0 in /application
2025-01-13 23:39:19 +00:00
dependabot[bot]
7369b02bf4 build(deps): bump langsmith from 0.2.6 to 0.2.10 in /application
Bumps [langsmith](https://github.com/langchain-ai/langsmith-sdk) from 0.2.6 to 0.2.10.
- [Release notes](https://github.com/langchain-ai/langsmith-sdk/releases)
- [Commits](https://github.com/langchain-ai/langsmith-sdk/compare/v0.2.6...v0.2.10)

---
updated-dependencies:
- dependency-name: langsmith
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 20:06:32 +00:00
dependabot[bot]
1438fea76b build(deps): bump elastic-transport in /application
Bumps [elastic-transport](https://github.com/elastic/elastic-transport-python) from 8.15.1 to 8.17.0.
- [Release notes](https://github.com/elastic/elastic-transport-python/releases)
- [Changelog](https://github.com/elastic/elastic-transport-python/blob/v8.17.0/CHANGELOG.md)
- [Commits](https://github.com/elastic/elastic-transport-python/compare/v8.15.1...v8.17.0)

---
updated-dependencies:
- dependency-name: elastic-transport
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 20:06:27 +00:00
dependabot[bot]
e0912f0cf0 build(deps): bump openapi3-parser from 1.1.18 to 1.1.19 in /application
Bumps [openapi3-parser](https://github.com/manchenkoff/openapi3-parser) from 1.1.18 to 1.1.19.
- [Release notes](https://github.com/manchenkoff/openapi3-parser/releases)
- [Commits](https://github.com/manchenkoff/openapi3-parser/compare/v1.1.18...v1.1.19)

---
updated-dependencies:
- dependency-name: openapi3-parser
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 20:06:20 +00:00
dependabot[bot]
838525b452 build(deps): bump tqdm from 4.66.5 to 4.67.1 in /application
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.66.5 to 4.67.1.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.5...v4.67.1)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 20:06:18 +00:00
ManishMadan2882
774cbbf47a (fix/widget) centered the toolkit msg 2025-01-13 18:20:08 +05:30
Alex
d15bc6d32c Merge pull request #1569 from arc53/dependabot/pip/application/pillow-11.1.0
build(deps): bump pillow from 10.4.0 to 11.1.0 in /application
2025-01-13 11:57:37 +00:00
Alex
99e0766f53 Merge pull request #1528 from ManishMadan2882/basic-ui
Basic UI
2025-01-13 10:58:37 +00:00
Alex
51225b18b2 add google 2025-01-13 10:37:53 +00:00
Ahmad Alghooneh
96ab01b0c1 commited reqs 2025-01-13 00:53:28 -05:00
Ahmad Alghooneh
a4eb4ea66d initial websocket impl 2025-01-13 00:33:10 -05:00
ManishMadan2882
54819e288a (feat:accessibility) add missing labels, alt text and contrast 2025-01-13 04:53:50 +05:30
ManishMadan2882
ec5fbded4f (fix:pa11y) aria-labels, alt text and contrast^C 2025-01-12 01:22:25 +05:30
dependabot[bot]
f939576311 build(deps): bump pillow from 10.4.0 to 11.1.0 in /application
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.4.0 to 11.1.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.4.0...11.1.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 21:58:53 +00:00
Alex
628784da35 Merge pull request #1568 from arc53/dependabot/pip/application/pathable-0.4.4
build(deps): bump pathable from 0.4.3 to 0.4.4 in /application
2025-01-10 21:58:01 +00:00
Alex
9ea3231060 Merge pull request #1567 from arc53/dependabot/pip/application/langchain-openai-0.3.0
build(deps): bump langchain-openai from 0.2.14 to 0.3.0 in /application
2025-01-10 21:57:39 +00:00
Alex
0b7858494f Merge pull request #1566 from arc53/dependabot/pip/application/boto3-1.35.97
build(deps): bump boto3 from 1.34.153 to 1.35.97 in /application
2025-01-10 21:57:18 +00:00
dependabot[bot]
8f98c8a3c9 build(deps): bump pathable from 0.4.3 to 0.4.4 in /application
Bumps [pathable](https://github.com/p1c2u/pathable) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/p1c2u/pathable/releases)
- [Commits](https://github.com/p1c2u/pathable/compare/0.4.3...0.4.4)

---
updated-dependencies:
- dependency-name: pathable
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 20:58:17 +00:00
dependabot[bot]
67f9b3a6e0 build(deps): bump langchain-openai from 0.2.14 to 0.3.0 in /application
Bumps [langchain-openai](https://github.com/langchain-ai/langchain) from 0.2.14 to 0.3.0.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-openai==0.2.14...langchain-openai==0.3.0)

---
updated-dependencies:
- dependency-name: langchain-openai
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 20:58:13 +00:00
dependabot[bot]
5defc0a87b build(deps): bump boto3 from 1.34.153 to 1.35.97 in /application
Bumps [boto3](https://github.com/boto/boto3) from 1.34.153 to 1.35.97.
- [Release notes](https://github.com/boto/boto3/releases)
- [Commits](https://github.com/boto/boto3/compare/1.34.153...1.35.97)

---
updated-dependencies:
- dependency-name: boto3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 20:58:08 +00:00
Alex
b4bcb09707 Merge pull request #1536 from arc53/dependabot/npm_and_yarn/frontend/tailwindcss-3.4.17
build(deps-dev): bump tailwindcss from 3.4.15 to 3.4.17 in /frontend
2025-01-10 14:43:59 +00:00
Alex
b2d74f66b3 Merge pull request #1541 from arc53/dependabot/npm_and_yarn/frontend/prettier-3.4.2
build(deps-dev): bump prettier from 3.3.3 to 3.4.2 in /frontend
2025-01-10 14:43:40 +00:00
dependabot[bot]
75223e18ee build(deps-dev): bump tailwindcss from 3.4.15 to 3.4.17 in /frontend
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.15 to 3.4.17.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.17/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.15...v3.4.17)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 14:31:23 +00:00
dependabot[bot]
4aea9c727d build(deps-dev): bump prettier from 3.3.3 to 3.4.2 in /frontend
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.3 to 3.4.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 14:31:21 +00:00
Alex
7d779afcd4 Merge pull request #1561 from arc53/dependabot/npm_and_yarn/frontend/prettier-plugin-tailwindcss-0.6.9
build(deps-dev): bump prettier-plugin-tailwindcss from 0.6.8 to 0.6.9 in /frontend
2025-01-10 14:30:08 +00:00
Alex
5cb7a69a46 Merge pull request #1558 from arc53/dependabot/pip/application/langchain-text-splitters-0.3.5
build(deps): bump langchain-text-splitters from 0.3.4 to 0.3.5 in /application
2025-01-09 23:47:02 +00:00
dependabot[bot]
0e88bfc570 build(deps): bump langchain-text-splitters in /application
Bumps [langchain-text-splitters](https://github.com/langchain-ai/langchain) from 0.3.4 to 0.3.5.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-text-splitters==0.3.4...langchain-text-splitters==0.3.5)

---
updated-dependencies:
- dependency-name: langchain-text-splitters
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-09 23:43:15 +00:00
Alex
48cf56557b Merge pull request #1560 from arc53/dependabot/pip/application/protobuf-5.29.3
build(deps): bump protobuf from 5.28.2 to 5.29.3 in /application
2025-01-09 23:40:27 +00:00
Alex
9c9354cf38 Merge pull request #1557 from arc53/dependabot/pip/application/orjson-3.10.14
build(deps): bump orjson from 3.10.7 to 3.10.14 in /application
2025-01-09 23:27:13 +00:00
Alex
e730ae66ae Merge pull request #1556 from arc53/dependabot/pip/application/qdrant-client-1.12.2
build(deps): bump qdrant-client from 1.11.0 to 1.12.2 in /application
2025-01-09 23:27:00 +00:00
Alex
58d6b71808 Merge pull request #1559 from arc53/dependabot/pip/application/gtts-2.5.4
build(deps): bump gtts from 2.3.2 to 2.5.4 in /application
2025-01-09 23:24:08 +00:00
dependabot[bot]
4b9c1c4863 build(deps-dev): bump prettier-plugin-tailwindcss in /frontend
Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.6.8 to 0.6.9.
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.6.8...v0.6.9)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-09 20:29:30 +00:00
dependabot[bot]
e1cdacaebf build(deps): bump protobuf from 5.28.2 to 5.29.3 in /application
Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 5.28.2 to 5.29.3.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v5.28.2...v5.29.3)

---
updated-dependencies:
- dependency-name: protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-09 20:23:19 +00:00
dependabot[bot]
af120248d7 build(deps): bump gtts from 2.3.2 to 2.5.4 in /application
Bumps [gtts](https://github.com/pndurette/gTTS) from 2.3.2 to 2.5.4.
- [Release notes](https://github.com/pndurette/gTTS/releases)
- [Changelog](https://github.com/pndurette/gTTS/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pndurette/gTTS/compare/v2.3.2...v2.5.4)

---
updated-dependencies:
- dependency-name: gtts
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-09 20:23:12 +00:00
dependabot[bot]
3749b327f9 build(deps): bump orjson from 3.10.7 to 3.10.14 in /application
Bumps [orjson](https://github.com/ijl/orjson) from 3.10.7 to 3.10.14.
- [Release notes](https://github.com/ijl/orjson/releases)
- [Changelog](https://github.com/ijl/orjson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ijl/orjson/compare/3.10.7...3.10.14)

---
updated-dependencies:
- dependency-name: orjson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-09 20:23:04 +00:00
dependabot[bot]
017ccd6351 build(deps): bump qdrant-client from 1.11.0 to 1.12.2 in /application
Bumps [qdrant-client](https://github.com/qdrant/qdrant-client) from 1.11.0 to 1.12.2.
- [Release notes](https://github.com/qdrant/qdrant-client/releases)
- [Commits](https://github.com/qdrant/qdrant-client/compare/v1.11.0...v1.12.2)

---
updated-dependencies:
- dependency-name: qdrant-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-09 20:23:00 +00:00
Alex
cdc860933e Create FUNDING.yml 2025-01-09 18:16:25 +00:00
Alex
7b408f338a Merge pull request #1540 from arc53/dependabot/npm_and_yarn/frontend/react-chartjs-2-5.3.0
build(deps): bump react-chartjs-2 from 5.2.0 to 5.3.0 in /frontend
2025-01-08 21:33:03 +00:00
Alex
b326c0c9ae Merge pull request #1555 from arc53/dependabot/pip/application/openai-1.59.5
build(deps): bump openai from 1.58.1 to 1.59.5 in /application
2025-01-08 21:19:59 +00:00
Alex
f06f409f2d Merge branch 'dependabot/pip/application/openai-1.59.5' of https://github.com/arc53/DocsGPT into dependabot/pip/application/openai-1.59.5 2025-01-08 21:14:02 +00:00
Alex
a0e8b70e6d Merge pull request #1550 from arc53/dependabot/pip/application/prompt-toolkit-3.0.48
build(deps): bump prompt-toolkit from 3.0.47 to 3.0.48 in /application
2025-01-08 21:12:24 +00:00
dependabot[bot]
5294178bb7 build(deps): bump prompt-toolkit from 3.0.47 to 3.0.48 in /application
Bumps [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) from 3.0.47 to 3.0.48.
- [Release notes](https://github.com/prompt-toolkit/python-prompt-toolkit/releases)
- [Changelog](https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/CHANGELOG)
- [Commits](https://github.com/prompt-toolkit/python-prompt-toolkit/compare/3.0.47...3.0.48)

---
updated-dependencies:
- dependency-name: prompt-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 21:12:13 +00:00
dependabot[bot]
9050d48bc3 build(deps): bump openai from 1.58.1 to 1.59.5 in /application
Bumps [openai](https://github.com/openai/openai-python) from 1.58.1 to 1.59.5.
- [Release notes](https://github.com/openai/openai-python/releases)
- [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openai/openai-python/compare/v1.58.1...v1.59.5)

---
updated-dependencies:
- dependency-name: openai
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 21:11:48 +00:00
Alex
9d0b54f461 Merge pull request #1553 from arc53/dependabot/pip/application/marshmallow-3.24.1
build(deps): bump marshmallow from 3.23.2 to 3.24.1 in /application
2025-01-08 21:10:06 +00:00
Alex
4ba848a483 Merge pull request #1551 from arc53/dependabot/pip/application/urllib3-2.3.0
build(deps): bump urllib3 from 2.2.3 to 2.3.0 in /application
2025-01-08 21:09:41 +00:00
Alex
0b26e6232a Merge pull request #1552 from arc53/dependabot/pip/application/pydantic-core-2.27.2
build(deps): bump pydantic-core from 2.23.4 to 2.27.2 in /application
2025-01-08 21:07:44 +00:00
Alex
88ad827a87 bump pydantic 2025-01-08 21:03:31 +00:00
ManishMadan2882
0b0f0a959a Merge branch 'main' into basic-ui 2025-01-09 02:22:43 +05:30
ManishMadan2882
25ee749724 (fix:locale) sync other locales with en) 2025-01-09 02:17:49 +05:30
dependabot[bot]
204b871fa2 build(deps): bump openai from 1.58.1 to 1.59.5 in /application
Bumps [openai](https://github.com/openai/openai-python) from 1.58.1 to 1.59.5.
- [Release notes](https://github.com/openai/openai-python/releases)
- [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openai/openai-python/compare/v1.58.1...v1.59.5)

---
updated-dependencies:
- dependency-name: openai
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 20:32:44 +00:00
Alex
f45db6014d Merge pull request #1549 from ManishMadan2882/main
Releasing docsgpt npm library v0.4.9
2025-01-08 13:50:44 +00:00
dependabot[bot]
475850ef94 build(deps): bump marshmallow from 3.23.2 to 3.24.1 in /application
Bumps [marshmallow](https://github.com/marshmallow-code/marshmallow) from 3.23.2 to 3.24.1.
- [Changelog](https://github.com/marshmallow-code/marshmallow/blob/dev/CHANGELOG.rst)
- [Commits](https://github.com/marshmallow-code/marshmallow/compare/3.23.2...3.24.1)

---
updated-dependencies:
- dependency-name: marshmallow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 20:36:03 +00:00
dependabot[bot]
602fe086b9 build(deps): bump pydantic-core from 2.23.4 to 2.27.2 in /application
Bumps [pydantic-core](https://github.com/pydantic/pydantic-core) from 2.23.4 to 2.27.2.
- [Release notes](https://github.com/pydantic/pydantic-core/releases)
- [Commits](https://github.com/pydantic/pydantic-core/compare/v2.23.4...v2.27.2)

---
updated-dependencies:
- dependency-name: pydantic-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 20:36:01 +00:00
dependabot[bot]
5ad76cf2af build(deps): bump urllib3 from 2.2.3 to 2.3.0 in /application
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.3...2.3.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 20:35:51 +00:00
ManishMadan2882
03e8c56f05 (upgrade/widget) v0.4.9 2025-01-07 20:49:31 +05:30
ManishMadan2882
d1981967b2 (fix:locales) sync conversation 2025-01-07 20:28:59 +05:30
Alex
c6094ad575 Merge pull request #1544 from arc53/dependabot/pip/application/langchain-community-0.3.14
build(deps): bump langchain-community from 0.3.13 to 0.3.14 in /application
2025-01-06 23:37:02 +00:00
Alex
93e376ad2f fix: bump dependency 2025-01-06 23:33:34 +00:00
Alex
6bba3d164a Merge pull request #1547 from arc53/dependabot/pip/application/networkx-3.4.2
build(deps): bump networkx from 3.3 to 3.4.2 in /application
2025-01-06 23:27:39 +00:00
Alex
b5decffaa2 Merge pull request #1545 from arc53/dependabot/pip/application/primp-0.9.3
build(deps): bump primp from 0.6.3 to 0.9.3 in /application
2025-01-06 23:27:17 +00:00
Alex
c068ac48d1 Merge pull request #1546 from arc53/dependabot/pip/application/torch-2.5.1
build(deps): bump torch from 2.4.1 to 2.5.1 in /application
2025-01-06 23:25:53 +00:00
Alex
d4b89803b2 Merge pull request #1548 from arc53/dependabot/pip/application/pymongo-4.10.1
build(deps): bump pymongo from 4.8.0 to 4.10.1 in /application
2025-01-06 21:59:58 +00:00
dependabot[bot]
d5b73236de build(deps): bump pymongo from 4.8.0 to 4.10.1 in /application
Bumps [pymongo](https://github.com/mongodb/mongo-python-driver) from 4.8.0 to 4.10.1.
- [Release notes](https://github.com/mongodb/mongo-python-driver/releases)
- [Changelog](https://github.com/mongodb/mongo-python-driver/blob/master/doc/changelog.rst)
- [Commits](https://github.com/mongodb/mongo-python-driver/compare/4.8.0...4.10.1)

---
updated-dependencies:
- dependency-name: pymongo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 20:34:39 +00:00
dependabot[bot]
1e011879b1 build(deps): bump networkx from 3.3 to 3.4.2 in /application
Bumps [networkx](https://github.com/networkx/networkx) from 3.3 to 3.4.2.
- [Release notes](https://github.com/networkx/networkx/releases)
- [Commits](https://github.com/networkx/networkx/compare/networkx-3.3...networkx-3.4.2)

---
updated-dependencies:
- dependency-name: networkx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 20:34:31 +00:00
dependabot[bot]
9c30ff3024 build(deps): bump torch from 2.4.1 to 2.5.1 in /application
Bumps [torch](https://github.com/pytorch/pytorch) from 2.4.1 to 2.5.1.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v2.4.1...v2.5.1)

---
updated-dependencies:
- dependency-name: torch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 20:34:27 +00:00
dependabot[bot]
035f41b12c build(deps): bump primp from 0.6.3 to 0.9.3 in /application
Bumps [primp](https://github.com/deedy5/primp) from 0.6.3 to 0.9.3.
- [Release notes](https://github.com/deedy5/primp/releases)
- [Commits](https://github.com/deedy5/primp/compare/v0.6.3...v0.9.3)

---
updated-dependencies:
- dependency-name: primp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 20:34:22 +00:00
dependabot[bot]
0bbf1db434 build(deps): bump langchain-community in /application
Bumps [langchain-community](https://github.com/langchain-ai/langchain) from 0.3.13 to 0.3.14.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-community==0.3.13...langchain-community==0.3.14)

---
updated-dependencies:
- dependency-name: langchain-community
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 20:34:20 +00:00
Alex
639e267392 Merge pull request #1538 from arc53/dependabot/pip/application/langchain-core-0.3.29
build(deps): bump langchain-core from 0.3.28 to 0.3.29 in /application
2025-01-05 02:10:07 +00:00
dependabot[bot]
bd5504461e build(deps): bump langchain-core from 0.3.28 to 0.3.29 in /application
Bumps [langchain-core](https://github.com/langchain-ai/langchain) from 0.3.28 to 0.3.29.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-core==0.3.28...langchain-core==0.3.29)

---
updated-dependencies:
- dependency-name: langchain-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-05 02:04:46 +00:00
Alex
c46aa23fdd Merge pull request #1537 from arc53/dependabot/pip/application/regex-2024.11.6
build(deps): bump regex from 2024.9.11 to 2024.11.6 in /application
2025-01-05 02:03:40 +00:00
Alex
d654e79be3 Merge pull request #1535 from arc53/dependabot/pip/application/jiter-0.8.2
build(deps): bump jiter from 0.5.0 to 0.8.2 in /application
2025-01-05 02:03:15 +00:00
dependabot[bot]
c41877920a build(deps): bump jiter from 0.5.0 to 0.8.2 in /application
Bumps [jiter](https://github.com/pydantic/jiter) from 0.5.0 to 0.8.2.
- [Release notes](https://github.com/pydantic/jiter/releases)
- [Commits](https://github.com/pydantic/jiter/compare/v0.5.0...v0.8.2)

---
updated-dependencies:
- dependency-name: jiter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-05 01:58:52 +00:00
Alex
3f11e3e6a6 Merge pull request #1533 from arc53/dependabot/pip/application/transformers-4.47.1
build(deps): bump transformers from 4.47.0 to 4.47.1 in /application
2025-01-05 01:55:03 +00:00
Alex
225e73c8cf Merge pull request #1534 from arc53/dependabot/pip/application/markupsafe-3.0.2
build(deps): bump markupsafe from 2.1.5 to 3.0.2 in /application
2025-01-05 01:54:46 +00:00
dependabot[bot]
95ec541a38 build(deps): bump react-chartjs-2 from 5.2.0 to 5.3.0 in /frontend
Bumps [react-chartjs-2](https://github.com/reactchartjs/react-chartjs-2) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/reactchartjs/react-chartjs-2/releases)
- [Changelog](https://github.com/reactchartjs/react-chartjs-2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactchartjs/react-chartjs-2/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: react-chartjs-2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-05 01:48:13 +00:00
Alex
1941bd36bb Merge pull request #1531 from ManishMadan2882/main
Adding hover effects in Search component
2025-01-05 01:48:05 +00:00
dependabot[bot]
e1b6d61558 build(deps): bump regex from 2024.9.11 to 2024.11.6 in /application
Bumps [regex](https://github.com/mrabarnett/mrab-regex) from 2024.9.11 to 2024.11.6.
- [Changelog](https://github.com/mrabarnett/mrab-regex/blob/hg/changelog.txt)
- [Commits](https://github.com/mrabarnett/mrab-regex/compare/2024.9.11...2024.11.6)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-05 01:47:50 +00:00
dependabot[bot]
c873e4ef42 build(deps): bump markupsafe from 2.1.5 to 3.0.2 in /application
Bumps [markupsafe](https://github.com/pallets/markupsafe) from 2.1.5 to 3.0.2.
- [Release notes](https://github.com/pallets/markupsafe/releases)
- [Changelog](https://github.com/pallets/markupsafe/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/markupsafe/compare/2.1.5...3.0.2)

---
updated-dependencies:
- dependency-name: markupsafe
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-05 01:47:42 +00:00
dependabot[bot]
90eb261da6 build(deps): bump transformers from 4.47.0 to 4.47.1 in /application
Bumps [transformers](https://github.com/huggingface/transformers) from 4.47.0 to 4.47.1.
- [Release notes](https://github.com/huggingface/transformers/releases)
- [Commits](https://github.com/huggingface/transformers/compare/v4.47.0...v4.47.1)

---
updated-dependencies:
- dependency-name: transformers
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-05 01:47:38 +00:00
Alex
fb46cc9fdf Update dependabot.yml 2025-01-05 01:46:47 +00:00
Alex
2d5a2eb52b Merge pull request #1530 from arc53/dependabot/npm_and_yarn/docs/next-14.2.22
build(deps): bump next from 14.2.20 to 14.2.22 in /docs
2025-01-05 01:45:10 +00:00
ManishMadan2882
fa108126bb (feat:settings) sync with locales 2025-01-05 03:39:33 +05:30
ManishMadan2882
b9540ba2bc (fix:locale) add missing keys/semantics in es 2025-01-05 02:04:18 +05:30
ManishMadan2882
1992acaf61 (fix:locale) add missing keys in jp 2025-01-05 01:44:29 +05:30
ManishMadan2882
8c586a34e7 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2025-01-05 01:04:45 +05:30
ManishMadan2882
44399a03c1 (feat:search) add hover states 2025-01-05 01:04:33 +05:30
dependabot[bot]
3e70af9a57 build(deps): bump next from 14.2.20 to 14.2.22 in /docs
Bumps [next](https://github.com/vercel/next.js) from 14.2.20 to 14.2.22.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.20...v14.2.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-04 02:59:13 +00:00
Alex
475d20b627 Merge pull request #1529 from siiddhantt/refactor/minor-changes
refactor: UI enhancement in tools
2025-01-03 16:25:12 +00:00
ManishMadan2882
69c5c6d6b8 (fix/locale) missing keys in chinese 2025-01-03 19:30:43 +05:30
ManishMadan2882
2480dc83b2 (fix/locale) missing keys in locale 2025-01-03 19:29:57 +05:30
Manish Madan
7c8b617f62 Merge branch 'arc53:main' into basic-ui 2025-01-03 18:13:01 +05:30
Manish Madan
7377fee8ca Merge pull request #1525 from arc53/dependabot/npm_and_yarn/frontend/lint-staged-15.3.0
build(deps-dev): bump lint-staged from 15.2.11 to 15.3.0 in /frontend
2025-01-03 17:31:31 +05:30
dependabot[bot]
bdd78b664f build(deps-dev): bump lint-staged from 15.2.11 to 15.3.0 in /frontend
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.2.11 to 15.3.0.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lint-staged/lint-staged/compare/v15.2.11...v15.3.0)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-03 11:58:00 +00:00
Manish Madan
9272d4725a Merge pull request #1522 from arc53/dependabot/npm_and_yarn/frontend/eslint-plugin-react-7.37.3
build(deps-dev): bump eslint-plugin-react from 7.37.2 to 7.37.3 in /frontend
2025-01-03 17:26:52 +05:30
dependabot[bot]
4ae6a8e25d build(deps-dev): bump eslint-plugin-react in /frontend
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.37.2 to 7.37.3.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.37.2...v7.37.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-03 11:50:25 +00:00
Manish Madan
6e660140ae Merge pull request #1523 from arc53/dependabot/npm_and_yarn/frontend/react-i18next-15.4.0
build(deps): bump react-i18next from 15.0.2 to 15.4.0 in /frontend
2025-01-03 17:18:20 +05:30
dependabot[bot]
5315429195 build(deps): bump react-i18next from 15.0.2 to 15.4.0 in /frontend
Bumps [react-i18next](https://github.com/i18next/react-i18next) from 15.0.2 to 15.4.0.
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/react-i18next/compare/v15.0.2...v15.4.0)

---
updated-dependencies:
- dependency-name: react-i18next
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-03 11:45:19 +00:00
Alex
abf898e032 Merge pull request #1527 from ManishMadan2882/main
React extensions: Updating Search Bar
2025-01-03 11:43:45 +00:00
Manish Madan
eef112d83d Merge pull request #1521 from arc53/dependabot/npm_and_yarn/frontend/i18next-browser-languagedetector-8.0.2
build(deps): bump i18next-browser-languagedetector from 8.0.0 to 8.0.2 in /frontend
2025-01-03 17:10:28 +05:30
Siddhant Rai
e1784abbeb fix: extra padding in confirmation modal 2025-01-03 12:42:23 +05:30
Siddhant Rai
0031ca3159 refactor: UI enhancement in tools 2025-01-03 12:27:54 +05:30
ManishMadan2882
411115523e (fix:search) ui adjustments 2025-01-03 02:49:40 +05:30
ManishMadan2882
8b206b087c (feat:search) adding buttonTextt prop, minor ui 2025-01-02 19:36:07 +05:30
ManishMadan2882
0d126106c0 (fix: sources) inconcistent capitalisation 2025-01-02 13:32:25 +05:30
ManishMadan2882
0751debff7 (feat:nav) add enter/esc to rename in tile 2025-01-02 02:31:29 +05:30
ManishMadan2882
33a28a64ec (fix:ui/mobile) button squashed 2025-01-02 01:33:49 +05:30
Manish Madan
28e37d8ad2 Merge branch 'arc53:main' into main 2025-01-01 15:14:40 +05:30
ManishMadan2882
190f571718 (feat/search) exacting ui 2025-01-01 15:14:03 +05:30
Alex
c7d7dfbd50 Merge pull request #1518 from arc53/dependabot/pip/application/marshmallow-3.23.2
build(deps): bump marshmallow from 3.22.0 to 3.23.2 in /application
2024-12-31 15:02:26 +00:00
dependabot[bot]
efb018d2b0 build(deps): bump marshmallow from 3.22.0 to 3.23.2 in /application
Bumps [marshmallow](https://github.com/marshmallow-code/marshmallow) from 3.22.0 to 3.23.2.
- [Changelog](https://github.com/marshmallow-code/marshmallow/blob/dev/CHANGELOG.rst)
- [Commits](https://github.com/marshmallow-code/marshmallow/compare/3.22.0...3.23.2)

---
updated-dependencies:
- dependency-name: marshmallow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-31 14:58:26 +00:00
Alex
cae9a45832 Merge pull request #1517 from arc53/dependabot/pip/application/tiktoken-0.8.0
build(deps): bump tiktoken from 0.7.0 to 0.8.0 in /application
2024-12-31 14:57:35 +00:00
dependabot[bot]
3daeab5186 build(deps): bump tiktoken from 0.7.0 to 0.8.0 in /application
Bumps [tiktoken](https://github.com/openai/tiktoken) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/openai/tiktoken/releases)
- [Changelog](https://github.com/openai/tiktoken/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openai/tiktoken/compare/0.7.0...0.8.0)

---
updated-dependencies:
- dependency-name: tiktoken
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-31 14:57:29 +00:00
Alex
83914d5a56 Merge pull request #1520 from arc53/dependabot/pip/application/redis-5.2.1
build(deps): bump redis from 5.0.1 to 5.2.1 in /application
2024-12-31 14:55:58 +00:00
dependabot[bot]
0f611eb87b build(deps): bump redis from 5.0.1 to 5.2.1 in /application
Bumps [redis](https://github.com/redis/redis-py) from 5.0.1 to 5.2.1.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/v5.0.1...v5.2.1)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-31 14:52:21 +00:00
Alex
f70b2d0839 Merge pull request #1519 from arc53/dependabot/pip/application/celery-5.4.0
build(deps): bump celery from 5.3.6 to 5.4.0 in /application
2024-12-31 14:42:47 +00:00
ManishMadan2882
2f33a46e89 (feat:search/UX) enhance function 2024-12-31 17:33:06 +05:30
ManishMadan2882
598c7a5d76 (feat:search) load geist font 2024-12-31 16:25:44 +05:30
ManishMadan2882
8724c12c11 (feat:search) new UI 2024-12-31 15:30:24 +05:30
Alex
22d9020331 Merge pull request #1516 from arc53/dependabot/pip/application/langsmith-0.2.6
build(deps): bump langsmith from 0.2.3 to 0.2.6 in /application
2024-12-30 20:29:16 +00:00
dependabot[bot]
b4d77080e8 build(deps): bump i18next-browser-languagedetector in /frontend
Bumps [i18next-browser-languagedetector](https://github.com/i18next/i18next-browser-languageDetector) from 8.0.0 to 8.0.2.
- [Changelog](https://github.com/i18next/i18next-browser-languageDetector/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next-browser-languageDetector/compare/v8.0.0...v8.0.2)

---
updated-dependencies:
- dependency-name: i18next-browser-languagedetector
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-30 20:22:47 +00:00
dependabot[bot]
e42fc97d03 build(deps): bump celery from 5.3.6 to 5.4.0 in /application
Bumps [celery](https://github.com/celery/celery) from 5.3.6 to 5.4.0.
- [Release notes](https://github.com/celery/celery/releases)
- [Changelog](https://github.com/celery/celery/blob/main/Changelog.rst)
- [Commits](https://github.com/celery/celery/compare/v5.3.6...v5.4.0)

---
updated-dependencies:
- dependency-name: celery
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-30 20:17:25 +00:00
dependabot[bot]
e45648b389 build(deps): bump langsmith from 0.2.3 to 0.2.6 in /application
Bumps [langsmith](https://github.com/langchain-ai/langsmith-sdk) from 0.2.3 to 0.2.6.
- [Release notes](https://github.com/langchain-ai/langsmith-sdk/releases)
- [Commits](https://github.com/langchain-ai/langsmith-sdk/compare/v0.2.3...v0.2.6)

---
updated-dependencies:
- dependency-name: langsmith
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-30 20:17:15 +00:00
ManishMadan2882
085c4ddf09 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-12-27 17:40:22 +05:30
ManishMadan2882
5ddf9bd7ec (feat:search) handle blockquotes in markdown 2024-12-27 17:40:04 +05:30
ManishMadan2882
2420af3b6d (feat:Search) highlight keywords on searching 2024-12-27 16:20:47 +05:30
ManishMadan2882
b8fade251b (feat: searchResults): adding utility to preprocess markdown 2024-12-24 17:15:17 +05:30
Alex
8935dc4e31 feat: add tool parsing 2024-12-24 00:52:14 +00:00
Alex
ae61d89494 Merge pull request #1508 from arc53/dependabot/npm_and_yarn/frontend/react-router-dom-7.1.1
build(deps): bump react-router-dom from 6.8.1 to 7.1.1 in /frontend
2024-12-23 23:30:59 +00:00
dependabot[bot]
753832d701 build(deps): bump react-router-dom from 6.8.1 to 7.1.1 in /frontend
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.8.1 to 7.1.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.1.1/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 22:06:40 +00:00
Alex
8926cf777c Merge pull request #1497 from arc53/dependabot/npm_and_yarn/frontend/lint-staged-15.2.11
build(deps-dev): bump lint-staged from 15.2.10 to 15.2.11 in /frontend
2024-12-23 22:04:57 +00:00
dependabot[bot]
868ea1a1e2 build(deps-dev): bump lint-staged from 15.2.10 to 15.2.11 in /frontend
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.2.10 to 15.2.11.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lint-staged/lint-staged/compare/v15.2.10...v15.2.11)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 22:03:05 +00:00
Alex
1e1707ec0b Merge pull request #1496 from arc53/dependabot/npm_and_yarn/frontend/typescript-5.7.2
build(deps-dev): bump typescript from 5.6.2 to 5.7.2 in /frontend
2024-12-23 22:01:45 +00:00
dependabot[bot]
636ac2a56c build(deps-dev): bump typescript from 5.6.2 to 5.7.2 in /frontend
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.2 to 5.7.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.7.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:58:40 +00:00
Alex
45076b05f7 Merge pull request #1495 from arc53/dependabot/npm_and_yarn/frontend/postcss-8.4.49
build(deps-dev): bump postcss from 8.4.47 to 8.4.49 in /frontend
2024-12-23 21:56:20 +00:00
dependabot[bot]
ba9e2101bb build(deps-dev): bump postcss from 8.4.47 to 8.4.49 in /frontend
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.47 to 8.4.49.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.47...8.4.49)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:52:27 +00:00
Alex
7301b61cb8 Merge pull request #1490 from arc53/dependabot/pip/application/elasticsearch-8.17.0
build(deps): bump elasticsearch from 8.15.1 to 8.17.0 in /application
2024-12-23 21:50:44 +00:00
Alex
ee3f657751 Merge pull request #1507 from arc53/dependabot/npm_and_yarn/frontend/i18next-24.2.0
build(deps): bump i18next from 23.15.1 to 24.2.0 in /frontend
2024-12-23 21:49:47 +00:00
Alex
e30291966a fix: bump elastic transport 2024-12-23 21:47:31 +00:00
dependabot[bot]
2536bd0988 build(deps): bump elasticsearch from 8.15.1 to 8.17.0 in /application
Bumps [elasticsearch](https://github.com/elastic/elasticsearch-py) from 8.15.1 to 8.17.0.
- [Release notes](https://github.com/elastic/elasticsearch-py/releases)
- [Commits](https://github.com/elastic/elasticsearch-py/compare/v8.15.1...v8.17.0)

---
updated-dependencies:
- dependency-name: elasticsearch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:44:39 +00:00
Alex
5234350bde Merge pull request #1510 from arc53/dependabot/pip/application/langchain-openai-0.2.14
build(deps): bump langchain-openai from 0.2.0 to 0.2.14 in /application
2024-12-23 21:43:25 +00:00
Alex
36e4398bcb fix: bump deps 2024-12-23 21:39:33 +00:00
Alex
4b040280c3 Merge branch 'dependabot/pip/application/langchain-openai-0.2.14' of https://github.com/arc53/DocsGPT into dependabot/pip/application/langchain-openai-0.2.14 2024-12-23 21:34:18 +00:00
dependabot[bot]
fdd2300517 build(deps): bump langchain-openai from 0.2.0 to 0.2.14 in /application
Bumps [langchain-openai](https://github.com/langchain-ai/langchain) from 0.2.0 to 0.2.14.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-openai==0.2.0...langchain-openai==0.2.14)

---
updated-dependencies:
- dependency-name: langchain-openai
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:31:04 +00:00
Alex
49913b2258 Merge pull request #1509 from arc53/dependabot/pip/application/numpy-2.2.1
build(deps): bump numpy from 1.26.4 to 2.2.1 in /application
2024-12-23 21:30:04 +00:00
Alex
4927b64d27 bump pytest 2024-12-23 21:26:22 +00:00
Alex
fb2df05e3f feat: upgrade python and bump faiss-cpu 2024-12-23 21:23:54 +00:00
dependabot[bot]
ab90a93eec build(deps): bump numpy from 1.26.4 to 2.2.1 in /application
Bumps [numpy](https://github.com/numpy/numpy) from 1.26.4 to 2.2.1.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v1.26.4...v2.2.1)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:15:46 +00:00
Alex
48c17169b5 Merge pull request #1506 from arc53/dependabot/pip/application/jinja2-3.1.5
build(deps): bump jinja2 from 3.1.4 to 3.1.5 in /application
2024-12-23 21:13:40 +00:00
Alex
41cd83f20e Merge branch 'dependabot/pip/application/jinja2-3.1.5' of https://github.com/arc53/DocsGPT into dependabot/pip/application/jinja2-3.1.5 2024-12-23 21:08:16 +00:00
dependabot[bot]
52dd3f798a build(deps): bump jinja2 from 3.1.4 to 3.1.5 in /application
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.4...3.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:06:38 +00:00
Alex
070efd6951 Merge pull request #1493 from arc53/dependabot/pip/application/yarl-1.18.3
build(deps): bump yarl from 1.11.1 to 1.18.3 in /application
2024-12-23 21:04:35 +00:00
dependabot[bot]
502d82e1c9 build(deps): bump langchain-openai from 0.2.0 to 0.2.14 in /application
Bumps [langchain-openai](https://github.com/langchain-ai/langchain) from 0.2.0 to 0.2.14.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-openai==0.2.0...langchain-openai==0.2.14)

---
updated-dependencies:
- dependency-name: langchain-openai
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 20:58:59 +00:00
dependabot[bot]
7760e779ae build(deps): bump i18next from 23.15.1 to 24.2.0 in /frontend
Bumps [i18next](https://github.com/i18next/i18next) from 23.15.1 to 24.2.0.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.15.1...v24.2.0)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 20:14:33 +00:00
dependabot[bot]
474298c969 build(deps): bump jinja2 from 3.1.4 to 3.1.5 in /application
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.4...3.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 18:12:13 +00:00
Alex
b2a013c027 fix: remove reqs from scripts folder 2024-12-23 18:11:15 +00:00
Alex
cca5ef098b Merge pull request #1503 from arc53/chunking
test version
2024-12-23 17:53:45 +00:00
Alex
41b4c28430 fix: linting 2024-12-23 17:41:44 +00:00
Alex
90962ee056 fix: debugger in launch json 2024-12-23 17:41:13 +00:00
Alex
953cff09a0 Merge branch 'chunking' of https://github.com/arc53/DocsGPT into chunking 2024-12-23 16:59:44 +00:00
Pavel
b41a989051 test version 2024-12-23 16:59:27 +00:00
Alex
4fcd45c1ae Merge pull request #1473 from arc53/tool-use
Tools + agent
2024-12-20 18:17:39 +00:00
Alex
1f75f0c082 fix: tests 2024-12-20 18:13:37 +00:00
Alex
c2a95b5bec lint: fixing index and classc rag 2024-12-20 17:32:58 +00:00
Alex
0a246d3de7 Merge branch 'main' into tool-use 2024-12-20 17:29:41 +00:00
Alex
2d6238d431 Merge pull request #1502 from siiddhantt/feat/tools-section
feat: tools frontend and endpoints refactor
2024-12-20 16:27:29 +00:00
Pavel
c4f3dc4434 test version 2024-12-20 18:41:47 +03:00
Alex
2aea24afdd depriciate mock backend 2024-12-20 11:01:57 +00:00
Alex
666240f21e Merge pull request #1455 from Niharika0104/FIXES-#1166
Fixed the feedback issue
2024-12-19 18:27:54 +00:00
Alex
fb4ab220d6 Merge pull request #1501 from arc53/dependabot/npm_and_yarn/docs/next-14.2.20
build(deps): bump next from 14.2.12 to 14.2.20 in /docs
2024-12-19 18:25:49 +00:00
Alex
5a882fe37f Merge pull request #1500 from ManishMadan2882/main
Limiting Conversational history
2024-12-19 18:23:44 +00:00
Alex
132326136a added gpt-4o-mini model 2024-12-19 18:17:12 +00:00
Alex
6fc4723d61 feat: flask debugger for vscode 2024-12-19 16:03:39 +00:00
Alex
8564198321 mini-model as default 2024-12-19 16:02:27 +00:00
Siddhant Rai
4c3f990d4b feat: tools agent refactor for custom fields and unique actions 2024-12-19 20:34:20 +05:30
ManishMadan2882
b19c14787e (fix) avoid stringifying list 2024-12-19 17:58:55 +05:30
Siddhant Rai
f67b79f007 fix: missing yield in tool agent 2024-12-19 17:55:58 +05:30
Siddhant Rai
daa332aa20 fix: python lint errors 2024-12-19 10:06:06 +05:30
Siddhant Rai
c3f538c2f6 fix: merge errors 2024-12-19 09:59:38 +05:30
Siddhant Rai
a0e677ea00 Merge branch 'feat/tools-section' of https://github.com/siiddhantt/DocsGPT into feat/tools-section 2024-12-19 09:58:41 +05:30
Siddhant Rai
343569ba19 fix: create_tool endpoint for new fields 2024-12-19 09:58:32 +05:30
ManishMadan2882
9096013e13 (refactor) remove preprocessing in retrieval 2024-12-19 05:20:55 +05:30
ManishMadan2882
89a2f249c1 (feat:conv history) token limit from settings 2024-12-19 05:15:33 +05:30
Manish Madan
4b0e094272 Merge branch 'arc53:main' into main 2024-12-19 02:15:40 +05:30
Siddhant Rai
97713e872a Merge branch 'tool-use' into feat/tools-section 2024-12-18 22:53:31 +05:30
Siddhant Rai
f9a7db11eb feat: tools frontend and endpoints refactor 2024-12-18 22:48:40 +05:30
dependabot[bot]
1448d7e6eb build(deps): bump next from 14.2.12 to 14.2.20 in /docs
Bumps [next](https://github.com/vercel/next.js) from 14.2.12 to 14.2.20.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.2.12...v14.2.20)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-18 12:02:03 +00:00
Manish Madan
8e7d5340d7 Merge pull request #1489 from arc53/dependabot/pip/application/sentence-transformers-3.3.1
build(deps): bump sentence-transformers from 3.0.1 to 3.3.1 in /application
2024-12-18 17:30:51 +05:30
Niharika Goulikar
47ecf98e2a Resolved merge conflicts 2024-12-18 10:47:34 +00:00
ManishMadan2882
f8e4e42a36 (feat:limit conv history) add util method 2024-12-17 16:14:17 +05:30
dependabot[bot]
38753c4395 build(deps): bump yarl from 1.11.1 to 1.18.3 in /application
Bumps [yarl](https://github.com/aio-libs/yarl) from 1.11.1 to 1.18.3.
- [Release notes](https://github.com/aio-libs/yarl/releases)
- [Changelog](https://github.com/aio-libs/yarl/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/yarl/compare/v1.11.1...v1.18.3)

---
updated-dependencies:
- dependency-name: yarl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 20:09:34 +00:00
dependabot[bot]
b473e13b83 build(deps): bump sentence-transformers in /application
Bumps [sentence-transformers](https://github.com/UKPLab/sentence-transformers) from 3.0.1 to 3.3.1.
- [Release notes](https://github.com/UKPLab/sentence-transformers/releases)
- [Commits](https://github.com/UKPLab/sentence-transformers/compare/v3.0.1...v3.3.1)

---
updated-dependencies:
- dependency-name: sentence-transformers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 20:09:08 +00:00
Manish Madan
9092575186 Merge pull request #1488 from arc53/dependabot/pip/application/langsmith-0.2.3
build(deps): bump langsmith from 0.1.125 to 0.2.3 in /application
2024-12-14 15:27:00 +05:30
ManishMadan2882
ffe5ac2aad (update) langchain, core and community 2024-12-14 15:21:52 +05:30
dependabot[bot]
0ab6f75410 build(deps): bump langsmith from 0.1.125 to 0.2.3 in /application
Bumps [langsmith](https://github.com/langchain-ai/langsmith-sdk) from 0.1.125 to 0.2.3.
- [Release notes](https://github.com/langchain-ai/langsmith-sdk/releases)
- [Commits](https://github.com/langchain-ai/langsmith-sdk/compare/v0.1.125...v0.2.3)

---
updated-dependencies:
- dependency-name: langsmith
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-14 09:40:13 +00:00
Manish Madan
099245f27e Merge pull request #1479 from arc53/dependabot/pip/application/transformers-4.47.0
build(deps): bump transformers from 4.44.2 to 4.47.0 in /application
2024-12-14 05:09:25 +05:30
ManishMadan2882
0a0fe20fa0 (update) tokenizers 2024-12-14 04:53:06 +05:30
dependabot[bot]
c2aa5cc994 build(deps): bump transformers from 4.44.2 to 4.47.0 in /application
Bumps [transformers](https://github.com/huggingface/transformers) from 4.44.2 to 4.47.0.
- [Release notes](https://github.com/huggingface/transformers/releases)
- [Commits](https://github.com/huggingface/transformers/compare/v4.44.2...v4.47.0)

---
updated-dependencies:
- dependency-name: transformers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 23:19:47 +00:00
Manish Madan
f84e59a7fb Merge pull request #1485 from arc53/dependabot/npm_and_yarn/docs/nanoid-3.3.8
build(deps): bump nanoid from 3.3.7 to 3.3.8 in /docs
2024-12-14 02:47:21 +05:30
Manish Madan
613c032994 Merge pull request #1484 from arc53/dependabot/npm_and_yarn/extensions/react-widget/nanoid-3.3.8
build(deps): bump nanoid from 3.3.7 to 3.3.8 in /extensions/react-widget
2024-12-14 02:46:39 +05:30
Manish Madan
7829db97bf Merge pull request #1469 from arc53/dependabot/npm_and_yarn/frontend/vitejs/plugin-react-4.3.4
build(deps-dev): bump @vitejs/plugin-react from 4.3.1 to 4.3.4 in /frontend
2024-12-14 02:39:50 +05:30
dependabot[bot]
acdfde6752 build(deps-dev): bump @vitejs/plugin-react in /frontend
Bumps [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) from 4.3.1 to 4.3.4.
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/v4.3.4/packages/plugin-react)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 20:54:30 +00:00
dependabot[bot]
c673c0b245 Merge pull request #1467 from arc53/dependabot/npm_and_yarn/frontend/eslint-plugin-import-2.31.0 2024-12-13 20:50:35 +00:00
dependabot[bot]
4bf4e11cee build(deps-dev): bump eslint-plugin-import in /frontend
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.30.0...v2.31.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 20:42:34 +00:00
dependabot[bot]
770175456f Merge pull request #1390 from arc53/dependabot/npm_and_yarn/frontend/eslint-plugin-react-7.37.2 2024-12-13 19:23:05 +00:00
dependabot[bot]
0abbf71f15 build(deps-dev): bump eslint-plugin-react in /frontend
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.35.0 to 7.37.2.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.35.0...v7.37.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 19:06:16 +00:00
Alex
46b0de367a fix: strings 2024-12-12 10:40:55 +00:00
Alex
30309659d3 Merge pull request #1486 from Srayash/Srayash/Languages
Fix language support for Chinese and add Russian language
2024-12-11 14:44:20 +00:00
Srayash Singh
acadd6bddc Merge branch 'arc53:main' into Srayash/Languages 2024-12-11 16:46:40 +05:30
Srayash
96c57260cb Add Russian and fix Traditional Chinese 2024-12-11 16:45:41 +05:30
dependabot[bot]
f29f58b2ac build(deps): bump nanoid from 3.3.7 to 3.3.8 in /docs
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 23:17:23 +00:00
dependabot[bot]
124a04738c build(deps): bump nanoid from 3.3.7 to 3.3.8 in /extensions/react-widget
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 23:17:21 +00:00
Alex
3a60c31df9 Merge pull request #1483 from ManishMadan2882/main
Fixes: Client.__init__() got an unexpected keyword argument 'proxies'
2024-12-10 23:16:14 +00:00
ManishMadan2882
501cf3973c Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-12-11 02:04:31 +05:30
ManishMadan2882
c73251e998 (fix:TypeError) Client Proxies Argument 2024-12-11 02:04:20 +05:30
Alex
201fb61bd4 Delete lexeu-competition.md 2024-12-10 14:23:38 +00:00
Alex
f87ae429f4 fix: edit names 2024-12-09 17:52:20 +00:00
Alex
35e8e2df44 Merge pull request #1475 from ManishMadan2882/main
Highlight Similar substrings in search results
2024-12-09 16:20:57 +00:00
ManishMadan2882
7c3f80f13d (fix: filter search) trim keyword pre processing 2024-12-09 12:47:13 +05:30
ManishMadan2882
17a176ad4e Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-12-09 02:44:50 +05:30
ManishMadan2882
ca5eb06de9 (feat:filter results) improve markdown format, add filter 2024-12-09 02:43:26 +05:30
ManishMadan2882
2378548cf1 (feat: filer result) remove iterator; optimisation 2024-12-09 02:41:06 +05:30
ManishMadan2882
fdd265f47f (feat:filter search result) use node iterator 2024-12-09 01:51:06 +05:30
Alex
3e2e1ecddf fix: add status to tools 2024-12-06 23:11:16 +00:00
Alex
863950963f simple user tool handling endpoint 2024-12-06 22:19:01 +00:00
GH Action - Upstream Sync
defa1b28a8 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-12-06 01:27:00 +00:00
Alex
1f649274d1 feat: tooling init 2024-12-05 22:44:40 +00:00
ManishMadan2882
3ce04de161 (feat:highlightSearch) recursively filter the DOM 2024-12-06 03:33:44 +05:30
Alex
e798d18e70 Merge pull request #1470 from ManishMadan2882/main
Minor frontend changes
2024-12-05 11:47:45 +00:00
Manish Madan
ed2609d3b3 Merge branch 'main' into main 2024-12-05 16:33:55 +05:30
Alex
6d2a2632c5 Merge pull request #1463 from Srayash/feature/drag-and-drop-training
feature: Drag and drop training, from input box
2024-12-05 10:53:19 +00:00
Srayash
dbf95a95a4 default assign renderTab and receivedFiles to null and [] respectively 2024-12-05 16:15:57 +05:30
ManishMadan2882
0e4bd06795 (feat:shared)add meta:og twitter tags 2024-12-05 02:49:00 +05:30
ManishMadan2882
4d38280cfa (fix:title) remove dino emoji 2024-12-04 02:49:10 +05:30
ManishMadan2882
75173473ae (feat:bubble) replace emoji with user profile 2024-12-04 02:47:57 +05:30
Srayash
b314b27260 Internationalization: add translations. 2024-12-02 23:24:26 +05:30
Srayash
cc7e223082 enhancement: style the drag and drop feature. 2024-12-02 23:21:41 +05:30
Srayash
79f87d4c20 add comma 2024-12-02 01:03:20 +05:30
Srayash
8adbd6720a noClick set to true for Dropzone. 2024-12-02 00:53:18 +05:30
Srayash
c3973571a7 feature: Drag and drop training, from input box. 2024-12-02 00:22:16 +05:30
Srayash
bf63509a6e modify upload component to take receivedFile and renderTab as props. 2024-12-02 00:16:47 +05:30
Alex
6552fe831b Merge pull request #1461 from ManishMadan2882/main
(fix:edit-query)delete following queries
2024-11-30 23:49:20 +00:00
ManishMadan2882
05fdf6b93a (fix:edit-query) replace input with textarea 2024-11-30 02:44:24 +05:30
ManishMadan2882
6953c3dbe4 (fix:markdown) no overflowing words 2024-11-29 03:32:36 +05:30
ManishMadan2882
55ecda902d (fix:edit-feat): exacting the UI/UX 2024-11-29 03:28:35 +05:30
Alex
0495610257 Merge pull request #1430 from arc53/dependabot/pip/application/werkzeug-3.1.3 2024-11-28 19:25:37 +00:00
Alex
301bb2dcfe Merge pull request #1409 from arc53/dependabot/npm_and_yarn/frontend/react-dropzone-14.3.5 2024-11-28 19:15:03 +00:00
Alex
598b8f9980 Merge pull request #1448 from arc53/dependabot/github_actions/codecov/codecov-action-5 2024-11-28 19:13:42 +00:00
GH Action - Upstream Sync
9528f34a25 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-28 01:26:19 +00:00
ManishMadan2882
625aed151d (fix:edit-query)delete following queries 2024-11-28 04:02:05 +05:30
Alex
4ffdf3f9a2 Merge pull request #1456 from ManishMadan2882/main
Minor UI adjustments
2024-11-27 15:14:53 +00:00
ManishMadan2882
0a97e5b7be (fix:delete_old) del source from db even when FileNotFound err 2024-11-27 16:57:47 +05:30
ManishMadan2882
bfeae3a95b (fix:settings) truncate long doc names 2024-11-27 16:54:05 +05:30
Manish Madan
4ab12663be Merge branch 'arc53:main' into main 2024-11-27 03:41:23 +05:30
Alex
0584c29781 Merge pull request #1442 from fadingNA/document-table
Table Styling & Add search feature to backend
2024-11-26 20:08:12 +00:00
ManishMadan2882
a8231d375a (fix:markdown) code overflows 2024-11-27 00:45:01 +05:30
ManishMadan2882
a86b342ba5 fix(bubble) smaller fonts on mobile questions 2024-11-26 19:14:50 +05:30
ManishMadan2882
0a7a313e5d (fix:conv) input touches viewport bottom in mobile 2024-11-26 18:57:11 +05:30
Niharika Goulikar
9d4aee5de2 fixed the python error 2024-11-26 13:05:50 +00:00
Niharika Goulikar
faf031ce80 fixed linting issues 2024-11-26 12:28:16 +00:00
Niharika Goulikar
e9a2b8f03a Fixed the feedback issue 2024-11-26 12:16:21 +00:00
fadingNA
d89bd0941d change visible to block 2024-11-25 08:35:24 -05:00
Alex
8d8423b6e0 Merge pull request #1444 from Niharika0104/Fixes-#1260
Fixed edit and resend issue
2024-11-25 11:12:56 +00:00
fadingNA
e22669f91d add text center when no data 2024-11-24 17:05:36 -05:00
fadingNA
b5e5fb7f10 fix table header text wrap 2024-11-24 17:02:57 -05:00
fadingNA
2709994ede update APIKey Table and dark styling 2024-11-24 11:18:42 -05:00
fadingNA
e5bd194b6c Remove dangling console log 2024-11-23 20:04:53 -05:00
fadingNA
f01f76dba7 Move Pagination Outside Scrollable Area | Add smooth transition dropdown rows per page select | adjust sync button 2024-11-23 18:06:54 -05:00
Alex
289bd41570 Merge pull request #1428 from arc53/dependabot/npm_and_yarn/frontend/vite-5.4.11
build(deps-dev): bump vite from 5.4.6 to 5.4.11 in /frontend
2024-11-23 21:30:42 +00:00
dependabot[bot]
6a0d6a8faf build(deps-dev): bump vite from 5.4.6 to 5.4.11 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.6 to 5.4.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.11/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-23 21:01:43 +00:00
Alex
dcc39d954e Merge pull request #1446 from arc53/dependabot/npm_and_yarn/frontend/tailwindcss-3.4.15
build(deps-dev): bump tailwindcss from 3.4.11 to 3.4.15 in /frontend
2024-11-23 21:00:25 +00:00
Niharika Goulikar
8a67f18cd9 Fixed minor ui issues 2024-11-23 06:13:07 +00:00
Alex
2e02304c71 Merge pull request #1450 from ManishMadan2882/main
React Widget: Updating to v0.4.8
2024-11-22 23:23:16 +00:00
ManishMadan2882
ce975c5d93 (documentation): udpate with search bar 2024-11-23 03:09:03 +05:30
ManishMadan2882
fb4bb54aca (upgrade) v0.4.8 2024-11-23 02:44:06 +05:30
ManishMadan2882
dae0942d03 (refactor): separate browser ready builds 2024-11-23 02:29:27 +05:30
fadingNA
25b1173db7 remove table type column 2024-11-22 09:10:58 -05:00
Alex
92d90866ca Merge pull request #1436 from ManishMadan2882/main
React Widget: Search bar component
2024-11-22 13:40:50 +00:00
ManishMadan2882
1595e0210a (fix:search) change toolkit info 2024-11-22 17:55:37 +05:30
ManishMadan2882
ea4ef40a12 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-22 17:31:06 +05:30
ManishMadan2882
9986fce8bf (fix:search) spacing, minor bug 2024-11-22 17:30:50 +05:30
GH Action - Upstream Sync
628f83172a Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-22 01:25:17 +00:00
ManishMadan2882
c855896221 (fix:events): enter on pc, tap on mobile 2024-11-22 00:05:07 +05:30
ManishMadan2882
94b5241e70 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-21 23:54:34 +05:30
ManishMadan2882
0600f095f5 (feat:widget) append prefilledQuery 2024-11-21 23:54:19 +05:30
Alex
a0a05b676f Merge pull request #1303 from jayantp2003/bugfix/859-large-zip-breaking-stream-endpoint
Bugfix/859 large zip breaking stream endpoint
2024-11-21 17:34:21 +00:00
Alex
a818975823 Update README.md 2024-11-21 14:43:54 +00:00
Niharika Goulikar
8e9f31cc32 Fixed python linting issues 2024-11-21 11:22:33 +00:00
Niharika Goulikar
0d4bc4ec2c Made the requested changes 2024-11-21 11:17:58 +00:00
GH Action - Upstream Sync
7a0118b31c Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-21 01:23:51 +00:00
ManishMadan2882
e9a8161811 (feat/widget): autofocus input 2024-11-20 17:11:33 +05:30
ManishMadan2882
a6bface632 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-20 17:04:55 +05:30
ManishMadan2882
48f47351ee (feat:keydown): listen cross platform events 2024-11-20 17:04:45 +05:30
Alex
9247f16add Merge pull request #1434 from RohittCodes/fix-1231
feat: wrapper modal
2024-11-20 10:48:30 +00:00
GH Action - Upstream Sync
d3eab30d74 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-20 01:24:08 +00:00
Alex
f65ecb9a0f fix: lint import 2024-11-19 19:16:24 +00:00
Alex
312cb9ae70 feat: image parser 2024-11-19 19:06:53 +00:00
Alex
cce60ce101 fix: save convo messages, docsgpt provider format 2024-11-19 16:22:58 +00:00
ManishMadan2882
e0a3b8004c (fix): minor ui; loading state 2024-11-19 04:41:12 +05:30
ManishMadan2882
91239820e3 (feat/search): debounce and abort previous pending req 2024-11-19 04:25:54 +05:30
ManishMadan2882
8641a91182 (feat-search): adding loader, no-results 2024-11-19 03:38:13 +05:30
dependabot[bot]
84bffd24f2 build(deps): bump codecov/codecov-action from 4 to 5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 20:43:34 +00:00
dependabot[bot]
9fb37b1179 build(deps-dev): bump tailwindcss from 3.4.11 to 3.4.15 in /frontend
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.11 to 3.4.15.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.15/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.11...v3.4.15)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 20:13:53 +00:00
ManishMadan2882
4eee10b5d5 (feat/search): redirect to sources 2024-11-18 19:06:41 +05:30
ManishMadan2882
c53456876c Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-18 17:01:05 +05:30
ManishMadan2882
1a9f31174d (search): modal triggers on ctrl k 2024-11-18 17:00:56 +05:30
fadingNA
0493352292 frontend: remove search on localstate, change to backend search use mongo passing searchTerm 2024-11-18 00:06:18 -05:00
fadingNA
13b91193cc backend : update sources/paginated to search document by query 'name' 2024-11-18 00:05:48 -05:00
GH Action - Upstream Sync
9a367c76a0 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-18 01:26:31 +00:00
ManishMadan2882
f58e7cc154 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-18 03:18:48 +05:30
ManishMadan2882
5ee0f15d94 (feat: search): close on click outside 2024-11-18 03:18:39 +05:30
Alex
250edf26a5 Update README.md 2024-11-17 15:01:39 +00:00
Alex
7a01376828 fix: remove more old files 2024-11-17 13:02:45 +00:00
Alex
63b547ea13 fix: delete old files 2024-11-17 12:59:34 +00:00
Niharika Goulikar
626689cbe0 Merge branch 'arc53:main' into Fixes-#1260 2024-11-17 16:18:11 +05:30
Niharika Goulikar
a44319d815 Fixed edit and resend issue 2024-11-17 10:29:29 +00:00
utin-francis-peter
2c8a2945f0 feat: better sources scroll management 2024-11-17 10:34:22 +01:00
utin-francis-peter
ba59042e5c Merge branch 'main' into feat/sources-in-react-widget 2024-11-17 09:19:20 +01:00
GH Action - Upstream Sync
3273af7f40 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-17 01:36:05 +00:00
Alex
5971ff884e Merge pull request #1443 from siiddhantt/fix/streaming-old-answer
fix: old streaming answer gets appended to new conversation
2024-11-16 22:48:55 +00:00
ManishMadan2882
cbf33e698b Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-17 03:31:19 +05:30
ManishMadan2882
868e59bca0 (fix: css conflict): replace global keyframes 2024-11-17 03:31:09 +05:30
rohittcodes
04959df194 refactor: upload 2024-11-16 19:45:22 +05:30
Siddhant Rai
47d687b151 fix: old streaming answer gets appended to new conversation 2024-11-16 17:13:15 +05:30
fadingNA
2ad6b4fa4e update table styling 2024-11-15 23:16:58 -05:00
GH Action - Upstream Sync
8e94688b77 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-16 01:23:10 +00:00
ManishMadan2882
fab367f041 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-16 02:14:02 +05:30
ManishMadan2882
94617c5ef7 (fix:animations) minor fix 2024-11-16 02:13:40 +05:30
Alex
4443bc77fd Merge pull request #1441 from arc53/google-llm 2024-11-15 14:51:11 +00:00
ManishMadan2882
d33246612d (widget) unmount with timeout 2024-11-15 18:16:45 +05:30
Alex
144ab61e07 fix: ruff lint 2024-11-15 12:19:43 +00:00
Alex
a4c95fd62b feat: add google ai 2024-11-15 12:17:25 +00:00
Alex
2245f4690e fix: reddit loader validation 2024-11-15 11:02:27 +00:00
GH Action - Upstream Sync
8eaeaa91f9 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-15 01:25:08 +00:00
ManishMadan2882
7bd0351ee9 (fix): mount only when open 2024-11-15 06:25:24 +05:30
ManishMadan2882
811a20f080 search: add themes, fix css override 2024-11-15 05:52:46 +05:30
Alex
1decff2114 Merge pull request #1422 from fadingNA/multiple-files-bug
upload routes fix for multiple upload
2024-11-14 22:53:36 +00:00
Alex
c97968f6c0 Merge pull request #1439 from RohittCodes/fix-1438
refactor: loader-color
2024-11-14 22:22:52 +00:00
Alex
9deb5adcbf Merge pull request #1435 from mas-who/fix-add-prompt-modal
Improve UX for adding and editing prompts in the settings page
2024-11-14 17:31:28 +00:00
Nonthachai Plodthong
91e7c16d90 Merge branch 'main' into multiple-files-bug 2024-11-14 12:28:51 -05:00
Alex
edc81d8e6e Merge pull request #1385 from AkashJana18/fix/1219-message-box
fix: #1219 Too big top margin of message box separator
2024-11-14 16:52:59 +00:00
rohittcodes
ed8d553491 refactor: loader-color 2024-11-14 20:46:02 +05:30
Alex
a64a5e89db Merge pull request #1437 from siiddhantt/feat/chat-ui-enhancement
refactor: smooth answer appearance
2024-11-14 10:21:53 +00:00
Siddhant Rai
bd636d59dd refactor: smooth answer appearance 2024-11-14 15:35:22 +05:30
GH Action - Upstream Sync
2d15492190 Merge branch 'main' of https://github.com/arc53/DocsGPT 2024-11-14 01:20:08 +00:00
ManishMadan2882
d696f0d081 Merge branch 'main' of https://github.com/ManishMadan2882/docsgpt 2024-11-14 04:52:49 +05:30
ManishMadan2882
9409e4498f (feat:search bar) initiating seach bar 2024-11-14 04:52:15 +05:30
ManishMadan2882
541a6417b7 (refactor): separate widget core 2024-11-14 04:51:26 +05:30
Mason Hu
f6e9f9011d fix: prevent saving prompt with same name as existing prompt 2024-11-13 15:28:16 +02:00
Mason Hu
2fe3cb2b22 fix: hide edit option for default prompts 2024-11-13 14:51:48 +02:00
Mason Hu
6b9519b56f fix: prevent previous prompt name and content from displaying when adding new prompt 2024-11-13 14:36:34 +02:00
Alex
9bbe7564a9 fix: llamacpp 2024-11-13 11:45:42 +00:00
rohittcodes
58af393968 feat: wrapper modal 2024-11-13 02:15:05 +05:30
dependabot[bot]
0ef232f731 build(deps): bump werkzeug from 3.0.4 to 3.1.3 in /application
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.4 to 3.1.3.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.0.4...3.1.3)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 21:01:52 +00:00
utin-francis-peter
6f83bd8961 Merge branch 'main' into feat/sources-in-react-widget 2024-11-11 14:36:34 +01:00
fadingNA
8a225e279f multiple-file missing task ingest
restore upload to pack all file together instead one by one
2024-11-10 03:00:22 -05:00
fadingNA
d5cce88108 Merge branch 'main' of https://github.com/fadingNA/DocsGPT into multiple-files-bug 2024-11-10 01:55:12 -05:00
utin-francis-peter
a7aae3ff7e style: minor adjustments in border-radius and spacings 2024-11-10 03:29:56 +01:00
utin-francis-peter
25feab9a29 chore: removed unused import 2024-11-10 03:11:41 +01:00
utin-francis-peter
97916bf925 chore: returned themes cofig into DocsGPTWidget component 2024-11-10 03:08:35 +01:00
utin-francis-peter
42e2c784c4 Merge branch 'main' of https://github.com/utin-francis-peter/DocsGPT into feat/sources-in-react-widget 2024-11-10 03:06:23 +01:00
utin-francis-peter
1a8f89573d feat: query sources in widget 2024-11-09 01:09:22 +01:00
fadingNA
bc840900a3 change logically to upload file one by one instead of send all in one 2024-11-08 02:34:31 -05:00
AkashJana18
fe16743d16 fix/scrollbar in input textarea 2024-11-06 12:39:38 +05:30
utin-francis-peter
3e87d83ae8 chore: adjusted spacing in source bubble 2024-11-05 21:50:42 +01:00
dependabot[bot]
fe18d6e638 build(deps): bump react-dropzone from 14.2.3 to 14.3.5 in /frontend
Bumps [react-dropzone](https://github.com/react-dropzone/react-dropzone) from 14.2.3 to 14.3.5.
- [Release notes](https://github.com/react-dropzone/react-dropzone/releases)
- [Commits](https://github.com/react-dropzone/react-dropzone/compare/v14.2.3...v14.3.5)

---
updated-dependencies:
- dependency-name: react-dropzone
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 20:41:57 +00:00
utin-francis-peter
0784823e21 Merge branch 'main' of https://github.com/utin-francis-peter/DocsGPT into feat/sources-in-react-widget 2024-11-04 16:36:13 +01:00
utin-francis-peter
1a9f47b1bc chore: modified query sources and removed tooltip 2024-11-04 16:33:00 +01:00
AkashJana18
2d37083719 minor changes 2024-11-02 11:22:39 +05:30
utin-francis-peter
991a38df28 Merge branch 'main' of https://github.com/utin-francis-peter/DocsGPT into feat/sources-in-react-widget 2024-10-28 17:44:50 +01:00
utin-francis-peter
656f4da8f9 feat: rendering of response source 2024-10-28 17:34:35 +01:00
utin-francis-peter
f8d65b84db chore: wrapped the base component with ThemeProvider at the root level to make theme props available globally 2024-10-28 17:33:40 +01:00
AkashJana18
4bc14dbdd0 fix: 1219 2024-10-27 02:46:27 +05:30
utin-francis-peter
bd66d0a987 Merge branch 'main' of https://github.com/utin-francis-peter/DocsGPT into feat/sources-in-react-widget 2024-10-14 13:02:38 +01:00
utin-francis-peter
62802eb138 chore: styled component styles for sources, added showSources prop to widget, handled sources data.type, and rendering sources when available 2024-10-14 12:37:02 +01:00
utin-francis-peter
848beb11df chore: corrected typo in var declaration 2024-10-14 12:33:56 +01:00
utin-francis-peter
0481e766ae chore: updated Query and WidgetProps interface with source property 2024-10-14 12:30:57 +01:00
jayantp2003
3db07f3a26 Fix #859: Resolve issue with large zip breaking stream endpoint 2024-10-11 17:10:12 +05:30
jayantp2003
a2ef45e13f Fix #859: Resolve issue with large zip breaking stream endpoint 2024-10-11 17:08:04 +05:30
utin-francis-peter
aa57984bde build: added missing dependency 2024-10-11 03:55:35 +01:00
376 changed files with 31858 additions and 13306 deletions

15
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM python:3.12-bookworm
# Install Node.js 20.x
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Install global npm packages
RUN npm install -g husky vite
# Create and activate Python virtual environment
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /workspace

View File

@@ -0,0 +1,49 @@
# Welcome to DocsGPT Devcontainer
Welcome to the DocsGPT development environment! This guide will help you get started quickly.
## Starting Services
To run DocsGPT, you need to start three main services: Flask (backend), Celery (task queue), and Vite (frontend). Here are the commands to start each service within the devcontainer:
### Vite (Frontend)
```bash
cd frontend
npm run dev -- --host
```
### Flask (Backend)
```bash
flask --app application/app.py run --host=0.0.0.0 --port=7091
```
### Celery (Task Queue)
```bash
celery -A application.app.celery worker -l INFO
```
## Github Codespaces Instructions
### 1. Make Ports Public:
Go to the "Ports" panel in Codespaces (usually located at the bottom of the VS Code window).
For both port 5173 and 7091, right-click on the port and select "Make Public".
![CleanShot 2025-02-12 at 09 46 14@2x](https://github.com/user-attachments/assets/00a34b16-a7ef-47af-9648-87a7e3008475)
### 2. Update VITE_API_HOST:
After making port 7091 public, copy the public URL provided by Codespaces for port 7091.
Open the file frontend/.env.development.
Find the line VITE_API_HOST=http://localhost:7091.
Replace http://localhost:7091 with the public URL you copied from Codespaces.
![CleanShot 2025-02-12 at 09 46 56@2x](https://github.com/user-attachments/assets/c472242f-1079-4cd8-bc0b-2d78db22b94c)

View File

@@ -0,0 +1,24 @@
{
"name": "DocsGPT Dev Container",
"dockerComposeFile": ["docker-compose-dev.yaml", "docker-compose.override.yaml"],
"service": "dev",
"workspaceFolder": "/workspace",
"postCreateCommand": ".devcontainer/post-create-command.sh",
"forwardPorts": [7091, 5173, 6379, 27017],
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
},
"codespaces": {
"openFiles": [
".devcontainer/devc-welcome.md",
"CONTRIBUTING.md"
]
}
}
}

View File

@@ -0,0 +1,40 @@
version: '3.8'
services:
dev:
build:
context: .
dockerfile: Dockerfile
volumes:
- ../:/workspace:cached
command: sleep infinity
depends_on:
redis:
condition: service_healthy
mongo:
condition: service_healthy
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- MONGO_URI=mongodb://mongo:27017/docsgpt
- CACHE_REDIS_URL=redis://redis:6379/2
networks:
- default
redis:
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 30s
retries: 5
mongo:
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 5s
timeout: 30s
retries: 5
networks:
default:
name: docsgpt-dev-network

View File

@@ -0,0 +1,32 @@
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status
if [ ! -f frontend/.env.development ]; then
cp -n .env-template frontend/.env.development || true # Assuming .env-template is in the root
fi
# Determine VITE_API_HOST based on environment
if [ -n "$CODESPACES" ]; then
# Running in Codespaces
CODESPACE_NAME=$(echo "$CODESPACES" | cut -d'-' -f1) # Extract codespace name
PUBLIC_API_HOST="https://${CODESPACE_NAME}-7091.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
echo "Setting VITE_API_HOST for Codespaces: $PUBLIC_API_HOST in frontend/.env.development"
sed -i "s|VITE_API_HOST=.*|VITE_API_HOST=$PUBLIC_API_HOST|" frontend/.env.development
else
# Not running in Codespaces (local devcontainer)
DEFAULT_API_HOST="http://localhost:7091"
echo "Setting VITE_API_HOST for local dev: $DEFAULT_API_HOST in frontend/.env.development"
sed -i "s|VITE_API_HOST=.*|VITE_API_HOST=$DEFAULT_API_HOST|" frontend/.env.development
fi
mkdir -p model
if [ ! -d model/all-mpnet-base-v2 ]; then
wget -q https://d3dg1063dc54p9.cloudfront.net/models/embeddings/mpnet-base-v2.zip -O model/mpnet-base-v2.zip
unzip -q model/mpnet-base-v2.zip -d model
rm model/mpnet-base-v2.zip
fi
pip install -r application/requirements.txt
cd frontend
npm install --include=dev

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: arc53

View File

@@ -8,12 +8,12 @@ updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/application" # Location of package manifests
schedule:
interval: "weekly"
interval: "daily"
- package-ecosystem: "npm" # See documentation for possible values
directory: "/frontend" # Location of package manifests
schedule:
interval: "weekly"
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"

40
.github/workflows/bandit.yaml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Bandit Security Scan
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
bandit_scan:
if: ${{ github.repository == 'arc53/DocsGPT' }}
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit # Bandit is needed for this action
if [ -f application/requirements.txt ]; then pip install -r application/requirements.txt; fi
- name: Run Bandit scan
uses: PyCQA/bandit-action@v1
with:
severity: medium
confidence: medium
targets: application/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -5,20 +5,33 @@ on:
types: [published]
jobs:
deploy:
build:
if: github.repository == 'arc53/DocsGPT'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
- name: Set up QEMU # Only needed for emulation, not for native arm64 builds
if: matrix.platform == 'linux/arm64'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
@@ -33,15 +46,67 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images to docker.io and ghcr.io
- name: Build and push platform-specific images
uses: docker/build-push-action@v6
with:
file: './application/Dockerfile'
platforms: linux/amd64
platforms: ${{ matrix.platform }}
context: ./application
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }},${{ secrets.DOCKER_USERNAME }}/docsgpt:latest
ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository_owner }}/docsgpt:latest
${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-${{ matrix.suffix }}
ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-${{ matrix.suffix }}
provenance: false
sbom: false
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt:latest
cache-to: type=inline
manifest:
if: github.repository == 'arc53/DocsGPT'
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push manifest for DockerHub
run: |
set -e
docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }} \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-arm64
docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}
docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt:latest \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:${{ github.event.release.tag_name }}-arm64
docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt:latest
- name: Create and push manifest for ghcr.io
run: |
set -e
docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }} \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}
docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt:latest \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-amd64 \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt:${{ github.event.release.tag_name }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt:latest

View File

@@ -5,20 +5,33 @@ on:
types: [published]
jobs:
deploy:
build:
if: github.repository == 'arc53/DocsGPT'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
- name: Set up QEMU # Only needed for emulation, not for native arm64 builds
if: matrix.platform == 'linux/arm64'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
@@ -33,16 +46,67 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Runs a single command using the runners shell
- name: Build and push Docker images to docker.io and ghcr.io
- name: Build and push platform-specific images
uses: docker/build-push-action@v6
with:
file: './frontend/Dockerfile'
platforms: linux/amd64, linux/arm64
platforms: ${{ matrix.platform }}
context: ./frontend
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }},${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest
ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository_owner }}/docsgpt-fe:latest
${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-${{ matrix.suffix }}
ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-${{ matrix.suffix }}
provenance: false
sbom: false
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest
cache-to: type=inline
manifest:
if: github.repository == 'arc53/DocsGPT'
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push manifest for DockerHub
run: |
set -e
docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }} \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64
docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}
docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64
docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:latest
- name: Create and push manifest for ghcr.io
run: |
set -e
docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }} \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}
docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:latest \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-amd64 \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:${{ github.event.release.tag_name }}-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:latest

View File

@@ -1,4 +1,4 @@
name: Build and push DocsGPT Docker image for development
name: Build and push multi-arch DocsGPT Docker image
on:
workflow_dispatch:
@@ -7,27 +7,36 @@ on:
- main
jobs:
deploy:
build:
if: github.repository == 'arc53/DocsGPT'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
@@ -35,15 +44,57 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images to docker.io and ghcr.io
- name: Build and push platform-specific images
uses: docker/build-push-action@v6
with:
file: './application/Dockerfile'
platforms: linux/amd64
platforms: ${{ matrix.platform }}
context: ./application
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/docsgpt:develop
ghcr.io/${{ github.repository_owner }}/docsgpt:develop
${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-${{ matrix.suffix }}
ghcr.io/${{ github.repository_owner }}/docsgpt:develop-${{ matrix.suffix }}
provenance: false
sbom: false
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt:develop
cache-to: type=inline
manifest:
if: github.repository == 'arc53/DocsGPT'
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push manifest for DockerHub
run: |
docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-amd64 \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop-arm64
docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt:develop
- name: Create and push manifest for ghcr.io
run: |
docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt:develop \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt:develop-amd64 \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt:develop-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt:develop

View File

@@ -7,20 +7,33 @@ on:
- main
jobs:
deploy:
build:
if: github.repository == 'arc53/DocsGPT'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
- name: Set up QEMU # Only needed for emulation, not for native arm64 builds
if: matrix.platform == 'linux/arm64'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
@@ -35,15 +48,57 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images to docker.io and ghcr.io
- name: Build and push platform-specific images
uses: docker/build-push-action@v6
with:
file: './frontend/Dockerfile'
platforms: linux/amd64
platforms: ${{ matrix.platform }}
context: ./frontend
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop
ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop
${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-${{ matrix.suffix }}
ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-${{ matrix.suffix }}
provenance: false
sbom: false
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop
cache-to: type=inline
manifest:
if: github.repository == 'arc53/DocsGPT'
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push manifest for DockerHub
run: |
docker manifest create ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-amd64 \
--amend ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop-arm64
docker manifest push ${{ secrets.DOCKER_USERNAME }}/docsgpt-fe:develop
- name: Create and push manifest for ghcr.io
run: |
docker manifest create ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-amd64 \
--amend ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop-arm64
docker manifest push ghcr.io/${{ github.repository_owner }}/docsgpt-fe:develop

View File

@@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
@@ -23,8 +23,8 @@ jobs:
run: |
python -m pytest --cov=application --cov-report=xml
- name: Upload coverage reports to Codecov
if: github.event_name == 'pull_request' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
if: github.event_name == 'pull_request' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

1
.gitignore vendored
View File

@@ -113,6 +113,7 @@ venv.bak/
# Spyder project settings
.spyderproject
.spyproject
.jwt_secret_key
# Rope project settings
.ropeproject

38
.vscode/launch.json vendored
View File

@@ -11,6 +11,44 @@
"skipFiles": [
"<node_internals>/**"
]
},
{
"name": "Flask Debugger",
"type": "debugpy",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "application/app.py",
"PYTHONPATH": "${workspaceFolder}",
"FLASK_ENV": "development",
"FLASK_DEBUG": "1",
"FLASK_RUN_PORT": "7091",
"FLASK_RUN_HOST": "0.0.0.0"
},
"args": [
"run",
"--no-debugger"
],
"cwd": "${workspaceFolder}",
},
{
"name": "Celery Debugger",
"type": "debugpy",
"request": "launch",
"module": "celery",
"env": {
"PYTHONPATH": "${workspaceFolder}",
},
"args": [
"-A",
"application.app.celery",
"worker",
"-l",
"INFO",
"--pool=solo"
],
"cwd": "${workspaceFolder}"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -27,6 +27,7 @@ Before creating issues, please check out how the latest version of our app looks
### 👨‍💻 If you're interested in contributing code, here are some important things to know:
For instructions on setting up a development environment, please refer to our [Development Deployment Guide](https://docs.docsgpt.cloud/Deploying/Development-Environment).
Tech Stack Overview:
@@ -34,19 +35,40 @@ Tech Stack Overview:
- 🖥 Backend: Developed in Python 🐍
### 🌐 If you are looking to contribute to frontend (⚛React, Vite):
### 🌐 Frontend Contributions (⚛️ React, Vite)
- The current frontend is being migrated from [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) to [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) with a new design, so please contribute to the new one.
- Check out this [milestone](https://github.com/arc53/DocsGPT/milestone/1) and its issues.
- The updated Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1).
* The updated Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1). Please try to follow the guidelines.
* **Coding Style:** We follow a strict coding style enforced by ESLint and Prettier. Please ensure your code adheres to the configuration provided in our repository's `fronetend/.eslintrc.js` file. We recommend configuring your editor with ESLint and Prettier to help with this.
* **Component Structure:** Strive for small, reusable components. Favor functional components and hooks over class components where possible.
* **State Management** If you need to add stores, please use Redux.
Please try to follow the guidelines.
### 🖥 Backend Contributions (🐍 Python)
### 🖥 If you are looking to contribute to Backend (🐍 Python):
- Review our issues and contribute to [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts) (please disregard old [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py) files; these will be deprecated soon).
- Review our issues and contribute to [`/application`](https://github.com/arc53/DocsGPT/tree/main/application)
- All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder.
- Before submitting your Pull Request, ensure it can be queried after ingesting some test data.
- **Coding Style:** We adhere to the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for Python code. We use `ruff` as our linter and code formatter. Please ensure your code is formatted correctly and passes `ruff` checks before submitting.
- **Type Hinting:** Please use type hints for all function arguments and return values. This improves code readability and helps catch errors early. Example:
```python
def my_function(name: str, count: int) -> list[str]:
...
```
- **Docstrings:** All functions and classes should have docstrings explaining their purpose, parameters, and return values. We prefer the [Google style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). Example:
```python
def my_function(name: str, count: int) -> list[str]:
"""Does something with a name and a count.
Args:
name: The name to use.
count: The number of times to do it.
Returns:
A list of strings.
"""
...
```
### Testing

View File

@@ -1,41 +0,0 @@
# **🎉 Join the Hacktoberfest with DocsGPT and win a Free T-shirt and other prizes! 🎉**
Welcome, contributors! We're excited to announce that DocsGPT is participating in Hacktoberfest. Get involved by submitting meaningful pull requests.
All contributors with accepted PRs will receive a cool Holopin! 🤩 (Watch out for a reply in your PR to collect it).
### 🏆 Top 50 contributors will receive a special T-shirt
### 🏆 [LLM Document analysis by LexEU competition](https://github.com/arc53/DocsGPT/blob/main/lexeu-competition.md):
A separate competition is available for those who submit new retrieval / workflow method that will analyze a Document using EU laws.
With 200$, 100$, 50$ prize for 1st, 2nd and 3rd place respectively.
You can find more information [here](https://github.com/arc53/DocsGPT/blob/main/lexeu-competition.md)
## 📜 Here's How to Contribute:
```text
🛠️ Code: This is the golden ticket! Make meaningful contributions through PRs.
🧩 API extension: Build an app utilising DocsGPT API. We prefer submissions that showcase original ideas and turn the API into an AI agent.
They can be a completely separate repos.
For example:
https://github.com/arc53/tg-bot-docsgpt-extenstion or
https://github.com/arc53/DocsGPT-cli
Non-Code Contributions:
📚 Wiki: Improve our documentation, create a guide or change existing documentation.
🖥️ Design: Improve the UI/UX or design a new feature.
📝 Blogging or Content Creation: Write articles or create videos to showcase DocsGPT or highlight your contributions!
```
### 📝 Guidelines for Pull Requests:
- Familiarize yourself with the current contributions and our [Roadmap](https://github.com/orgs/arc53/projects/2).
- Before contributing we highly advise that you check existing [issues](https://github.com/arc53/DocsGPT/issues) or [create](https://github.com/arc53/DocsGPT/issues/new/choose) an issue and wait to get assigned.
- Once you are finished with your contribution, please fill in this [form](https://airtable.com/appikMaJwdHhC1SDP/pagoblCJ9W29wf6Hf/form).
- Refer to the [Documentation](https://docs.docsgpt.cloud/).
- Feel free to join our [Discord](https://discord.gg/n5BX8dh8rU) server. We're here to help newcomers, so don't hesitate to jump in! Join us [here](https://discord.gg/n5BX8dh8rU).
Thank you very much for considering contributing to DocsGPT during Hacktoberfest! 🙏 Your contributions (not just simple typos) could earn you a stylish new t-shirt and other prizes as a token of our appreciation. 🎁 Join us, and let's code together! 🚀

219
README.md
View File

@@ -3,13 +3,11 @@
</h1>
<p align="center">
<strong>Open-Source Documentation Assistant</strong>
<strong>Open-Source RAG Assistant</strong>
</p>
<p align="left">
<strong><a href="https://www.docsgpt.cloud/">DocsGPT</a></strong> is a cutting-edge open-source solution that streamlines the process of finding information in the project documentation. With its integration of the powerful <strong>GPT</strong> models, developers can easily ask questions about a project and receive accurate answers.
Say goodbye to time-consuming manual searches, and let <strong><a href="https://www.docsgpt.cloud/">DocsGPT</a></strong> help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.
<strong><a href="https://www.docsgpt.cloud/">DocsGPT</a></strong> is an open-source genAI tool that helps users get reliable answers from any knowledge source, while avoiding hallucinations. It enables quick and reliable information retrieval, with tooling and agentic system capability built in.
</p>
<div align="center">
@@ -17,180 +15,131 @@ Say goodbye to time-consuming manual searches, and let <strong><a href="https://
<a href="https://github.com/arc53/DocsGPT">![link to main GitHub showing Stars number](https://img.shields.io/github/stars/arc53/docsgpt?style=social)</a>
<a href="https://github.com/arc53/DocsGPT">![link to main GitHub showing Forks number](https://img.shields.io/github/forks/arc53/docsgpt?style=social)</a>
<a href="https://github.com/arc53/DocsGPT/blob/main/LICENSE">![link to license file](https://img.shields.io/github/license/arc53/docsgpt)</a>
<a href="https://www.bestpractices.dev/projects/9907"><img src="https://www.bestpractices.dev/projects/9907/badge"></a>
<a href="https://discord.gg/n5BX8dh8rU">![link to discord](https://img.shields.io/discord/1070046503302877216)</a>
<a href="https://twitter.com/docsgptai">![X (formerly Twitter) URL](https://img.shields.io/twitter/follow/docsgptai)</a>
<a href="https://docs.docsgpt.cloud/quickstart">⚡️ Quickstart</a><a href="https://app.docsgpt.cloud/">☁️ Cloud Version</a><a href="https://discord.gg/n5BX8dh8rU">💬 Discord</a>
<br>
<a href="https://docs.docsgpt.cloud/">📖 Documentation</a><a href="https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md">👫 Contribute</a><a href="https://blog.docsgpt.cloud/">🗞 Blog</a>
<br>
</div>
<div align="center">
<img src="https://d3dg1063dc54p9.cloudfront.net/videos/demov7.gif" alt="video-example-of-docs-gpt" width="800" height="450">
</div>
<h3 align="left">
<strong>Key Features:</strong>
</h3>
<ul align="left">
<li><strong>🗂️ Wide Format Support:</strong> Reads PDF, DOCX, CSV, XLSX, EPUB, MD, RST, HTML, MDX, JSON, PPTX, and images.</li>
<li><strong>🌐 Web & Data Integration:</strong> Ingests from URLs, sitemaps, Reddit, GitHub and web crawlers.</li>
<li><strong>✅ Reliable Answers:</strong> Get accurate, hallucination-free responses with source citations viewable in a clean UI.</li>
<li><strong>🔑 Streamlined API Keys:</strong> Generate keys linked to your settings, documents, and models, simplifying chatbot and integration setup.</li>
<li><strong>🔗 Actionable Tooling:</strong> Connect to APIs, tools, and other services to enable LLM actions.</li>
<li><strong>🧩 Pre-built Integrations:</strong> Use readily available HTML/React chat widgets, search tools, Discord/Telegram bots, and more.</li>
<li><strong>🔌 Flexible Deployment:</strong> Works with major LLMs (OpenAI, Google, Anthropic) and local models (Ollama, llama_cpp).</li>
<li><strong>🏢 Secure & Scalable:</strong> Run privately and securely with Kubernetes support, designed for enterprise-grade reliability.</li>
</ul>
## Roadmap
- [x] Full GoogleAI compatibility (Jan 2025)
- [x] Add tools (Jan 2025)
- [x] Manually updating chunks in the app UI (Feb 2025)
- [x] Devcontainer for easy development (Feb 2025)
- [x] ReACT agent (March 2025)
- [x] Chatbots menu re-design to handle tools, agent types, and more (April 2025)
- [x] New input box in the conversation menu (April 2025)
- [x] Add triggerable actions / tools (webhook) (April 2025)
- [ ] Anthropic Tool compatibility (May 2025)
- [ ] Add OAuth 2.0 authentication for tools and sources
- [ ] Agent scheduling
You can find our full roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT!
### Production Support / Help for Companies:
We're eager to provide personalized assistance when deploying your DocsGPT to a live environment.
<a href ="https://cal.com/arc53/docsgpt-demo-b2b">
<img alt="Let's chat" src="https://cal.com/book-with-cal-dark.svg" />
</a>
[Get a Demo :wave:](https://www.docsgpt.cloud/contact)
[Send Email :email:](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions)
[Send Email :email:](mailto:support@docsgpt.cloud?subject=DocsGPT%20support%2Fsolutions)
## Join the Lighthouse Program 🌟
<img src="https://github.com/user-attachments/assets/9a1f21de-7a15-4e42-9424-70d22ba5a913" alt="video-example-of-docs-gpt" width="1000" height="500">
Calling all developers and GenAI innovators! The **DocsGPT Lighthouse Program** connects technical leaders actively deploying or extending DocsGPT in real-world scenarios. Collaborate directly with our team to shape the roadmap, access priority support, and build enterprise-ready solutions with exclusive community insights.
## Roadmap
[Learn More & Apply →](https://docs.google.com/forms/d/1KAADiJinUJ8EMQyfTXUIGyFbqINNClNR3jBNWq7DgTE)
You can find our roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT!
## Our Open-Source Models Optimized for DocsGPT:
| Name | Base Model | Requirements (or similar) |
| --------------------------------------------------------------------- | ----------- | ------------------------- |
| [Docsgpt-7b-mistral](https://huggingface.co/Arc53/docsgpt-7b-mistral) | Mistral-7b | 1xA10G gpu |
| [Docsgpt-14b](https://huggingface.co/Arc53/docsgpt-14b) | llama-2-14b | 2xA10 gpu's |
| [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's |
If you don't have enough resources to run it, you can use bitsnbytes to quantize.
## End to End AI Framework for Information Retrieval
![Architecture chart](https://github.com/user-attachments/assets/fc6a7841-ddfc-45e6-b5a0-d05fe648cbe2)
## Useful Links
- :mag: :fire: [Cloud Version](https://app.docsgpt.cloud/)
- :speech_balloon: :tada: [Join our Discord](https://discord.gg/n5BX8dh8rU)
- :books: :sunglasses: [Guides](https://docs.docsgpt.cloud/)
- :couple: [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md)
- :file_folder: :rocket: [How to use any other documentation](https://docs.docsgpt.cloud/Guides/How-to-train-on-other-documentation)
- :house: :closed_lock_with_key: [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.cloud/Guides/How-to-use-different-LLM)
## Project Structure
- Application - Flask app (main application).
- Extensions - Chrome extension.
- Scripts - Script that creates similarity search index for other libraries.
- Frontend - Frontend uses <a href="https://vitejs.dev/">Vite</a> and <a href="https://react.dev/">React</a>.
## QuickStart
> [!Note]
> Make sure you have [Docker](https://docs.docker.com/engine/install/) installed
On Mac OS or Linux, write:
A more detailed [Quickstart](https://docs.docsgpt.cloud/quickstart) is available in our documentation
`./setup.sh`
1. **Clone the repository:**
It will install all the dependencies and allow you to download the local model, use OpenAI or use our LLM API.
Otherwise, refer to this Guide for Windows:
1. Download and open this repository with `git clone https://github.com/arc53/DocsGPT.git`
2. Create a `.env` file in your root directory and set the env variables and `VITE_API_STREAMING` to true or false, depending on whether you want streaming answers or not.
It should look like this inside:
```
LLM_NAME=[docsgpt or openai or others]
VITE_API_STREAMING=true
API_KEY=[if LLM_NAME is openai]
```bash
git clone https://github.com/arc53/DocsGPT.git
cd DocsGPT
```
See optional environment variables in the [/.env-template](https://github.com/arc53/DocsGPT/blob/main/.env-template) and [/application/.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) files.
**For macOS and Linux:**
3. Run [./run-with-docker-compose.sh](https://github.com/arc53/DocsGPT/blob/main/run-with-docker-compose.sh).
4. Navigate to http://localhost:5173/.
2. **Run the setup script:**
To stop, just run `Ctrl + C`.
```bash
./setup.sh
```
## Development Environments
**For Windows:**
### Spin up Mongo and Redis
2. **Run the PowerShell setup script:**
For development, only two containers are used from [docker-compose.yaml](https://github.com/arc53/DocsGPT/blob/main/docker-compose.yaml) (by deleting all services except for Redis and Mongo).
See file [docker-compose-dev.yaml](./docker-compose-dev.yaml).
```powershell
PowerShell -ExecutionPolicy Bypass -File .\setup.ps1
```
Run
Either script will guide you through setting up DocsGPT. Four options available: using the public API, running locally, connecting to a local inference engine, or using a cloud API provider. Scripts will automatically configure your `.env` file and handle necessary downloads and installations based on your chosen option.
**Navigate to http://localhost:5173/**
To stop DocsGPT, open a terminal in the `DocsGPT` directory and run:
```bash
docker compose -f deployment/docker-compose.yaml down
```
docker compose -f docker-compose-dev.yaml build
docker compose -f docker-compose-dev.yaml up -d
```
### Run the Backend
(or use the specific `docker compose down` command shown after running the setup script).
> [!Note]
> Make sure you have Python 3.10 or 3.11 installed.
1. Export required environment variables or prepare a `.env` file in the project folder:
- Copy [.env-template](https://github.com/arc53/DocsGPT/blob/main/application/.env-template) and create `.env`.
(check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.)
2. (optional) Create a Python virtual environment:
You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments.
a) On Mac OS and Linux
```commandline
python -m venv venv
. venv/bin/activate
```
b) On Windows
```commandline
python -m venv venv
venv/Scripts/activate
```
3. Download embedding model and save it in the `model/` folder:
You can use the script below, or download it manually from [here](https://d3dg1063dc54p9.cloudfront.net/models/embeddings/mpnet-base-v2.zip), unzip it and save it in the `model/` folder.
```commandline
wget https://d3dg1063dc54p9.cloudfront.net/models/embeddings/mpnet-base-v2.zip
unzip mpnet-base-v2.zip -d model
rm mpnet-base-v2.zip
```
4. Install dependencies for the backend:
```commandline
pip install -r application/requirements.txt
```
5. Run the app using `flask --app application/app.py run --host=0.0.0.0 --port=7091`.
6. Start worker with `celery -A application.app.celery worker -l INFO`.
### Start Frontend
> [!Note]
> Make sure you have Node version 16 or higher.
1. Navigate to the [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder.
2. Install the required packages `husky` and `vite` (ignore if already installed).
```commandline
npm install husky -g
npm install vite -g
```
3. Install dependencies by running `npm install --include=dev`.
4. Run the app using `npm run dev`.
> For development environment setup instructions, please refer to the [Development Environment Guide](https://docs.docsgpt.cloud/Deploying/Development-Environment).
## Contributing
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests.
## Architecture
![Architecture chart](https://github.com/user-attachments/assets/fc6a7841-ddfc-45e6-b5a0-d05fe648cbe2)
## Project Structure
- Application - Flask app (main application).
- Extensions - Extensions, like react widget or discord bot.
- Frontend - Frontend uses <a href="https://vitejs.dev/">Vite</a> and <a href="https://react.dev/">React</a>.
- Scripts - Miscellaneous scripts.
## Code Of Conduct
We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing.
## Many Thanks To Our Contributors⚡
<a href="https://github.com/arc53/DocsGPT/graphs/contributors" alt="View Contributors">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -6,21 +6,20 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
# Install necessary packages and Python
apt-get update && \
apt-get install -y --no-install-recommends gcc wget unzip libc6-dev python3.11 python3.11-distutils python3.11-venv && \
apt-get install -y --no-install-recommends gcc wget unzip libc6-dev python3.12 python3.12-venv && \
rm -rf /var/lib/apt/lists/*
# Verify Python installation and setup symlink
RUN if [ -f /usr/bin/python3.11 ]; then \
ln -s /usr/bin/python3.11 /usr/bin/python; \
RUN if [ -f /usr/bin/python3.12 ]; then \
ln -s /usr/bin/python3.12 /usr/bin/python; \
else \
echo "Python 3.11 not found"; exit 1; \
echo "Python 3.12 not found"; exit 1; \
fi
# Download and unzip the model
RUN wget https://d3dg1063dc54p9.cloudfront.net/models/embeddings/mpnet-base-v2.zip && \
unzip mpnet-base-v2.zip -d model && \
unzip mpnet-base-v2.zip -d models && \
rm mpnet-base-v2.zip
# Install Rust
@@ -33,7 +32,7 @@ RUN apt-get remove --purge -y wget unzip && apt-get autoremove -y && rm -rf /var
COPY requirements.txt .
# Setup Python virtual environment
RUN python3.11 -m venv /venv
RUN python3.12 -m venv /venv
# Activate virtual environment and install Python packages
ENV PATH="/venv/bin:$PATH"
@@ -49,9 +48,8 @@ FROM ubuntu:24.04 as final
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
# Install Python
apt-get update && apt-get install -y --no-install-recommends python3.11 && \
ln -s /usr/bin/python3.11 /usr/bin/python && \
apt-get update && apt-get install -y --no-install-recommends python3.12 && \
ln -s /usr/bin/python3.12 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
# Set working directory
@@ -63,7 +61,8 @@ RUN groupadd -r appuser && \
# Copy the virtual environment and model from the builder stage
COPY --from=builder /venv /venv
COPY --from=builder /model /app/model
COPY --from=builder /models /app/models
# Copy your application code
COPY . /app/application
@@ -85,4 +84,4 @@ EXPOSE 7091
USER appuser
# Start Gunicorn
CMD ["gunicorn", "-w", "2", "--timeout", "120", "--bind", "0.0.0.0:7091", "application.wsgi:app"]
CMD ["gunicorn", "-w", "1", "--timeout", "120", "--bind", "0.0.0.0:7091", "--preload", "application.wsgi:app"]

View File

@@ -0,0 +1,16 @@
from application.agents.classic_agent import ClassicAgent
from application.agents.react_agent import ReActAgent
class AgentCreator:
agents = {
"classic": ClassicAgent,
"react": ReActAgent,
}
@classmethod
def create_agent(cls, type, *args, **kwargs):
agent_class = cls.agents.get(type.lower())
if not agent_class:
raise ValueError(f"No agent class found for type {type}")
return agent_class(*args, **kwargs)

277
application/agents/base.py Normal file
View File

@@ -0,0 +1,277 @@
import uuid
from abc import ABC, abstractmethod
from typing import Dict, Generator, List, Optional
from application.agents.llm_handler import get_llm_handler
from application.agents.tools.tool_action_parser import ToolActionParser
from application.agents.tools.tool_manager import ToolManager
from application.core.mongo_db import MongoDB
from application.llm.llm_creator import LLMCreator
from application.logging import build_stack_data, log_activity, LogContext
from application.retriever.base import BaseRetriever
from application.core.settings import settings
from bson.objectid import ObjectId
class BaseAgent(ABC):
def __init__(
self,
endpoint: str,
llm_name: str,
gpt_model: str,
api_key: str,
user_api_key: Optional[str] = None,
prompt: str = "",
chat_history: Optional[List[Dict]] = None,
decoded_token: Optional[Dict] = None,
attachments: Optional[List[Dict]] = None,
):
self.endpoint = endpoint
self.llm_name = llm_name
self.gpt_model = gpt_model
self.api_key = api_key
self.user_api_key = user_api_key
self.prompt = prompt
self.decoded_token = decoded_token or {}
self.user: str = decoded_token.get("sub")
self.tool_config: Dict = {}
self.tools: List[Dict] = []
self.tool_calls: List[Dict] = []
self.chat_history: List[Dict] = chat_history if chat_history is not None else []
self.llm = LLMCreator.create_llm(
llm_name,
api_key=api_key,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
self.llm_handler = get_llm_handler(llm_name)
self.attachments = attachments or []
@log_activity()
def gen(
self, query: str, retriever: BaseRetriever, log_context: LogContext = None
) -> Generator[Dict, None, None]:
yield from self._gen_inner(query, retriever, log_context)
@abstractmethod
def _gen_inner(
self, query: str, retriever: BaseRetriever, log_context: LogContext
) -> Generator[Dict, None, None]:
pass
def _get_tools(self, api_key: str = None) -> Dict[str, Dict]:
mongo = MongoDB.get_client()
db = mongo[settings.MONGO_DB_NAME]
agents_collection = db["agents"]
tools_collection = db["user_tools"]
agent_data = agents_collection.find_one({"key": api_key or self.user_api_key})
tool_ids = agent_data.get("tools", []) if agent_data else []
tools = (
tools_collection.find(
{"_id": {"$in": [ObjectId(tool_id) for tool_id in tool_ids]}}
)
if tool_ids
else []
)
tools = list(tools)
tools_by_id = {str(tool["_id"]): tool for tool in tools} if tools else {}
return tools_by_id
def _get_user_tools(self, user="local"):
mongo = MongoDB.get_client()
db = mongo[settings.MONGO_DB_NAME]
user_tools_collection = db["user_tools"]
user_tools = user_tools_collection.find({"user": user, "status": True})
user_tools = list(user_tools)
tools_by_id = {str(tool["_id"]): tool for tool in user_tools}
return tools_by_id
def _build_tool_parameters(self, action):
params = {"type": "object", "properties": {}, "required": []}
for param_type in ["query_params", "headers", "body", "parameters"]:
if param_type in action and action[param_type].get("properties"):
for k, v in action[param_type]["properties"].items():
if v.get("filled_by_llm", True):
params["properties"][k] = {
key: value
for key, value in v.items()
if key != "filled_by_llm" and key != "value"
}
params["required"].append(k)
return params
def _prepare_tools(self, tools_dict):
self.tools = [
{
"type": "function",
"function": {
"name": f"{action['name']}_{tool_id}",
"description": action["description"],
"parameters": self._build_tool_parameters(action),
},
}
for tool_id, tool in tools_dict.items()
if (
(tool["name"] == "api_tool" and "actions" in tool.get("config", {}))
or (tool["name"] != "api_tool" and "actions" in tool)
)
for action in (
tool["config"]["actions"].values()
if tool["name"] == "api_tool"
else tool["actions"]
)
if action.get("active", True)
]
def _execute_tool_action(self, tools_dict, call):
parser = ToolActionParser(self.llm.__class__.__name__)
tool_id, action_name, call_args = parser.parse_args(call)
tool_data = tools_dict[tool_id]
action_data = (
tool_data["config"]["actions"][action_name]
if tool_data["name"] == "api_tool"
else next(
action
for action in tool_data["actions"]
if action["name"] == action_name
)
)
query_params, headers, body, parameters = {}, {}, {}, {}
param_types = {
"query_params": query_params,
"headers": headers,
"body": body,
"parameters": parameters,
}
for param_type, target_dict in param_types.items():
if param_type in action_data and action_data[param_type].get("properties"):
for param, details in action_data[param_type]["properties"].items():
if param not in call_args and "value" in details:
target_dict[param] = details["value"]
for param, value in call_args.items():
for param_type, target_dict in param_types.items():
if param_type in action_data and param in action_data[param_type].get(
"properties", {}
):
target_dict[param] = value
tm = ToolManager(config={})
tool = tm.load_tool(
tool_data["name"],
tool_config=(
{
"url": tool_data["config"]["actions"][action_name]["url"],
"method": tool_data["config"]["actions"][action_name]["method"],
"headers": headers,
"query_params": query_params,
}
if tool_data["name"] == "api_tool"
else tool_data["config"]
),
)
if tool_data["name"] == "api_tool":
print(
f"Executing api: {action_name} with query_params: {query_params}, headers: {headers}, body: {body}"
)
result = tool.execute_action(action_name, **body)
else:
print(f"Executing tool: {action_name} with args: {call_args}")
result = tool.execute_action(action_name, **parameters)
call_id = getattr(call, "id", None)
tool_call_data = {
"tool_name": tool_data["name"],
"call_id": call_id if call_id is not None else "None",
"action_name": f"{action_name}_{tool_id}",
"arguments": call_args,
"result": result,
}
self.tool_calls.append(tool_call_data)
return result, call_id
def _build_messages(
self,
system_prompt: str,
query: str,
retrieved_data: List[Dict],
) -> List[Dict]:
docs_together = "\n".join([doc["text"] for doc in retrieved_data])
p_chat_combine = system_prompt.replace("{summaries}", docs_together)
messages_combine = [{"role": "system", "content": p_chat_combine}]
for i in self.chat_history:
if "prompt" in i and "response" in i:
messages_combine.append({"role": "user", "content": i["prompt"]})
messages_combine.append({"role": "assistant", "content": i["response"]})
if "tool_calls" in i:
for tool_call in i["tool_calls"]:
call_id = tool_call.get("call_id") or str(uuid.uuid4())
function_call_dict = {
"function_call": {
"name": tool_call.get("action_name"),
"args": tool_call.get("arguments"),
"call_id": call_id,
}
}
function_response_dict = {
"function_response": {
"name": tool_call.get("action_name"),
"response": {"result": tool_call.get("result")},
"call_id": call_id,
}
}
messages_combine.append(
{"role": "assistant", "content": [function_call_dict]}
)
messages_combine.append(
{"role": "tool", "content": [function_response_dict]}
)
messages_combine.append({"role": "user", "content": query})
return messages_combine
def _retriever_search(
self,
retriever: BaseRetriever,
query: str,
log_context: Optional[LogContext] = None,
) -> List[Dict]:
retrieved_data = retriever.search(query)
if log_context:
data = build_stack_data(retriever, exclude_attributes=["llm"])
log_context.stacks.append({"component": "retriever", "data": data})
return retrieved_data
def _llm_gen(self, messages: List[Dict], log_context: Optional[LogContext] = None):
resp = self.llm.gen_stream(
model=self.gpt_model, messages=messages, tools=self.tools
)
if log_context:
data = build_stack_data(self.llm, exclude_attributes=["client"])
log_context.stacks.append({"component": "llm", "data": data})
return resp
def _llm_handler(
self,
resp,
tools_dict: Dict,
messages: List[Dict],
log_context: Optional[LogContext] = None,
attachments: Optional[List[Dict]] = None,
):
resp = self.llm_handler.handle_response(
self, resp, tools_dict, messages, attachments
)
if log_context:
data = build_stack_data(self.llm_handler, exclude_attributes=["tool_calls"])
log_context.stacks.append({"component": "llm_handler", "data": data})
return resp

View File

@@ -0,0 +1,64 @@
from typing import Dict, Generator
from application.agents.base import BaseAgent
from application.logging import LogContext
from application.retriever.base import BaseRetriever
import logging
logger = logging.getLogger(__name__)
class ClassicAgent(BaseAgent):
def _gen_inner(
self, query: str, retriever: BaseRetriever, log_context: LogContext
) -> Generator[Dict, None, None]:
retrieved_data = self._retriever_search(retriever, query, log_context)
if self.user_api_key:
tools_dict = self._get_tools(self.user_api_key)
else:
tools_dict = self._get_user_tools(self.user)
self._prepare_tools(tools_dict)
messages = self._build_messages(self.prompt, query, retrieved_data)
resp = self._llm_gen(messages, log_context)
attachments = self.attachments
if isinstance(resp, str):
yield {"answer": resp}
return
if (
hasattr(resp, "message")
and hasattr(resp.message, "content")
and resp.message.content is not None
):
yield {"answer": resp.message.content}
return
resp = self._llm_handler(resp, tools_dict, messages, log_context, attachments)
if isinstance(resp, str):
yield {"answer": resp}
elif (
hasattr(resp, "message")
and hasattr(resp.message, "content")
and resp.message.content is not None
):
yield {"answer": resp.message.content}
else:
for line in resp:
if isinstance(line, str):
yield {"answer": line}
log_context.stacks.append(
{"component": "agent", "data": {"tool_calls": self.tool_calls.copy()}}
)
yield {"sources": retrieved_data}
# clean tool_call_data only send first 50 characters of tool_call['result']
for tool_call in self.tool_calls:
if len(str(tool_call["result"])) > 50:
tool_call["result"] = str(tool_call["result"])[:50] + "..."
yield {"tool_calls": self.tool_calls.copy()}

View File

@@ -0,0 +1,351 @@
import json
import logging
from abc import ABC, abstractmethod
from application.logging import build_stack_data
logger = logging.getLogger(__name__)
class LLMHandler(ABC):
def __init__(self):
self.llm_calls = []
self.tool_calls = []
@abstractmethod
def handle_response(self, agent, resp, tools_dict, messages, attachments=None, **kwargs):
pass
def prepare_messages_with_attachments(self, agent, messages, attachments=None):
"""
Prepare messages with attachment content if available.
Args:
agent: The current agent instance.
messages (list): List of message dictionaries.
attachments (list): List of attachment dictionaries with content.
Returns:
list: Messages with attachment context added to the system prompt.
"""
if not attachments:
return messages
logger.info(f"Preparing messages with {len(attachments)} attachments")
supported_types = agent.llm.get_supported_attachment_types()
supported_attachments = []
unsupported_attachments = []
for attachment in attachments:
mime_type = attachment.get('mime_type')
if mime_type in supported_types:
supported_attachments.append(attachment)
else:
unsupported_attachments.append(attachment)
# Process supported attachments with the LLM's custom method
prepared_messages = messages
if supported_attachments:
logger.info(f"Processing {len(supported_attachments)} supported attachments with {agent.llm.__class__.__name__}'s method")
prepared_messages = agent.llm.prepare_messages_with_attachments(messages, supported_attachments)
# Process unsupported attachments with the default method
if unsupported_attachments:
logger.info(f"Processing {len(unsupported_attachments)} unsupported attachments with default method")
prepared_messages = self._append_attachment_content_to_system(prepared_messages, unsupported_attachments)
return prepared_messages
def _append_attachment_content_to_system(self, messages, attachments):
"""
Default method to append attachment content to the system prompt.
Args:
messages (list): List of message dictionaries.
attachments (list): List of attachment dictionaries with content.
Returns:
list: Messages with attachment context added to the system prompt.
"""
prepared_messages = messages.copy()
attachment_texts = []
for attachment in attachments:
logger.info(f"Adding attachment {attachment.get('id')} to context")
if 'content' in attachment:
attachment_texts.append(f"Attached file content:\n\n{attachment['content']}")
if attachment_texts:
combined_attachment_text = "\n\n".join(attachment_texts)
system_found = False
for i in range(len(prepared_messages)):
if prepared_messages[i].get("role") == "system":
prepared_messages[i]["content"] += f"\n\n{combined_attachment_text}"
system_found = True
break
if not system_found:
prepared_messages.insert(0, {"role": "system", "content": combined_attachment_text})
return prepared_messages
class OpenAILLMHandler(LLMHandler):
def handle_response(self, agent, resp, tools_dict, messages, attachments=None, stream: bool = True):
messages = self.prepare_messages_with_attachments(agent, messages, attachments)
logger.info(f"Messages with attachments: {messages}")
if not stream:
while hasattr(resp, "finish_reason") and resp.finish_reason == "tool_calls":
message = json.loads(resp.model_dump_json())["message"]
keys_to_remove = {"audio", "function_call", "refusal"}
filtered_data = {
k: v for k, v in message.items() if k not in keys_to_remove
}
messages.append(filtered_data)
tool_calls = resp.message.tool_calls
for call in tool_calls:
try:
self.tool_calls.append(call)
tool_response, call_id = agent._execute_tool_action(
tools_dict, call
)
function_call_dict = {
"function_call": {
"name": call.function.name,
"args": call.function.arguments,
"call_id": call_id,
}
}
function_response_dict = {
"function_response": {
"name": call.function.name,
"response": {"result": tool_response},
"call_id": call_id,
}
}
messages.append(
{"role": "assistant", "content": [function_call_dict]}
)
messages.append(
{"role": "tool", "content": [function_response_dict]}
)
messages = self.prepare_messages_with_attachments(agent, messages, attachments)
except Exception as e:
logging.error(f"Error executing tool: {str(e)}", exc_info=True)
messages.append(
{
"role": "tool",
"content": f"Error executing tool: {str(e)}",
"tool_call_id": call_id,
}
)
resp = agent.llm.gen_stream(
model=agent.gpt_model, messages=messages, tools=agent.tools
)
self.llm_calls.append(build_stack_data(agent.llm))
return resp
else:
text_buffer = ""
while True:
tool_calls = {}
for chunk in resp:
if isinstance(chunk, str) and len(chunk) > 0:
yield chunk
continue
elif hasattr(chunk, "delta"):
chunk_delta = chunk.delta
if (
hasattr(chunk_delta, "tool_calls")
and chunk_delta.tool_calls is not None
):
for tool_call in chunk_delta.tool_calls:
index = tool_call.index
if index not in tool_calls:
tool_calls[index] = {
"id": "",
"function": {"name": "", "arguments": ""},
}
current = tool_calls[index]
if tool_call.id:
current["id"] = tool_call.id
if tool_call.function.name:
current["function"][
"name"
] = tool_call.function.name
if tool_call.function.arguments:
current["function"][
"arguments"
] += tool_call.function.arguments
tool_calls[index] = current
if (
hasattr(chunk, "finish_reason")
and chunk.finish_reason == "tool_calls"
):
for index in sorted(tool_calls.keys()):
call = tool_calls[index]
try:
self.tool_calls.append(call)
tool_response, call_id = agent._execute_tool_action(
tools_dict, call
)
if isinstance(call["function"]["arguments"], str):
call["function"]["arguments"] = json.loads(call["function"]["arguments"])
function_call_dict = {
"function_call": {
"name": call["function"]["name"],
"args": call["function"]["arguments"],
"call_id": call["id"],
}
}
function_response_dict = {
"function_response": {
"name": call["function"]["name"],
"response": {"result": tool_response},
"call_id": call["id"],
}
}
messages.append(
{
"role": "assistant",
"content": [function_call_dict],
}
)
messages.append(
{
"role": "tool",
"content": [function_response_dict],
}
)
except Exception as e:
logging.error(f"Error executing tool: {str(e)}", exc_info=True)
messages.append(
{
"role": "assistant",
"content": f"Error executing tool: {str(e)}",
}
)
tool_calls = {}
if hasattr(chunk_delta, "content") and chunk_delta.content:
# Add to buffer or yield immediately based on your preference
text_buffer += chunk_delta.content
yield text_buffer
text_buffer = ""
if (
hasattr(chunk, "finish_reason")
and chunk.finish_reason == "stop"
):
return resp
elif isinstance(chunk, str) and len(chunk) == 0:
continue
logger.info(f"Regenerating with messages: {messages}")
resp = agent.llm.gen_stream(
model=agent.gpt_model, messages=messages, tools=agent.tools
)
self.llm_calls.append(build_stack_data(agent.llm))
class GoogleLLMHandler(LLMHandler):
def handle_response(self, agent, resp, tools_dict, messages, attachments=None, stream: bool = True):
from google.genai import types
messages = self.prepare_messages_with_attachments(agent, messages, attachments)
while True:
if not stream:
response = agent.llm.gen(
model=agent.gpt_model, messages=messages, tools=agent.tools
)
self.llm_calls.append(build_stack_data(agent.llm))
if response.candidates and response.candidates[0].content.parts:
tool_call_found = False
for part in response.candidates[0].content.parts:
if part.function_call:
tool_call_found = True
self.tool_calls.append(part.function_call)
tool_response, call_id = agent._execute_tool_action(
tools_dict, part.function_call
)
function_response_part = types.Part.from_function_response(
name=part.function_call.name,
response={"result": tool_response},
)
messages.append(
{"role": "model", "content": [part.to_json_dict()]}
)
messages.append(
{
"role": "tool",
"content": [function_response_part.to_json_dict()],
}
)
if (
not tool_call_found
and response.candidates[0].content.parts
and response.candidates[0].content.parts[0].text
):
return response.candidates[0].content.parts[0].text
elif not tool_call_found:
return response.candidates[0].content.parts
else:
return response
else:
response = agent.llm.gen_stream(
model=agent.gpt_model, messages=messages, tools=agent.tools
)
self.llm_calls.append(build_stack_data(agent.llm))
tool_call_found = False
for result in response:
if hasattr(result, "function_call"):
tool_call_found = True
self.tool_calls.append(result.function_call)
tool_response, call_id = agent._execute_tool_action(
tools_dict, result.function_call
)
function_response_part = types.Part.from_function_response(
name=result.function_call.name,
response={"result": tool_response},
)
messages.append(
{"role": "model", "content": [result.to_json_dict()]}
)
messages.append(
{
"role": "tool",
"content": [function_response_part.to_json_dict()],
}
)
else:
tool_call_found = False
yield result
if not tool_call_found:
return response
def get_llm_handler(llm_type):
handlers = {
"openai": OpenAILLMHandler(),
"google": GoogleLLMHandler(),
}
return handlers.get(llm_type, OpenAILLMHandler())

View File

@@ -0,0 +1,229 @@
import os
from typing import Dict, Generator, List, Any
import logging
from application.agents.base import BaseAgent
from application.logging import build_stack_data, LogContext
from application.retriever.base import BaseRetriever
logger = logging.getLogger(__name__)
current_dir = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
with open(
os.path.join(current_dir, "application/prompts", "react_planning_prompt.txt"), "r"
) as f:
planning_prompt_template = f.read()
with open(
os.path.join(current_dir, "application/prompts", "react_final_prompt.txt"),
"r",
) as f:
final_prompt_template = f.read()
MAX_ITERATIONS_REASONING = 10
class ReActAgent(BaseAgent):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.plan: str = ""
self.observations: List[str] = []
def _extract_content_from_llm_response(self, resp: Any) -> str:
"""
Helper to extract string content from various LLM response types.
Handles strings, message objects (OpenAI-like), and streams.
Adapt stream handling for your specific LLM client if not OpenAI.
"""
collected_content = []
if isinstance(resp, str):
collected_content.append(resp)
elif ( # OpenAI non-streaming or Anthropic non-streaming (older SDK style)
hasattr(resp, "message")
and hasattr(resp.message, "content")
and resp.message.content is not None
):
collected_content.append(resp.message.content)
elif ( # OpenAI non-streaming (Pydantic model), Anthropic new SDK non-streaming
hasattr(resp, "choices") and resp.choices and
hasattr(resp.choices[0], "message") and
hasattr(resp.choices[0].message, "content") and
resp.choices[0].message.content is not None
):
collected_content.append(resp.choices[0].message.content) # OpenAI
elif ( # Anthropic new SDK non-streaming content block
hasattr(resp, "content") and isinstance(resp.content, list) and resp.content and
hasattr(resp.content[0], "text")
):
collected_content.append(resp.content[0].text) # Anthropic
else:
# Assume resp is a stream if not a recognized object
try:
for chunk in resp: # This will fail if resp is not iterable (e.g. a non-streaming response object)
content_piece = ""
# OpenAI-like stream
if hasattr(chunk, 'choices') and len(chunk.choices) > 0 and \
hasattr(chunk.choices[0], 'delta') and \
hasattr(chunk.choices[0].delta, 'content') and \
chunk.choices[0].delta.content is not None:
content_piece = chunk.choices[0].delta.content
# Anthropic-like stream (ContentBlockDelta)
elif hasattr(chunk, 'type') and chunk.type == 'content_block_delta' and \
hasattr(chunk, 'delta') and hasattr(chunk.delta, 'text'):
content_piece = chunk.delta.text
elif isinstance(chunk, str): # Simplest case: stream of strings
content_piece = chunk
if content_piece:
collected_content.append(content_piece)
except TypeError: # If resp is not iterable (e.g. a final response object that wasn't caught above)
logger.debug(f"Response type {type(resp)} could not be iterated as a stream. It might be a non-streaming object not handled by specific checks.")
except Exception as e:
logger.error(f"Error processing potential stream chunk: {e}, chunk was: {getattr(chunk, '__dict__', chunk)}")
return "".join(collected_content)
def _gen_inner(
self, query: str, retriever: BaseRetriever, log_context: LogContext
) -> Generator[Dict, None, None]:
# Reset state for this generation call
self.plan = ""
self.observations = []
retrieved_data = self._retriever_search(retriever, query, log_context)
if self.user_api_key:
tools_dict = self._get_tools(self.user_api_key)
else:
tools_dict = self._get_user_tools(self.user)
self._prepare_tools(tools_dict)
docs_together = "\n".join([doc["text"] for doc in retrieved_data])
iterating_reasoning = 0
while iterating_reasoning < MAX_ITERATIONS_REASONING:
iterating_reasoning += 1
# 1. Create Plan
logger.info("ReActAgent: Creating plan...")
plan_stream = self._create_plan(query, docs_together, log_context)
current_plan_parts = []
yield {"thought": f"Reasoning... (iteration {iterating_reasoning})\n\n"}
for line_chunk in plan_stream:
current_plan_parts.append(line_chunk)
yield {"thought": line_chunk}
self.plan = "".join(current_plan_parts)
if self.plan:
self.observations.append(f"Plan: {self.plan} Iteration: {iterating_reasoning}")
max_obs_len = 20000
obs_str = "\n".join(self.observations)
if len(obs_str) > max_obs_len:
obs_str = obs_str[:max_obs_len] + "\n...[observations truncated]"
execution_prompt_str = (
(self.prompt or "")
+ f"\n\nFollow this plan:\n{self.plan}"
+ f"\n\nObservations:\n{obs_str}"
+ f"\n\nIf there is enough data to complete user query '{query}', Respond with 'SATISFIED' only. Otherwise, continue. Dont Menstion 'SATISFIED' in your response if you are not ready. "
)
messages = self._build_messages(execution_prompt_str, query, retrieved_data)
resp_from_llm_gen = self._llm_gen(messages, log_context)
initial_llm_thought_content = self._extract_content_from_llm_response(resp_from_llm_gen)
if initial_llm_thought_content:
self.observations.append(f"Initial thought/response: {initial_llm_thought_content}")
else:
logger.info("ReActAgent: Initial LLM response (before handler) had no textual content (might be only tool calls).")
resp_after_handler = self._llm_handler(resp_from_llm_gen, tools_dict, messages, log_context)
for tool_call_info in self.tool_calls: # Iterate over self.tool_calls populated by _llm_handler
observation_string = (
f"Executed Action: Tool '{tool_call_info.get('tool_name', 'N/A')}' "
f"with arguments '{tool_call_info.get('arguments', '{}')}'. Result: '{str(tool_call_info.get('result', ''))[:200]}...'"
)
self.observations.append(observation_string)
content_after_handler = self._extract_content_from_llm_response(resp_after_handler)
if content_after_handler:
self.observations.append(f"Response after tool execution: {content_after_handler}")
else:
logger.info("ReActAgent: LLM response after handler had no textual content.")
if log_context:
log_context.stacks.append(
{"component": "agent_tool_calls", "data": {"tool_calls": self.tool_calls.copy()}}
)
yield {"sources": retrieved_data}
display_tool_calls = []
for tc in self.tool_calls:
cleaned_tc = tc.copy()
if len(str(cleaned_tc.get("result", ""))) > 50:
cleaned_tc["result"] = str(cleaned_tc["result"])[:50] + "..."
display_tool_calls.append(cleaned_tc)
if display_tool_calls:
yield {"tool_calls": display_tool_calls}
if "SATISFIED" in content_after_handler:
logger.info("ReActAgent: LLM satisfied with the plan and data. Stopping reasoning.")
break
# 3. Create Final Answer based on all observations
final_answer_stream = self._create_final_answer(query, self.observations, log_context)
for answer_chunk in final_answer_stream:
yield {"answer": answer_chunk}
logger.info("ReActAgent: Finished generating final answer.")
def _create_plan(
self, query: str, docs_data: str, log_context: LogContext = None
) -> Generator[str, None, None]:
plan_prompt_filled = planning_prompt_template.replace("{query}", query)
if "{summaries}" in plan_prompt_filled:
summaries = docs_data if docs_data else "No documents retrieved."
plan_prompt_filled = plan_prompt_filled.replace("{summaries}", summaries)
plan_prompt_filled = plan_prompt_filled.replace("{prompt}", self.prompt or "")
plan_prompt_filled = plan_prompt_filled.replace("{observations}", "\n".join(self.observations))
messages = [{"role": "user", "content": plan_prompt_filled}]
plan_stream_from_llm = self.llm.gen_stream(
model=self.gpt_model, messages=messages, tools=getattr(self, 'tools', None) # Use self.tools
)
if log_context:
data = build_stack_data(self.llm)
log_context.stacks.append({"component": "planning_llm", "data": data})
for chunk in plan_stream_from_llm:
content_piece = self._extract_content_from_llm_response(chunk)
if content_piece:
yield content_piece
def _create_final_answer(
self, query: str, observations: List[str], log_context: LogContext = None
) -> Generator[str, None, None]:
observation_string = "\n".join(observations)
max_obs_len = 10000
if len(observation_string) > max_obs_len:
observation_string = observation_string[:max_obs_len] + "\n...[observations truncated]"
logger.warning("ReActAgent: Truncated observations for final answer prompt due to length.")
final_answer_prompt_filled = final_prompt_template.format(
query=query, observations=observation_string
)
messages = [{"role": "user", "content": final_answer_prompt_filled}]
# Final answer should synthesize, not call tools.
final_answer_stream_from_llm = self.llm.gen_stream(
model=self.gpt_model, messages=messages, tools=None
)
if log_context:
data = build_stack_data(self.llm)
log_context.stacks.append({"component": "final_answer_llm", "data": data})
for chunk in final_answer_stream_from_llm:
content_piece = self._extract_content_from_llm_response(chunk)
if content_piece:
yield content_piece

View File

@@ -0,0 +1,72 @@
import json
import requests
from application.agents.tools.base import Tool
class APITool(Tool):
"""
API Tool
A flexible tool for performing various API actions (e.g., sending messages, retrieving data) via custom user-specified APIs
"""
def __init__(self, config):
self.config = config
self.url = config.get("url", "")
self.method = config.get("method", "GET")
self.headers = config.get("headers", {"Content-Type": "application/json"})
self.query_params = config.get("query_params", {})
def execute_action(self, action_name, **kwargs):
return self._make_api_call(
self.url, self.method, self.headers, self.query_params, kwargs
)
def _make_api_call(self, url, method, headers, query_params, body):
if query_params:
url = f"{url}?{requests.compat.urlencode(query_params)}"
# if isinstance(body, dict):
# body = json.dumps(body)
try:
print(f"Making API call: {method} {url} with body: {body}")
if body == "{}":
body = None
response = requests.request(method, url, headers=headers, data=body)
response.raise_for_status()
content_type = response.headers.get(
"Content-Type", "application/json"
).lower()
if "application/json" in content_type:
try:
data = response.json()
except json.JSONDecodeError as e:
print(f"Error decoding JSON: {e}. Raw response: {response.text}")
return {
"status_code": response.status_code,
"message": f"API call returned invalid JSON. Error: {e}",
"data": response.text,
}
elif "text/" in content_type or "application/xml" in content_type:
data = response.text
elif not response.content:
data = None
else:
print(f"Unsupported content type: {content_type}")
data = response.content
return {
"status_code": response.status_code,
"data": data,
"message": "API call successful.",
}
except requests.exceptions.RequestException as e:
return {
"status_code": response.status_code if response else None,
"message": f"API call failed: {str(e)}",
}
def get_actions_metadata(self):
return []
def get_config_requirements(self):
return {}

View File

@@ -0,0 +1,21 @@
from abc import ABC, abstractmethod
class Tool(ABC):
@abstractmethod
def execute_action(self, action_name: str, **kwargs):
pass
@abstractmethod
def get_actions_metadata(self):
"""
Returns a list of JSON objects describing the actions supported by the tool.
"""
pass
@abstractmethod
def get_config_requirements(self):
"""
Returns a dictionary describing the configuration requirements for the tool.
"""
pass

View File

@@ -0,0 +1,217 @@
import requests
from application.agents.tools.base import Tool
class BraveSearchTool(Tool):
"""
Brave Search
A tool for performing web and image searches using the Brave Search API.
Requires an API key for authentication.
"""
def __init__(self, config):
self.config = config
self.token = config.get("token", "")
self.base_url = "https://api.search.brave.com/res/v1"
def execute_action(self, action_name, **kwargs):
actions = {
"brave_web_search": self._web_search,
"brave_image_search": self._image_search,
}
if action_name in actions:
return actions[action_name](**kwargs)
else:
raise ValueError(f"Unknown action: {action_name}")
def _web_search(self, query, country="ALL", search_lang="en", count=10,
offset=0, safesearch="off", freshness=None,
result_filter=None, extra_snippets=False, summary=False):
"""
Performs a web search using the Brave Search API.
"""
print(f"Performing Brave web search for: {query}")
url = f"{self.base_url}/web/search"
# Build query parameters
params = {
"q": query,
"country": country,
"search_lang": search_lang,
"count": min(count, 20),
"offset": min(offset, 9),
"safesearch": safesearch
}
# Add optional parameters only if they have values
if freshness:
params["freshness"] = freshness
if result_filter:
params["result_filter"] = result_filter
if extra_snippets:
params["extra_snippets"] = 1
if summary:
params["summary"] = 1
# Set up headers
headers = {
"Accept": "application/json",
"Accept-Encoding": "gzip",
"X-Subscription-Token": self.token
}
# Make the request
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
return {
"status_code": response.status_code,
"results": response.json(),
"message": "Search completed successfully."
}
else:
return {
"status_code": response.status_code,
"message": f"Search failed with status code: {response.status_code}."
}
def _image_search(self, query, country="ALL", search_lang="en", count=5,
safesearch="off", spellcheck=False):
"""
Performs an image search using the Brave Search API.
"""
print(f"Performing Brave image search for: {query}")
url = f"{self.base_url}/images/search"
# Build query parameters
params = {
"q": query,
"country": country,
"search_lang": search_lang,
"count": min(count, 100), # API max is 100
"safesearch": safesearch,
"spellcheck": 1 if spellcheck else 0
}
# Set up headers
headers = {
"Accept": "application/json",
"Accept-Encoding": "gzip",
"X-Subscription-Token": self.token
}
# Make the request
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
return {
"status_code": response.status_code,
"results": response.json(),
"message": "Image search completed successfully."
}
else:
return {
"status_code": response.status_code,
"message": f"Image search failed with status code: {response.status_code}."
}
def get_actions_metadata(self):
return [
{
"name": "brave_web_search",
"description": "Perform a web search using Brave Search",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query (max 400 characters, 50 words)",
},
# "country": {
# "type": "string",
# "description": "The 2-character country code (default: US)",
# },
"search_lang": {
"type": "string",
"description": "The search language preference (default: en)",
},
# "count": {
# "type": "integer",
# "description": "Number of results to return (max 20, default: 10)",
# },
# "offset": {
# "type": "integer",
# "description": "Pagination offset (max 9, default: 0)",
# },
# "safesearch": {
# "type": "string",
# "description": "Filter level for adult content (off, moderate, strict)",
# },
"freshness": {
"type": "string",
"description": "Time filter for results (pd: last 24h, pw: last week, pm: last month, py: last year)",
},
# "result_filter": {
# "type": "string",
# "description": "Comma-delimited list of result types to include",
# },
# "extra_snippets": {
# "type": "boolean",
# "description": "Get additional excerpts from result pages",
# },
# "summary": {
# "type": "boolean",
# "description": "Enable summary generation in search results",
# }
},
"required": ["query"],
"additionalProperties": False,
},
},
{
"name": "brave_image_search",
"description": "Perform an image search using Brave Search",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query (max 400 characters, 50 words)",
},
# "country": {
# "type": "string",
# "description": "The 2-character country code (default: US)",
# },
# "search_lang": {
# "type": "string",
# "description": "The search language preference (default: en)",
# },
"count": {
"type": "integer",
"description": "Number of results to return (max 100, default: 5)",
},
# "safesearch": {
# "type": "string",
# "description": "Filter level for adult content (off, strict). Default: strict",
# },
# "spellcheck": {
# "type": "boolean",
# "description": "Whether to spellcheck provided query (default: true)",
# }
},
"required": ["query"],
"additionalProperties": False,
},
}
]
def get_config_requirements(self):
return {
"token": {
"type": "string",
"description": "Brave Search API key for authentication"
},
}

View File

@@ -0,0 +1,76 @@
import requests
from application.agents.tools.base import Tool
class CryptoPriceTool(Tool):
"""
CryptoPrice
A tool for retrieving cryptocurrency prices using the CryptoCompare public API
"""
def __init__(self, config):
self.config = config
def execute_action(self, action_name, **kwargs):
actions = {"cryptoprice_get": self._get_price}
if action_name in actions:
return actions[action_name](**kwargs)
else:
raise ValueError(f"Unknown action: {action_name}")
def _get_price(self, symbol, currency):
"""
Fetches the current price of a given cryptocurrency symbol in the specified currency.
Example:
symbol = "BTC"
currency = "USD"
returns price in USD.
"""
url = f"https://min-api.cryptocompare.com/data/price?fsym={symbol.upper()}&tsyms={currency.upper()}"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
if currency.upper() in data:
return {
"status_code": response.status_code,
"price": data[currency.upper()],
"message": f"Price of {symbol.upper()} in {currency.upper()} retrieved successfully.",
}
else:
return {
"status_code": response.status_code,
"message": f"Couldn't find price for {symbol.upper()} in {currency.upper()}.",
}
else:
return {
"status_code": response.status_code,
"message": "Failed to retrieve price.",
}
def get_actions_metadata(self):
return [
{
"name": "cryptoprice_get",
"description": "Retrieve the price of a specified cryptocurrency in a given currency",
"parameters": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "The cryptocurrency symbol (e.g. BTC)",
},
"currency": {
"type": "string",
"description": "The currency in which you want the price (e.g. USD)",
},
},
"required": ["symbol", "currency"],
"additionalProperties": False,
},
}
]
def get_config_requirements(self):
# No specific configuration needed for this tool as it just queries a public endpoint
return {}

View File

@@ -0,0 +1,127 @@
import requests
from application.agents.tools.base import Tool
class NtfyTool(Tool):
"""
Ntfy Tool
A tool for sending notifications to ntfy topics on a specified server.
"""
def __init__(self, config):
"""
Initialize the NtfyTool with configuration.
Args:
config (dict): Configuration dictionary containing the access token.
"""
self.config = config
self.token = config.get("token", "")
def execute_action(self, action_name, **kwargs):
"""
Execute the specified action with given parameters.
Args:
action_name (str): Name of the action to execute.
**kwargs: Parameters for the action, including server_url.
Returns:
dict: Result of the action with status code and message.
Raises:
ValueError: If the action name is unknown.
"""
actions = {
"ntfy_send_message": self._send_message,
}
if action_name in actions:
return actions[action_name](**kwargs)
else:
raise ValueError(f"Unknown action: {action_name}")
def _send_message(self, server_url, message, topic, title=None, priority=None):
"""
Send a message to an ntfy topic on the specified server.
Args:
server_url (str): Base URL of the ntfy server (e.g., https://ntfy.sh).
message (str): The message text to send.
topic (str): The topic to send the message to.
title (str, optional): Title of the notification.
priority (int, optional): Priority of the notification (1-5).
Returns:
dict: Response with status code and a confirmation message.
Raises:
ValueError: If priority is not an integer between 1 and 5.
"""
url = f"{server_url.rstrip('/')}/{topic}"
headers = {}
if title:
headers["X-Title"] = title
if priority:
try:
priority = int(priority)
except (ValueError, TypeError):
raise ValueError("Priority must be convertible to an integer")
if priority < 1 or priority > 5:
raise ValueError("Priority must be an integer between 1 and 5")
headers["X-Priority"] = str(priority)
if self.token:
headers["Authorization"] = f"Basic {self.token}"
data = message.encode("utf-8")
response = requests.post(url, headers=headers, data=data)
return {"status_code": response.status_code, "message": "Message sent"}
def get_actions_metadata(self):
"""
Provide metadata about available actions.
Returns:
list: List of dictionaries describing each action.
"""
return [
{
"name": "ntfy_send_message",
"description": "Send a notification to an ntfy topic",
"parameters": {
"type": "object",
"properties": {
"server_url": {
"type": "string",
"description": "Base URL of the ntfy server",
},
"message": {
"type": "string",
"description": "Text to send in the notification",
},
"topic": {
"type": "string",
"description": "Topic to send the notification to",
},
"title": {
"type": "string",
"description": "Title of the notification (optional)",
},
"priority": {
"type": "integer",
"description": "Priority of the notification (1-5, optional)",
},
},
"required": ["server_url", "message", "topic"],
"additionalProperties": False,
},
},
]
def get_config_requirements(self):
"""
Specify the configuration requirements.
Returns:
dict: Dictionary describing required config parameters.
"""
return {
"token": {"type": "string", "description": "Access token for authentication"},
}

View File

@@ -0,0 +1,163 @@
import psycopg2
from application.agents.tools.base import Tool
class PostgresTool(Tool):
"""
PostgreSQL Database Tool
A tool for connecting to a PostgreSQL database using a connection string,
executing SQL queries, and retrieving schema information.
"""
def __init__(self, config):
self.config = config
self.connection_string = config.get("token", "")
def execute_action(self, action_name, **kwargs):
actions = {
"postgres_execute_sql": self._execute_sql,
"postgres_get_schema": self._get_schema,
}
if action_name in actions:
return actions[action_name](**kwargs)
else:
raise ValueError(f"Unknown action: {action_name}")
def _execute_sql(self, sql_query):
"""
Executes an SQL query against the PostgreSQL database using a connection string.
"""
conn = None # Initialize conn to None for error handling
try:
conn = psycopg2.connect(self.connection_string)
cur = conn.cursor()
cur.execute(sql_query)
conn.commit()
if sql_query.strip().lower().startswith("select"):
column_names = [desc[0] for desc in cur.description] if cur.description else []
results = []
rows = cur.fetchall()
for row in rows:
results.append(dict(zip(column_names, row)))
response_data = {"data": results, "column_names": column_names}
else:
row_count = cur.rowcount
response_data = {"message": f"Query executed successfully, {row_count} rows affected."}
cur.close()
return {
"status_code": 200,
"message": "SQL query executed successfully.",
"response_data": response_data,
}
except psycopg2.Error as e:
error_message = f"Database error: {e}"
print(f"Database error: {e}")
return {
"status_code": 500,
"message": "Failed to execute SQL query.",
"error": error_message,
}
finally:
if conn: # Ensure connection is closed even if errors occur
conn.close()
def _get_schema(self, db_name):
"""
Retrieves the schema of the PostgreSQL database using a connection string.
"""
conn = None # Initialize conn to None for error handling
try:
conn = psycopg2.connect(self.connection_string)
cur = conn.cursor()
cur.execute("""
SELECT
table_name,
column_name,
data_type,
column_default,
is_nullable
FROM
information_schema.columns
WHERE
table_schema = 'public'
ORDER BY
table_name,
ordinal_position;
""")
schema_data = {}
for row in cur.fetchall():
table_name, column_name, data_type, column_default, is_nullable = row
if table_name not in schema_data:
schema_data[table_name] = []
schema_data[table_name].append({
"column_name": column_name,
"data_type": data_type,
"column_default": column_default,
"is_nullable": is_nullable
})
cur.close()
return {
"status_code": 200,
"message": "Database schema retrieved successfully.",
"schema": schema_data,
}
except psycopg2.Error as e:
error_message = f"Database error: {e}"
print(f"Database error: {e}")
return {
"status_code": 500,
"message": "Failed to retrieve database schema.",
"error": error_message,
}
finally:
if conn: # Ensure connection is closed even if errors occur
conn.close()
def get_actions_metadata(self):
return [
{
"name": "postgres_execute_sql",
"description": "Execute an SQL query against the PostgreSQL database and return the results. Use this tool to interact with the database, e.g., retrieve specific data or perform updates. Only SELECT queries will return data, other queries will return execution status.",
"parameters": {
"type": "object",
"properties": {
"sql_query": {
"type": "string",
"description": "The SQL query to execute.",
},
},
"required": ["sql_query"],
"additionalProperties": False,
},
},
{
"name": "postgres_get_schema",
"description": "Retrieve the schema of the PostgreSQL database, including tables and their columns. Use this to understand the database structure before executing queries. db_name is 'default' if not provided.",
"parameters": {
"type": "object",
"properties": {
"db_name": {
"type": "string",
"description": "The name of the database to retrieve the schema for.",
},
},
"required": ["db_name"],
"additionalProperties": False,
},
},
]
def get_config_requirements(self):
return {
"token": {
"type": "string",
"description": "PostgreSQL database connection string (e.g., 'postgresql://user:password@host:port/dbname')",
},
}

View File

@@ -0,0 +1,83 @@
import requests
from markdownify import markdownify
from application.agents.tools.base import Tool
from urllib.parse import urlparse
class ReadWebpageTool(Tool):
"""
Read Webpage (browser)
A tool to fetch the HTML content of a URL and convert it to Markdown.
"""
def __init__(self, config=None):
"""
Initializes the tool.
:param config: Optional configuration dictionary. Not used by this tool.
"""
self.config = config
def execute_action(self, action_name: str, **kwargs) -> str:
"""
Executes the specified action. For this tool, the only action is 'read_webpage'.
:param action_name: The name of the action to execute. Should be 'read_webpage'.
:param kwargs: Keyword arguments, must include 'url'.
:return: The Markdown content of the webpage or an error message.
"""
if action_name != "read_webpage":
return f"Error: Unknown action '{action_name}'. This tool only supports 'read_webpage'."
url = kwargs.get("url")
if not url:
return "Error: URL parameter is missing."
# Ensure the URL has a scheme (if not, default to http)
parsed_url = urlparse(url)
if not parsed_url.scheme:
url = "http://" + url
try:
response = requests.get(url, timeout=10, headers={'User-Agent': 'DocsGPT-Agent/1.0'})
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
html_content = response.text
#soup = BeautifulSoup(html_content, 'html.parser')
markdown_content = markdownify(html_content, heading_style="ATX", newline_style="BACKSLASH")
return markdown_content
except requests.exceptions.RequestException as e:
return f"Error fetching URL {url}: {e}"
except Exception as e:
return f"Error processing URL {url}: {e}"
def get_actions_metadata(self):
"""
Returns metadata for the actions supported by this tool.
"""
return [
{
"name": "read_webpage",
"description": "Fetches the HTML content of a given URL and returns it as clean Markdown text. Input must be a valid URL.",
"parameters": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The fully qualified URL of the webpage to read (e.g., 'https://www.example.com').",
}
},
"required": ["url"],
"additionalProperties": False,
},
}
]
def get_config_requirements(self):
"""
Returns a dictionary describing the configuration requirements for the tool.
This tool does not require any specific configuration.
"""
return {}

View File

@@ -0,0 +1,86 @@
import requests
from application.agents.tools.base import Tool
class TelegramTool(Tool):
"""
Telegram Bot
A flexible Telegram tool for performing various actions (e.g., sending messages, images).
Requires a bot token and chat ID for configuration
"""
def __init__(self, config):
self.config = config
self.token = config.get("token", "")
def execute_action(self, action_name, **kwargs):
actions = {
"telegram_send_message": self._send_message,
"telegram_send_image": self._send_image,
}
if action_name in actions:
return actions[action_name](**kwargs)
else:
raise ValueError(f"Unknown action: {action_name}")
def _send_message(self, text, chat_id):
print(f"Sending message: {text}")
url = f"https://api.telegram.org/bot{self.token}/sendMessage"
payload = {"chat_id": chat_id, "text": text}
response = requests.post(url, data=payload)
return {"status_code": response.status_code, "message": "Message sent"}
def _send_image(self, image_url, chat_id):
print(f"Sending image: {image_url}")
url = f"https://api.telegram.org/bot{self.token}/sendPhoto"
payload = {"chat_id": chat_id, "photo": image_url}
response = requests.post(url, data=payload)
return {"status_code": response.status_code, "message": "Image sent"}
def get_actions_metadata(self):
return [
{
"name": "telegram_send_message",
"description": "Send a notification to Telegram chat",
"parameters": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text to send in the notification",
},
"chat_id": {
"type": "string",
"description": "Chat ID to send the notification to",
},
},
"required": ["text"],
"additionalProperties": False,
},
},
{
"name": "telegram_send_image",
"description": "Send an image to the Telegram chat",
"parameters": {
"type": "object",
"properties": {
"image_url": {
"type": "string",
"description": "URL of the image to send",
},
"chat_id": {
"type": "string",
"description": "Chat ID to send the image to",
},
},
"required": ["image_url"],
"additionalProperties": False,
},
},
]
def get_config_requirements(self):
return {
"token": {"type": "string", "description": "Bot token for authentication"},
}

View File

@@ -0,0 +1,42 @@
import json
import logging
logger = logging.getLogger(__name__)
class ToolActionParser:
def __init__(self, llm_type):
self.llm_type = llm_type
self.parsers = {
"OpenAILLM": self._parse_openai_llm,
"GoogleLLM": self._parse_google_llm,
}
def parse_args(self, call):
parser = self.parsers.get(self.llm_type, self._parse_openai_llm)
return parser(call)
def _parse_openai_llm(self, call):
if isinstance(call, dict):
try:
call_args = json.loads(call["function"]["arguments"])
tool_id = call["function"]["name"].split("_")[-1]
action_name = call["function"]["name"].rsplit("_", 1)[0]
except (KeyError, TypeError) as e:
logger.error(f"Error parsing OpenAI LLM call: {e}")
return None, None, None
else:
try:
call_args = json.loads(call.function.arguments)
tool_id = call.function.name.split("_")[-1]
action_name = call.function.name.rsplit("_", 1)[0]
except (AttributeError, TypeError) as e:
logger.error(f"Error parsing OpenAI LLM call: {e}")
return None, None, None
return tool_id, action_name, call_args
def _parse_google_llm(self, call):
call_args = call.args
tool_id = call.name.split("_")[-1]
action_name = call.name.rsplit("_", 1)[0]
return tool_id, action_name, call_args

View File

@@ -0,0 +1,42 @@
import importlib
import inspect
import os
import pkgutil
from application.agents.tools.base import Tool
class ToolManager:
def __init__(self, config):
self.config = config
self.tools = {}
self.load_tools()
def load_tools(self):
tools_dir = os.path.join(os.path.dirname(__file__))
for finder, name, ispkg in pkgutil.iter_modules([tools_dir]):
if name == "base" or name.startswith("__"):
continue
module = importlib.import_module(f"application.agents.tools.{name}")
for member_name, obj in inspect.getmembers(module, inspect.isclass):
if issubclass(obj, Tool) and obj is not Tool:
tool_config = self.config.get(name, {})
self.tools[name] = obj(tool_config)
def load_tool(self, tool_name, tool_config):
self.config[tool_name] = tool_config
module = importlib.import_module(f"application.agents.tools.{tool_name}")
for member_name, obj in inspect.getmembers(module, inspect.isclass):
if issubclass(obj, Tool) and obj is not Tool:
return obj(tool_config)
def execute_action(self, tool_name, action_name, **kwargs):
if tool_name not in self.tools:
raise ValueError(f"Tool '{tool_name}' not loaded")
return self.tools[tool_name].execute_action(action_name, **kwargs)
def get_all_actions_metadata(self):
metadata = []
for tool in self.tools.values():
metadata.extend(tool.get_actions_metadata())
return metadata

View File

@@ -3,14 +3,14 @@ import datetime
import json
import logging
import os
import sys
import traceback
from bson.dbref import DBRef
from bson.objectid import ObjectId
from flask import Blueprint, current_app, make_response, request, Response
from flask import Blueprint, make_response, request, Response
from flask_restx import fields, Namespace, Resource
from application.agents.agent_creator import AgentCreator
from application.core.mongo_db import MongoDB
from application.core.settings import settings
@@ -18,17 +18,18 @@ from application.error import bad_request
from application.extensions import api
from application.llm.llm_creator import LLMCreator
from application.retriever.retriever_creator import RetrieverCreator
from application.utils import check_required_fields
from application.utils import check_required_fields, limit_chat_history
logger = logging.getLogger(__name__)
mongo = MongoDB.get_client()
db = mongo["docsgpt"]
db = mongo[settings.MONGO_DB_NAME]
conversations_collection = db["conversations"]
sources_collection = db["sources"]
prompts_collection = db["prompts"]
api_key_collection = db["api_keys"]
agents_collection = db["agents"]
user_logs_collection = db["user_logs"]
attachments_collection = db["attachments"]
answer = Blueprint("answer", __name__)
answer_ns = Namespace("answer", description="Answer related operations", path="/")
@@ -37,11 +38,13 @@ api.add_namespace(answer_ns)
gpt_model = ""
# to have some kind of default behaviour
if settings.LLM_NAME == "openai":
gpt_model = "gpt-3.5-turbo"
gpt_model = "gpt-4o-mini"
elif settings.LLM_NAME == "anthropic":
gpt_model = "claude-2"
elif settings.LLM_NAME == "groq":
gpt_model = "llama3-8b-8192"
elif settings.LLM_NAME == "novita":
gpt_model = "deepseek/deepseek-r1"
if settings.MODEL_NAME: # in case there is particular model name configured
gpt_model = settings.MODEL_NAME
@@ -83,22 +86,51 @@ def run_async_chain(chain, question, chat_history):
return result
def get_agent_key(agent_id, user_id):
if not agent_id:
return None, False, None
try:
agent = agents_collection.find_one({"_id": ObjectId(agent_id)})
if agent is None:
raise Exception("Agent not found", 404)
is_owner = agent.get("user") == user_id
if is_owner:
agents_collection.update_one(
{"_id": ObjectId(agent_id)},
{"$set": {"lastUsedAt": datetime.datetime.now(datetime.timezone.utc)}},
)
return str(agent["key"]), False, None
is_shared_with_user = agent.get(
"shared_publicly", False
) or user_id in agent.get("shared_with", [])
if is_shared_with_user:
return str(agent["key"]), True, agent.get("shared_token")
raise Exception("Unauthorized access to the agent", 403)
except Exception as e:
logger.error(f"Error in get_agent_key: {str(e)}", exc_info=True)
raise
def get_data_from_api_key(api_key):
data = api_key_collection.find_one({"key": api_key})
# # Raise custom exception if the API key is not found
if data is None:
raise Exception("Invalid API Key, please generate new key", 401)
data = agents_collection.find_one({"key": api_key})
if not data:
raise Exception("Invalid API Key, please generate a new key", 401)
if "retriever" not in data:
data["retriever"] = None
if "source" in data and isinstance(data["source"], DBRef):
source_doc = db.dereference(data["source"])
source = data.get("source")
if isinstance(source, DBRef):
source_doc = db.dereference(source)
data["source"] = str(source_doc["_id"])
if "retriever" in source_doc:
data["retriever"] = source_doc["retriever"]
data["retriever"] = source_doc.get("retriever", data.get("retriever"))
else:
data["source"] = {}
return data
@@ -118,8 +150,42 @@ def is_azure_configured():
)
def save_conversation(conversation_id, question, response, source_log_docs, llm):
if conversation_id is not None and conversation_id != "None":
def save_conversation(
conversation_id,
question,
response,
thought,
source_log_docs,
tool_calls,
llm,
decoded_token,
index=None,
api_key=None,
agent_id=None,
is_shared_usage=False,
shared_token=None,
):
current_time = datetime.datetime.now(datetime.timezone.utc)
if conversation_id is not None and index is not None:
conversations_collection.update_one(
{"_id": ObjectId(conversation_id), f"queries.{index}": {"$exists": True}},
{
"$set": {
f"queries.{index}.prompt": question,
f"queries.{index}.response": response,
f"queries.{index}.thought": thought,
f"queries.{index}.sources": source_log_docs,
f"queries.{index}.tool_calls": tool_calls,
f"queries.{index}.timestamp": current_time,
}
},
)
##remove following queries from the array
conversations_collection.update_one(
{"_id": ObjectId(conversation_id), f"queries.{index}": {"$exists": True}},
{"$push": {"queries": {"$each": [], "$slice": index + 1}}},
)
elif conversation_id is not None and conversation_id != "None":
conversations_collection.update_one(
{"_id": ObjectId(conversation_id)},
{
@@ -127,7 +193,10 @@ def save_conversation(conversation_id, question, response, source_log_docs, llm)
"queries": {
"prompt": question,
"response": response,
"thought": thought,
"sources": source_log_docs,
"tool_calls": tool_calls,
"timestamp": current_time,
}
}
},
@@ -141,34 +210,43 @@ def save_conversation(conversation_id, question, response, source_log_docs, llm)
"role": "assistant",
"content": "Summarise following conversation in no more than 3 "
"words, respond ONLY with the summary, use the same "
"language as the system \n\nUser: "
+ question
+ "\n\n"
+ "AI: "
+ response,
"language as the system",
},
{
"role": "user",
"content": "Summarise following conversation in no more than 3 words, "
"respond ONLY with the summary, use the same language as the "
"system",
"system \n\nUser: " + question + "\n\n" + "AI: " + response,
},
]
completion = llm.gen(model=gpt_model, messages=messages_summary, max_tokens=30)
conversation_data = {
"user": decoded_token.get("sub"),
"date": datetime.datetime.utcnow(),
"name": completion,
"queries": [
{
"prompt": question,
"response": response,
"thought": thought,
"sources": source_log_docs,
"tool_calls": tool_calls,
"timestamp": current_time,
}
],
}
if api_key:
if agent_id:
conversation_data["agent_id"] = agent_id
if is_shared_usage:
conversation_data["is_shared_usage"] = is_shared_usage
conversation_data["shared_token"] = shared_token
api_key_doc = agents_collection.find_one({"key": api_key})
if api_key_doc:
conversation_data["api_key"] = api_key_doc["key"]
conversation_id = conversations_collection.insert_one(
{
"user": "local",
"date": datetime.datetime.utcnow(),
"name": completion,
"queries": [
{
"prompt": question,
"response": response,
"sources": source_log_docs,
}
],
}
conversation_data
).inserted_id
return conversation_id
@@ -186,66 +264,116 @@ def get_prompt(prompt_id):
def complete_stream(
question, retriever, conversation_id, user_api_key, isNoneDoc=False
question,
agent,
retriever,
conversation_id,
user_api_key,
decoded_token,
isNoneDoc=False,
index=None,
should_save_conversation=True,
attachments=None,
agent_id=None,
is_shared_usage=False,
shared_token=None,
):
try:
response_full = ""
source_log_docs = []
answer = retriever.gen()
sources = retriever.search()
for source in sources:
if "text" in source:
source["text"] = source["text"][:100].strip() + "..."
if len(sources) > 0:
data = json.dumps({"type": "source", "source": sources})
yield f"data: {data}\n\n"
response_full, thought, source_log_docs, tool_calls = "", "", [], []
attachment_ids = []
if attachments:
attachment_ids = [attachment["id"] for attachment in attachments]
logger.info(
f"Processing request with {len(attachments)} attachments: {attachment_ids}"
)
answer = agent.gen(query=question, retriever=retriever)
for line in answer:
if "answer" in line:
response_full += str(line["answer"])
data = json.dumps(line)
data = json.dumps({"type": "answer", "answer": line["answer"]})
yield f"data: {data}\n\n"
elif "sources" in line:
truncated_sources = []
source_log_docs = line["sources"]
for source in line["sources"]:
truncated_source = source.copy()
if "text" in truncated_source:
truncated_source["text"] = (
truncated_source["text"][:100].strip() + "..."
)
truncated_sources.append(truncated_source)
if len(truncated_sources) > 0:
data = json.dumps({"type": "source", "source": truncated_sources})
yield f"data: {data}\n\n"
elif "tool_calls" in line:
tool_calls = line["tool_calls"]
data = json.dumps({"type": "tool_calls", "tool_calls": tool_calls})
yield f"data: {data}\n\n"
elif "thought" in line:
thought += line["thought"]
data = json.dumps({"type": "thought", "thought": line["thought"]})
yield f"data: {data}\n\n"
elif "source" in line:
source_log_docs.append(line["source"])
if isNoneDoc:
for doc in source_log_docs:
doc["source"] = "None"
llm = LLMCreator.create_llm(
settings.LLM_NAME, api_key=settings.API_KEY, user_api_key=user_api_key
settings.LLM_NAME,
api_key=settings.API_KEY,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
if user_api_key is None:
if should_save_conversation:
conversation_id = save_conversation(
conversation_id, question, response_full, source_log_docs, llm
conversation_id,
question,
response_full,
thought,
source_log_docs,
tool_calls,
llm,
decoded_token,
index,
api_key=user_api_key,
agent_id=agent_id,
is_shared_usage=is_shared_usage,
shared_token=shared_token,
)
# send data.type = "end" to indicate that the stream has ended as json
data = json.dumps({"type": "id", "id": str(conversation_id)})
yield f"data: {data}\n\n"
else:
conversation_id = None
# send data.type = "end" to indicate that the stream has ended as json
data = json.dumps({"type": "id", "id": str(conversation_id)})
yield f"data: {data}\n\n"
retriever_params = retriever.get_params()
user_logs_collection.insert_one(
{
"action": "stream_answer",
"level": "info",
"user": "local",
"user": decoded_token.get("sub"),
"api_key": user_api_key,
"question": question,
"response": response_full,
"sources": source_log_docs,
"retriever_params": retriever_params,
"attachments": attachment_ids,
"timestamp": datetime.datetime.now(datetime.timezone.utc),
}
)
data = json.dumps({"type": "end"})
yield f"data: {data}\n\n"
except Exception as e:
print("\033[91merr", str(e), file=sys.stderr)
logger.error(f"Error in stream: {str(e)}", exc_info=True)
data = json.dumps(
{
"type": "error",
"error": "Please try again later. We apologize for any inconvenience.",
"error_exception": str(e),
}
)
yield f"data: {data}\n\n"
@@ -281,6 +409,17 @@ class Stream(Resource):
"isNoneDoc": fields.Boolean(
required=False, description="Flag indicating if no document is used"
),
"index": fields.Integer(
required=False, description="Index of the query to update"
),
"save_conversation": fields.Boolean(
required=False,
default=True,
description="Whether to save the conversation",
),
"attachments": fields.List(
fields.String, required=False, description="List of attachment IDs"
),
},
)
@@ -289,22 +428,39 @@ class Stream(Resource):
def post(self):
data = request.get_json()
required_fields = ["question"]
if "index" in data:
required_fields = ["question", "conversation_id"]
missing_fields = check_required_fields(data, required_fields)
if missing_fields:
return missing_fields
save_conv = data.get("save_conversation", True)
try:
question = data["question"]
history = data.get("history", [])
history = json.loads(history)
history = limit_chat_history(
json.loads(data.get("history", "[]")), gpt_model=gpt_model
)
conversation_id = data.get("conversation_id")
prompt_id = data.get("prompt_id", "default")
attachment_ids = data.get("attachments", [])
index = data.get("index", None)
chunks = int(data.get("chunks", 2))
token_limit = data.get("token_limit", settings.DEFAULT_MAX_HISTORY)
retriever_name = data.get("retriever", "classic")
agent_id = data.get("agent_id", None)
agent_type = settings.AGENT_NAME
decoded_token = getattr(request, "decoded_token", None)
user_sub = decoded_token.get("sub") if decoded_token else None
agent_key, is_shared_usage, shared_token = get_agent_key(
agent_id, user_sub
)
if agent_key:
data.update({"api_key": agent_key})
else:
agent_id = None
if "api_key" in data:
data_key = get_data_from_api_key(data["api_key"])
@@ -313,27 +469,55 @@ class Stream(Resource):
source = {"active_docs": data_key.get("source")}
retriever_name = data_key.get("retriever", retriever_name)
user_api_key = data["api_key"]
agent_type = data_key.get("agent_type", agent_type)
if is_shared_usage:
decoded_token = request.decoded_token
else:
decoded_token = {"sub": data_key.get("user")}
is_shared_usage = False
elif "active_docs" in data:
source = {"active_docs": data["active_docs"]}
retriever_name = get_retriever(data["active_docs"]) or retriever_name
user_api_key = None
decoded_token = request.decoded_token
else:
source = {}
user_api_key = None
decoded_token = request.decoded_token
current_app.logger.info(
f"/stream - request_data: {data}, source: {source}",
if not decoded_token:
return make_response({"error": "Unauthorized"}, 401)
attachments = get_attachments_content(
attachment_ids, decoded_token.get("sub")
)
logger.info(
f"/stream - request_data: {data}, source: {source}, attachments: {len(attachments)}",
extra={"data": json.dumps({"request_data": data, "source": source})},
)
prompt = get_prompt(prompt_id)
if "isNoneDoc" in data and data["isNoneDoc"] is True:
chunks = 0
agent = AgentCreator.create_agent(
agent_type,
endpoint="stream",
llm_name=settings.LLM_NAME,
gpt_model=gpt_model,
api_key=settings.API_KEY,
user_api_key=user_api_key,
prompt=prompt,
chat_history=history,
decoded_token=decoded_token,
attachments=attachments,
)
retriever = RetrieverCreator.create_retriever(
retriever_name,
question=question,
source=source,
chat_history=history,
prompt=prompt,
@@ -341,39 +525,43 @@ class Stream(Resource):
token_limit=token_limit,
gpt_model=gpt_model,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
return Response(
complete_stream(
question=question,
agent=agent,
retriever=retriever,
conversation_id=conversation_id,
user_api_key=user_api_key,
decoded_token=decoded_token,
isNoneDoc=data.get("isNoneDoc"),
index=index,
should_save_conversation=save_conv,
agent_id=agent_id,
is_shared_usage=is_shared_usage,
shared_token=shared_token,
),
mimetype="text/event-stream",
)
except ValueError:
message = "Malformed request body"
print("\033[91merr", str(message), file=sys.stderr)
logger.error(f"/stream - error: {message}")
return Response(
error_stream_generate(message),
status=400,
mimetype="text/event-stream",
)
except Exception as e:
current_app.logger.error(
logger.error(
f"/stream - error: {str(e)} - traceback: {traceback.format_exc()}",
extra={"error": str(e), "traceback": traceback.format_exc()},
)
message = e.args[0]
status_code = 400
# Custom exceptions with two arguments, index 1 as status code
if len(e.args) >= 2:
status_code = e.args[1]
return Response(
error_stream_generate(message),
error_stream_generate("Unknown error occurred"),
status=status_code,
mimetype="text/event-stream",
)
@@ -420,19 +608,22 @@ class Answer(Resource):
@api.doc(description="Provide an answer based on the question and retriever")
def post(self):
data = request.get_json()
required_fields = ["question"]
required_fields = ["question"]
missing_fields = check_required_fields(data, required_fields)
if missing_fields:
return missing_fields
try:
question = data["question"]
history = data.get("history", [])
history = limit_chat_history(
json.loads(data.get("history", [])), gpt_model=gpt_model
)
conversation_id = data.get("conversation_id")
prompt_id = data.get("prompt_id", "default")
chunks = int(data.get("chunks", 2))
token_limit = data.get("token_limit", settings.DEFAULT_MAX_HISTORY)
retriever_name = data.get("retriever", "classic")
agent_type = settings.AGENT_NAME
if "api_key" in data:
data_key = get_data_from_api_key(data["api_key"])
@@ -441,24 +632,44 @@ class Answer(Resource):
source = {"active_docs": data_key.get("source")}
retriever_name = data_key.get("retriever", retriever_name)
user_api_key = data["api_key"]
agent_type = data_key.get("agent_type", agent_type)
decoded_token = {"sub": data_key.get("user")}
elif "active_docs" in data:
source = {"active_docs": data["active_docs"]}
retriever_name = get_retriever(data["active_docs"]) or retriever_name
user_api_key = None
decoded_token = request.decoded_token
else:
source = {}
user_api_key = None
decoded_token = request.decoded_token
if not decoded_token:
return make_response({"error": "Unauthorized"}, 401)
prompt = get_prompt(prompt_id)
current_app.logger.info(
logger.info(
f"/api/answer - request_data: {data}, source: {source}",
extra={"data": json.dumps({"request_data": data, "source": source})},
)
agent = AgentCreator.create_agent(
agent_type,
endpoint="api/answer",
llm_name=settings.LLM_NAME,
gpt_model=gpt_model,
api_key=settings.API_KEY,
user_api_key=user_api_key,
prompt=prompt,
chat_history=history,
decoded_token=decoded_token,
)
retriever = RetrieverCreator.create_retriever(
retriever_name,
question=question,
source=source,
chat_history=history,
prompt=prompt,
@@ -466,36 +677,84 @@ class Answer(Resource):
token_limit=token_limit,
gpt_model=gpt_model,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
source_log_docs = []
response_full = ""
for line in retriever.gen():
if "source" in line:
source_log_docs.append(line["source"])
elif "answer" in line:
response_full += line["answer"]
source_log_docs = []
tool_calls = []
stream_ended = False
thought = ""
for line in complete_stream(
question=question,
agent=agent,
retriever=retriever,
conversation_id=conversation_id,
user_api_key=user_api_key,
decoded_token=decoded_token,
isNoneDoc=data.get("isNoneDoc"),
index=None,
should_save_conversation=False,
):
try:
event_data = line.replace("data: ", "").strip()
event = json.loads(event_data)
if event["type"] == "answer":
response_full += event["answer"]
elif event["type"] == "source":
source_log_docs = event["source"]
elif event["type"] == "tool_calls":
tool_calls = event["tool_calls"]
elif event["type"] == "thought":
thought = event["thought"]
elif event["type"] == "error":
logger.error(f"Error from stream: {event['error']}")
return bad_request(500, event["error"])
elif event["type"] == "end":
stream_ended = True
except (json.JSONDecodeError, KeyError) as e:
logger.warning(f"Error parsing stream event: {e}, line: {line}")
continue
if not stream_ended:
logger.error("Stream ended unexpectedly without an 'end' event.")
return bad_request(500, "Stream ended unexpectedly.")
if data.get("isNoneDoc"):
for doc in source_log_docs:
doc["source"] = "None"
llm = LLMCreator.create_llm(
settings.LLM_NAME, api_key=settings.API_KEY, user_api_key=user_api_key
settings.LLM_NAME,
api_key=settings.API_KEY,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
result = {"answer": response_full, "sources": source_log_docs}
result["conversation_id"] = str(
save_conversation(
conversation_id, question, response_full, source_log_docs, llm
conversation_id,
question,
response_full,
thought,
source_log_docs,
tool_calls,
llm,
decoded_token,
api_key=user_api_key,
)
)
retriever_params = retriever.get_params()
user_logs_collection.insert_one(
{
"action": "api_answer",
"level": "info",
"user": "local",
"user": decoded_token.get("sub"),
"api_key": user_api_key,
"question": question,
"response": response_full,
@@ -506,7 +765,7 @@ class Answer(Resource):
)
except Exception as e:
current_app.logger.error(
logger.error(
f"/api/answer - error: {str(e)} - traceback: {traceback.format_exc()}",
extra={"error": str(e), "traceback": traceback.format_exc()},
)
@@ -564,21 +823,28 @@ class Search(Resource):
chunks = int(data_key.get("chunks", 2))
source = {"active_docs": data_key.get("source")}
user_api_key = data["api_key"]
decoded_token = {"sub": data_key.get("user")}
elif "active_docs" in data:
source = {"active_docs": data["active_docs"]}
user_api_key = None
decoded_token = request.decoded_token
else:
source = {}
user_api_key = None
decoded_token = request.decoded_token
current_app.logger.info(
if not decoded_token:
return make_response({"error": "Unauthorized"}, 401)
logger.info(
f"/api/answer - request_data: {data}, source: {source}",
extra={"data": json.dumps({"request_data": data, "source": source})},
)
retriever = RetrieverCreator.create_retriever(
retriever_name,
question=question,
source=source,
chat_history=[],
prompt="default",
@@ -586,16 +852,17 @@ class Search(Resource):
token_limit=token_limit,
gpt_model=gpt_model,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
docs = retriever.search()
docs = retriever.search(question)
retriever_params = retriever.get_params()
user_logs_collection.insert_one(
{
"action": "api_search",
"level": "info",
"user": "local",
"user": decoded_token.get("sub"),
"api_key": user_api_key,
"question": question,
"sources": docs,
@@ -609,10 +876,41 @@ class Search(Resource):
doc["source"] = "None"
except Exception as e:
current_app.logger.error(
logger.error(
f"/api/search - error: {str(e)} - traceback: {traceback.format_exc()}",
extra={"error": str(e), "traceback": traceback.format_exc()},
)
return bad_request(500, str(e))
return make_response(docs, 200)
def get_attachments_content(attachment_ids, user):
"""
Retrieve content from attachment documents based on their IDs.
Args:
attachment_ids (list): List of attachment document IDs
user (str): User identifier to verify ownership
Returns:
list: List of dictionaries containing attachment content and metadata
"""
if not attachment_ids:
return []
attachments = []
for attachment_id in attachment_ids:
try:
attachment_doc = attachments_collection.find_one(
{"_id": ObjectId(attachment_id), "user": user}
)
if attachment_doc:
attachments.append(attachment_doc)
except Exception as e:
logger.error(
f"Error retrieving attachment {attachment_id}: {e}", exc_info=True
)
return attachments

View File

@@ -3,12 +3,15 @@ import datetime
from flask import Blueprint, request, send_from_directory
from werkzeug.utils import secure_filename
from bson.objectid import ObjectId
import logging
from application.core.mongo_db import MongoDB
from application.core.settings import settings
from application.storage.storage_creator import StorageCreator
logger = logging.getLogger(__name__)
mongo = MongoDB.get_client()
db = mongo["docsgpt"]
db = mongo[settings.MONGO_DB_NAME]
conversations_collection = db["conversations"]
sources_collection = db["sources"]
@@ -45,26 +48,26 @@ def upload_index_files():
remote_data = request.form["remote_data"] if "remote_data" in request.form else None
sync_frequency = secure_filename(request.form["sync_frequency"]) if "sync_frequency" in request.form else None
save_dir = os.path.join(current_dir, "indexes", str(id))
storage = StorageCreator.get_storage()
index_base_path = f"indexes/{id}"
if settings.VECTOR_STORE == "faiss":
if "file_faiss" not in request.files:
print("No file part")
logger.error("No file_faiss part")
return {"status": "no file"}
file_faiss = request.files["file_faiss"]
if file_faiss.filename == "":
return {"status": "no file name"}
if "file_pkl" not in request.files:
print("No file part")
logger.error("No file_pkl part")
return {"status": "no file"}
file_pkl = request.files["file_pkl"]
if file_pkl.filename == "":
return {"status": "no file name"}
# saves index files
if not os.path.exists(save_dir):
os.makedirs(save_dir)
file_faiss.save(os.path.join(save_dir, "index.faiss"))
file_pkl.save(os.path.join(save_dir, "index.pkl"))
# Save index files to storage
storage.save_file(file_faiss, f"{index_base_path}/index.faiss")
storage.save_file(file_pkl, f"{index_base_path}/index.pkl")
existing_entry = sources_collection.find_one({"_id": ObjectId(id)})
if existing_entry:

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,13 @@
from datetime import timedelta
from application.celery_init import celery
from application.worker import ingest_worker, remote_worker, sync_worker
from application.worker import (
agent_webhook_worker,
attachment_worker,
ingest_worker,
remote_worker,
sync_worker,
)
@celery.task(bind=True)
@@ -22,6 +28,18 @@ def schedule_syncs(self, frequency):
return resp
@celery.task(bind=True)
def store_attachment(self, file_info, user):
resp = attachment_worker(self, file_info, user)
return resp
@celery.task(bind=True)
def process_agent_webhook(self, agent_id, payload):
resp = agent_webhook_worker(self, agent_id, payload)
return resp
@celery.on_after_configure.connect
def setup_periodic_tasks(sender, **kwargs):
sender.add_periodic_task(

View File

@@ -1,15 +1,24 @@
import os
import platform
import uuid
import dotenv
from flask import Flask, redirect, request
from flask import Flask, jsonify, redirect, request
from jose import jwt
from application.auth import handle_auth
from application.api.answer.routes import answer
from application.api.internal.routes import internal
from application.api.user.routes import user
from application.celery_init import celery
from application.core.logging_config import setup_logging
from application.core.settings import settings
from application.extensions import api
setup_logging()
from application.api.answer.routes import answer # noqa: E402
from application.api.internal.routes import internal # noqa: E402
from application.api.user.routes import user # noqa: E402
from application.celery_init import celery # noqa: E402
from application.core.settings import settings # noqa: E402
from application.extensions import api # noqa: E402
if platform.system() == "Windows":
import pathlib
@@ -17,7 +26,6 @@ if platform.system() == "Windows":
pathlib.PosixPath = pathlib.WindowsPath
dotenv.load_dotenv()
setup_logging()
app = Flask(__name__)
app.register_blueprint(user)
@@ -32,6 +40,25 @@ app.config.update(
celery.config_from_object("application.celeryconfig")
api.init_app(app)
if settings.AUTH_TYPE in ("simple_jwt", "session_jwt") and not settings.JWT_SECRET_KEY:
key_file = ".jwt_secret_key"
try:
with open(key_file, "r") as f:
settings.JWT_SECRET_KEY = f.read().strip()
except FileNotFoundError:
new_key = os.urandom(32).hex()
with open(key_file, "w") as f:
f.write(new_key)
settings.JWT_SECRET_KEY = new_key
except Exception as e:
raise RuntimeError(f"Failed to setup JWT_SECRET_KEY: {e}")
SIMPLE_JWT_TOKEN = None
if settings.AUTH_TYPE == "simple_jwt":
payload = {"sub": "local"}
SIMPLE_JWT_TOKEN = jwt.encode(payload, settings.JWT_SECRET_KEY, algorithm="HS256")
print(f"Generated Simple JWT Token: {SIMPLE_JWT_TOKEN}")
@app.route("/")
def home():
@@ -41,11 +68,47 @@ def home():
return "Welcome to DocsGPT Backend!"
@app.route("/api/config")
def get_config():
response = {
"auth_type": settings.AUTH_TYPE,
"requires_auth": settings.AUTH_TYPE in ["simple_jwt", "session_jwt"],
}
return jsonify(response)
@app.route("/api/generate_token")
def generate_token():
if settings.AUTH_TYPE == "session_jwt":
new_user_id = str(uuid.uuid4())
token = jwt.encode(
{"sub": new_user_id}, settings.JWT_SECRET_KEY, algorithm="HS256"
)
return jsonify({"token": token})
return jsonify({"error": "Token generation not allowed in current auth mode"}), 400
@app.before_request
def authenticate_request():
if request.method == "OPTIONS":
return "", 200
decoded_token = handle_auth(request)
if not decoded_token:
request.decoded_token = None
elif "error" in decoded_token:
return jsonify(decoded_token), 401
else:
request.decoded_token = decoded_token
@app.after_request
def after_request(response):
response.headers.add("Access-Control-Allow-Origin", "*")
response.headers.add("Access-Control-Allow-Headers", "Content-Type,Authorization")
response.headers.add("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS")
response.headers.add("Access-Control-Allow-Headers", "Content-Type, Authorization")
response.headers.add(
"Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"
)
return response

28
application/auth.py Normal file
View File

@@ -0,0 +1,28 @@
from jose import jwt
from application.core.settings import settings
def handle_auth(request, data={}):
if settings.AUTH_TYPE in ["simple_jwt", "session_jwt"]:
jwt_token = request.headers.get("Authorization")
if not jwt_token:
return None
jwt_token = jwt_token.replace("Bearer ", "")
try:
decoded_token = jwt.decode(
jwt_token,
settings.JWT_SECRET_KEY,
algorithms=["HS256"],
options={"verify_exp": False},
)
return decoded_token
except Exception as e:
return {
"message": f"Authentication error: {str(e)}",
"error": "invalid_token",
}
else:
return {"sub": "local"}

View File

@@ -1,93 +1,117 @@
import redis
import time
import json
import logging
import time
from threading import Lock
import redis
from application.core.settings import settings
from application.utils import get_hash
logger = logging.getLogger(__name__)
_redis_instance = None
_redis_creation_failed = False
_instance_lock = Lock()
def get_redis_instance():
global _redis_instance
if _redis_instance is None:
global _redis_instance, _redis_creation_failed
if _redis_instance is None and not _redis_creation_failed:
with _instance_lock:
if _redis_instance is None:
if _redis_instance is None and not _redis_creation_failed:
try:
_redis_instance = redis.Redis.from_url(settings.CACHE_REDIS_URL, socket_connect_timeout=2)
_redis_instance = redis.Redis.from_url(
settings.CACHE_REDIS_URL, socket_connect_timeout=2
)
except ValueError as e:
logger.error(f"Invalid Redis URL: {e}")
_redis_creation_failed = True # Stop future attempts
_redis_instance = None
except redis.ConnectionError as e:
logger.error(f"Redis connection error: {e}")
_redis_instance = None
_redis_instance = None # Keep trying for connection errors
return _redis_instance
def gen_cache_key(*messages, model="docgpt"):
def gen_cache_key(messages, model="docgpt", tools=None):
if not all(isinstance(msg, dict) for msg in messages):
raise ValueError("All messages must be dictionaries.")
messages_str = json.dumps(list(messages), sort_keys=True)
combined = f"{model}_{messages_str}"
messages_str = json.dumps(messages)
tools_str = json.dumps(str(tools)) if tools else ""
combined = f"{model}_{messages_str}_{tools_str}"
cache_key = get_hash(combined)
return cache_key
def gen_cache(func):
def wrapper(self, model, messages, *args, **kwargs):
def wrapper(self, model, messages, stream, tools=None, *args, **kwargs):
if tools is not None:
return func(self, model, messages, stream, tools, *args, **kwargs)
try:
cache_key = gen_cache_key(*messages)
redis_client = get_redis_instance()
if redis_client:
try:
cached_response = redis_client.get(cache_key)
if cached_response:
return cached_response.decode('utf-8')
except redis.ConnectionError as e:
logger.error(f"Redis connection error: {e}")
result = func(self, model, messages, *args, **kwargs)
if redis_client:
try:
redis_client.set(cache_key, result, ex=1800)
except redis.ConnectionError as e:
logger.error(f"Redis connection error: {e}")
return result
cache_key = gen_cache_key(messages, model, tools)
except ValueError as e:
logger.error(e)
return "Error: No user message found in the conversation to generate a cache key."
logger.error(f"Cache key generation failed: {e}")
return func(self, model, messages, stream, tools, *args, **kwargs)
redis_client = get_redis_instance()
if redis_client:
try:
cached_response = redis_client.get(cache_key)
if cached_response:
return cached_response.decode("utf-8")
except Exception as e:
logger.error(f"Error getting cached response: {e}", exc_info=True)
result = func(self, model, messages, stream, tools, *args, **kwargs)
if redis_client and isinstance(result, str):
try:
redis_client.set(cache_key, result, ex=1800)
except Exception as e:
logger.error(f"Error setting cache: {e}", exc_info=True)
return result
return wrapper
def stream_cache(func):
def wrapper(self, model, messages, stream, *args, **kwargs):
cache_key = gen_cache_key(*messages)
logger.info(f"Stream cache key: {cache_key}")
def wrapper(self, model, messages, stream, tools=None, *args, **kwargs):
if tools is not None:
yield from func(self, model, messages, stream, tools, *args, **kwargs)
return
try:
cache_key = gen_cache_key(messages, model, tools)
except ValueError as e:
logger.error(f"Cache key generation failed: {e}")
yield from func(self, model, messages, stream, tools, *args, **kwargs)
return
redis_client = get_redis_instance()
if redis_client:
try:
cached_response = redis_client.get(cache_key)
if cached_response:
logger.info(f"Cache hit for stream key: {cache_key}")
cached_response = json.loads(cached_response.decode('utf-8'))
cached_response = json.loads(cached_response.decode("utf-8"))
for chunk in cached_response:
yield chunk
time.sleep(0.03)
time.sleep(0.03) # Simulate streaming delay
return
except redis.ConnectionError as e:
logger.error(f"Redis connection error: {e}")
except Exception as e:
logger.error(f"Error getting cached stream: {e}", exc_info=True)
result = func(self, model, messages, stream, *args, **kwargs)
stream_cache_data = []
for chunk in result:
stream_cache_data.append(chunk)
for chunk in func(self, model, messages, stream, tools, *args, **kwargs):
yield chunk
stream_cache_data.append(str(chunk))
if redis_client:
try:
redis_client.set(cache_key, json.dumps(stream_cache_data), ex=1800)
logger.info(f"Stream cache saved for key: {cache_key}")
except redis.ConnectionError as e:
logger.error(f"Redis connection error: {e}")
return wrapper
except Exception as e:
logger.error(f"Error setting stream cache: {e}", exc_info=True)
return wrapper

View File

@@ -2,14 +2,22 @@ from celery import Celery
from application.core.settings import settings
from celery.signals import setup_logging
def make_celery(app_name=__name__):
celery = Celery(app_name, broker=settings.CELERY_BROKER_URL, backend=settings.CELERY_RESULT_BACKEND)
celery = Celery(
app_name,
broker=settings.CELERY_BROKER_URL,
backend=settings.CELERY_RESULT_BACKEND,
)
celery.conf.update(settings)
return celery
@setup_logging.connect
def config_loggers(*args, **kwargs):
from application.core.logging_config import setup_logging
setup_logging()
celery = make_celery()

View File

@@ -1,25 +1,40 @@
import os
from pathlib import Path
from typing import Optional
import os
from pydantic_settings import BaseSettings
current_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
current_dir = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
class Settings(BaseSettings):
AUTH_TYPE: Optional[str] = None
LLM_NAME: str = "docsgpt"
MODEL_NAME: Optional[str] = None # if LLM_NAME is openai, MODEL_NAME can be gpt-4 or gpt-3.5-turbo
MODEL_NAME: Optional[str] = (
None # if LLM_NAME is openai, MODEL_NAME can be gpt-4 or gpt-3.5-turbo
)
EMBEDDINGS_NAME: str = "huggingface_sentence-transformers/all-mpnet-base-v2"
CELERY_BROKER_URL: str = "redis://localhost:6379/0"
CELERY_RESULT_BACKEND: str = "redis://localhost:6379/1"
MONGO_URI: str = "mongodb://localhost:27017/docsgpt"
MONGO_DB_NAME: str = "docsgpt"
MODEL_PATH: str = os.path.join(current_dir, "models/docsgpt-7b-f16.gguf")
DEFAULT_MAX_HISTORY: int = 150
MODEL_TOKEN_LIMITS: dict = {"gpt-3.5-turbo": 4096, "claude-2": 1e5}
MODEL_TOKEN_LIMITS: dict = {
"gpt-4o-mini": 128000,
"gpt-3.5-turbo": 4096,
"claude-2": 1e5,
"gemini-2.0-flash-exp": 1e6,
}
UPLOAD_FOLDER: str = "inputs"
VECTOR_STORE: str = "faiss" # "faiss" or "elasticsearch" or "qdrant" or "milvus" or "lancedb"
RETRIEVERS_ENABLED: list = ["classic_rag", "duckduck_search"] # also brave_search
PARSE_PDF_AS_IMAGE: bool = False
VECTOR_STORE: str = (
"faiss" # "faiss" or "elasticsearch" or "qdrant" or "milvus" or "lancedb"
)
RETRIEVERS_ENABLED: list = ["classic_rag", "duckduck_search"] # also brave_search
AGENT_NAME: str = "classic"
# LLM Cache
CACHE_REDIS_URL: str = "redis://localhost:6379/2"
@@ -27,12 +42,18 @@ class Settings(BaseSettings):
API_URL: str = "http://localhost:7091" # backend url for celery worker
API_KEY: Optional[str] = None # LLM api key
EMBEDDINGS_KEY: Optional[str] = None # api key for embeddings (if using openai, just copy API_KEY)
EMBEDDINGS_KEY: Optional[str] = (
None # api key for embeddings (if using openai, just copy API_KEY)
)
OPENAI_API_BASE: Optional[str] = None # azure openai api base url
OPENAI_API_VERSION: Optional[str] = None # azure openai api version
AZURE_DEPLOYMENT_NAME: Optional[str] = None # azure deployment name for answering
AZURE_EMBEDDINGS_DEPLOYMENT_NAME: Optional[str] = None # azure deployment name for embeddings
OPENAI_BASE_URL: Optional[str] = None # openai base url for open ai compatable models
AZURE_EMBEDDINGS_DEPLOYMENT_NAME: Optional[str] = (
None # azure deployment name for embeddings
)
OPENAI_BASE_URL: Optional[str] = (
None # openai base url for open ai compatable models
)
# elasticsearch
ELASTIC_CLOUD_ID: Optional[str] = None # cloud id for elasticsearch
@@ -67,15 +88,21 @@ class Settings(BaseSettings):
# Milvus vectorstore config
MILVUS_COLLECTION_NAME: Optional[str] = "docsgpt"
MILVUS_URI: Optional[str] = "./milvus_local.db" # milvus lite version as default
MILVUS_URI: Optional[str] = "./milvus_local.db" # milvus lite version as default
MILVUS_TOKEN: Optional[str] = ""
# LanceDB vectorstore config
LANCEDB_PATH: str = "/tmp/lancedb" # Path where LanceDB stores its local data
LANCEDB_TABLE_NAME: Optional[str] = "docsgpts" # Name of the table to use for storing vectors
LANCEDB_TABLE_NAME: Optional[str] = (
"docsgpts" # Name of the table to use for storing vectors
)
BRAVE_SEARCH_API_KEY: Optional[str] = None
FLASK_DEBUG_MODE: bool = False
STORAGE_TYPE: str = "local" # local or s3
JWT_SECRET_KEY: str = ""
path = Path(__file__).parent.parent.absolute()

View File

@@ -17,7 +17,7 @@ class AnthropicLLM(BaseLLM):
self.AI_PROMPT = AI_PROMPT
def _raw_gen(
self, baseself, model, messages, stream=False, max_tokens=300, **kwargs
self, baseself, model, messages, stream=False, tools=None, max_tokens=300, **kwargs
):
context = messages[0]["content"]
user_question = messages[-1]["content"]
@@ -34,7 +34,7 @@ class AnthropicLLM(BaseLLM):
return completion.completion
def _raw_gen_stream(
self, baseself, model, messages, stream=True, max_tokens=300, **kwargs
self, baseself, model, messages, stream=True, tools=None, max_tokens=300, **kwargs
):
context = messages[0]["content"]
user_question = messages[-1]["content"]

View File

@@ -1,10 +1,12 @@
from abc import ABC, abstractmethod
from application.cache import gen_cache, stream_cache
from application.usage import gen_token_usage, stream_token_usage
from application.cache import stream_cache, gen_cache
class BaseLLM(ABC):
def __init__(self):
def __init__(self, decoded_token=None):
self.decoded_token = decoded_token
self.token_usage = {"prompt_tokens": 0, "generated_tokens": 0}
def _apply_decorator(self, method, decorators, *args, **kwargs):
@@ -13,17 +15,52 @@ class BaseLLM(ABC):
return method(self, *args, **kwargs)
@abstractmethod
def _raw_gen(self, model, messages, stream, *args, **kwargs):
def _raw_gen(self, model, messages, stream, tools, *args, **kwargs):
pass
def gen(self, model, messages, stream=False, *args, **kwargs):
def gen(self, model, messages, stream=False, tools=None, *args, **kwargs):
decorators = [gen_token_usage, gen_cache]
return self._apply_decorator(self._raw_gen, decorators=decorators, model=model, messages=messages, stream=stream, *args, **kwargs)
return self._apply_decorator(
self._raw_gen,
decorators=decorators,
model=model,
messages=messages,
stream=stream,
tools=tools,
*args,
**kwargs
)
@abstractmethod
def _raw_gen_stream(self, model, messages, stream, *args, **kwargs):
pass
def gen_stream(self, model, messages, stream=True, *args, **kwargs):
def gen_stream(self, model, messages, stream=True, tools=None, *args, **kwargs):
decorators = [stream_cache, stream_token_usage]
return self._apply_decorator(self._raw_gen_stream, decorators=decorators, model=model, messages=messages, stream=stream, *args, **kwargs)
return self._apply_decorator(
self._raw_gen_stream,
decorators=decorators,
model=model,
messages=messages,
stream=stream,
tools=tools,
*args,
**kwargs
)
def supports_tools(self):
return hasattr(self, "_supports_tools") and callable(
getattr(self, "_supports_tools")
)
def _supports_tools(self):
raise NotImplementedError("Subclass must implement _supports_tools method")
def get_supported_attachment_types(self):
"""
Return a list of MIME types supported by this LLM for file uploads.
Returns:
list: List of supported MIME types
"""
return [] # Default: no attachments supported

View File

@@ -1,44 +1,131 @@
from application.llm.base import BaseLLM
import json
import requests
from application.core.settings import settings
from application.llm.base import BaseLLM
class DocsGPTAPILLM(BaseLLM):
def __init__(self, api_key=None, user_api_key=None, *args, **kwargs):
from openai import OpenAI
super().__init__(*args, **kwargs)
self.api_key = api_key
self.client = OpenAI(api_key="sk-docsgpt-public", base_url="https://oai.arc53.com")
self.user_api_key = user_api_key
self.endpoint = "https://llm.docsgpt.co.uk"
self.api_key = api_key
def _raw_gen(self, baseself, model, messages, stream=False, *args, **kwargs):
context = messages[0]["content"]
user_question = messages[-1]["content"]
prompt = f"### Instruction \n {user_question} \n ### Context \n {context} \n ### Answer \n"
def _clean_messages_openai(self, messages):
cleaned_messages = []
for message in messages:
role = message.get("role")
content = message.get("content")
response = requests.post(
f"{self.endpoint}/answer", json={"prompt": prompt, "max_new_tokens": 30}
)
response_clean = response.json()["a"].replace("###", "")
if role == "model":
role = "assistant"
return response_clean
if role and content is not None:
if isinstance(content, str):
cleaned_messages.append({"role": role, "content": content})
elif isinstance(content, list):
for item in content:
if "text" in item:
cleaned_messages.append(
{"role": role, "content": item["text"]}
)
elif "function_call" in item:
tool_call = {
"id": item["function_call"]["call_id"],
"type": "function",
"function": {
"name": item["function_call"]["name"],
"arguments": json.dumps(
item["function_call"]["args"]
),
},
}
cleaned_messages.append(
{
"role": "assistant",
"content": None,
"tool_calls": [tool_call],
}
)
elif "function_response" in item:
cleaned_messages.append(
{
"role": "tool",
"tool_call_id": item["function_response"][
"call_id"
],
"content": json.dumps(
item["function_response"]["response"]["result"]
),
}
)
else:
raise ValueError(
f"Unexpected content dictionary format: {item}"
)
else:
raise ValueError(f"Unexpected content type: {type(content)}")
def _raw_gen_stream(self, baseself, model, messages, stream=True, *args, **kwargs):
context = messages[0]["content"]
user_question = messages[-1]["content"]
prompt = f"### Instruction \n {user_question} \n ### Context \n {context} \n ### Answer \n"
return cleaned_messages
# send prompt to endpoint /stream
response = requests.post(
f"{self.endpoint}/stream",
json={"prompt": prompt, "max_new_tokens": 256},
stream=True,
)
def _raw_gen(
self,
baseself,
model,
messages,
stream=False,
tools=None,
engine=settings.AZURE_DEPLOYMENT_NAME,
**kwargs,
):
messages = self._clean_messages_openai(messages)
if tools:
response = self.client.chat.completions.create(
model="docsgpt",
messages=messages,
stream=stream,
tools=tools,
**kwargs,
)
return response.choices[0]
else:
response = self.client.chat.completions.create(
model="docsgpt", messages=messages, stream=stream, **kwargs
)
return response.choices[0].message.content
for line in response.iter_lines():
if line:
# data = json.loads(line)
data_str = line.decode("utf-8")
if data_str.startswith("data: "):
data = json.loads(data_str[6:])
yield data["a"]
def _raw_gen_stream(
self,
baseself,
model,
messages,
stream=True,
tools=None,
engine=settings.AZURE_DEPLOYMENT_NAME,
**kwargs,
):
messages = self._clean_messages_openai(messages)
if tools:
response = self.client.chat.completions.create(
model="docsgpt",
messages=messages,
stream=stream,
tools=tools,
**kwargs,
)
else:
response = self.client.chat.completions.create(
model="docsgpt", messages=messages, stream=stream, **kwargs
)
for line in response:
if len(line.choices) > 0 and line.choices[0].delta.content is not None and len(line.choices[0].delta.content) > 0:
yield line.choices[0].delta.content
elif len(line.choices) > 0:
yield line.choices[0]
def _supports_tools(self):
return True

View File

@@ -0,0 +1,313 @@
from google import genai
from google.genai import types
import logging
import json
from application.llm.base import BaseLLM
from application.storage.storage_creator import StorageCreator
from application.core.settings import settings
class GoogleLLM(BaseLLM):
def __init__(self, api_key=None, user_api_key=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.api_key = api_key
self.user_api_key = user_api_key
self.client = genai.Client(api_key=self.api_key)
self.storage = StorageCreator.get_storage()
def get_supported_attachment_types(self):
"""
Return a list of MIME types supported by Google Gemini for file uploads.
Returns:
list: List of supported MIME types
"""
return [
'application/pdf',
'image/png',
'image/jpeg',
'image/jpg',
'image/webp',
'image/gif'
]
def prepare_messages_with_attachments(self, messages, attachments=None):
"""
Process attachments using Google AI's file API for more efficient handling.
Args:
messages (list): List of message dictionaries.
attachments (list): List of attachment dictionaries with content and metadata.
Returns:
list: Messages formatted with file references for Google AI API.
"""
if not attachments:
return messages
prepared_messages = messages.copy()
# Find the user message to attach files to the last one
user_message_index = None
for i in range(len(prepared_messages) - 1, -1, -1):
if prepared_messages[i].get("role") == "user":
user_message_index = i
break
if user_message_index is None:
user_message = {"role": "user", "content": []}
prepared_messages.append(user_message)
user_message_index = len(prepared_messages) - 1
if isinstance(prepared_messages[user_message_index].get("content"), str):
text_content = prepared_messages[user_message_index]["content"]
prepared_messages[user_message_index]["content"] = [
{"type": "text", "text": text_content}
]
elif not isinstance(prepared_messages[user_message_index].get("content"), list):
prepared_messages[user_message_index]["content"] = []
files = []
for attachment in attachments:
mime_type = attachment.get('mime_type')
if mime_type in self.get_supported_attachment_types():
try:
file_uri = self._upload_file_to_google(attachment)
logging.info(f"GoogleLLM: Successfully uploaded file, got URI: {file_uri}")
files.append({"file_uri": file_uri, "mime_type": mime_type})
except Exception as e:
logging.error(f"GoogleLLM: Error uploading file: {e}", exc_info=True)
if 'content' in attachment:
prepared_messages[user_message_index]["content"].append({
"type": "text",
"text": f"[File could not be processed: {attachment.get('path', 'unknown')}]"
})
if files:
logging.info(f"GoogleLLM: Adding {len(files)} files to message")
prepared_messages[user_message_index]["content"].append({
"files": files
})
return prepared_messages
def _upload_file_to_google(self, attachment):
"""
Upload a file to Google AI and return the file URI.
Args:
attachment (dict): Attachment dictionary with path and metadata.
Returns:
str: Google AI file URI for the uploaded file.
"""
if 'google_file_uri' in attachment:
return attachment['google_file_uri']
file_path = attachment.get('path')
if not file_path:
raise ValueError("No file path provided in attachment")
if not self.storage.file_exists(file_path):
raise FileNotFoundError(f"File not found: {file_path}")
try:
file_uri = self.storage.process_file(
file_path,
lambda local_path, **kwargs: self.client.files.upload(file=local_path).uri
)
from application.core.mongo_db import MongoDB
mongo = MongoDB.get_client()
db = mongo[settings.MONGO_DB_NAME]
attachments_collection = db["attachments"]
if '_id' in attachment:
attachments_collection.update_one(
{"_id": attachment['_id']},
{"$set": {"google_file_uri": file_uri}}
)
return file_uri
except Exception as e:
logging.error(f"Error uploading file to Google AI: {e}", exc_info=True)
raise
def _clean_messages_google(self, messages):
cleaned_messages = []
for message in messages:
role = message.get("role")
content = message.get("content")
if role == "assistant":
role = "model"
parts = []
if role and content is not None:
if isinstance(content, str):
parts = [types.Part.from_text(text=content)]
elif isinstance(content, list):
for item in content:
if "text" in item:
parts.append(types.Part.from_text(text=item["text"]))
elif "function_call" in item:
parts.append(
types.Part.from_function_call(
name=item["function_call"]["name"],
args=item["function_call"]["args"],
)
)
elif "function_response" in item:
parts.append(
types.Part.from_function_response(
name=item["function_response"]["name"],
response=item["function_response"]["response"],
)
)
elif "files" in item:
for file_data in item["files"]:
parts.append(
types.Part.from_uri(
file_uri=file_data["file_uri"],
mime_type=file_data["mime_type"]
)
)
else:
raise ValueError(
f"Unexpected content dictionary format:{item}"
)
else:
raise ValueError(f"Unexpected content type: {type(content)}")
cleaned_messages.append(types.Content(role=role, parts=parts))
return cleaned_messages
def _clean_tools_format(self, tools_list):
genai_tools = []
for tool_data in tools_list:
if tool_data["type"] == "function":
function = tool_data["function"]
parameters = function["parameters"]
properties = parameters.get("properties", {})
if properties:
genai_function = dict(
name=function["name"],
description=function["description"],
parameters={
"type": "OBJECT",
"properties": {
k: {
**v,
"type": v["type"].upper() if v["type"] else None,
}
for k, v in properties.items()
},
"required": (
parameters["required"]
if "required" in parameters
else []
),
},
)
else:
genai_function = dict(
name=function["name"],
description=function["description"],
)
genai_tool = types.Tool(function_declarations=[genai_function])
genai_tools.append(genai_tool)
return genai_tools
def _raw_gen(
self,
baseself,
model,
messages,
stream=False,
tools=None,
formatting="openai",
**kwargs,
):
client = genai.Client(api_key=self.api_key)
if formatting == "openai":
messages = self._clean_messages_google(messages)
config = types.GenerateContentConfig()
if messages[0].role == "system":
config.system_instruction = messages[0].parts[0].text
messages = messages[1:]
if tools:
cleaned_tools = self._clean_tools_format(tools)
config.tools = cleaned_tools
response = client.models.generate_content(
model=model,
contents=messages,
config=config,
)
return response
else:
response = client.models.generate_content(
model=model, contents=messages, config=config
)
return response.text
def _raw_gen_stream(
self,
baseself,
model,
messages,
stream=True,
tools=None,
formatting="openai",
**kwargs,
):
client = genai.Client(api_key=self.api_key)
if formatting == "openai":
messages = self._clean_messages_google(messages)
config = types.GenerateContentConfig()
if messages[0].role == "system":
config.system_instruction = messages[0].parts[0].text
messages = messages[1:]
if tools:
cleaned_tools = self._clean_tools_format(tools)
config.tools = cleaned_tools
# Check if we have both tools and file attachments
has_attachments = False
for message in messages:
for part in message.parts:
if hasattr(part, 'file_data') and part.file_data is not None:
has_attachments = True
break
if has_attachments:
break
logging.info(f"GoogleLLM: Starting stream generation. Model: {model}, Messages: {json.dumps(messages, default=str)}, Has attachments: {has_attachments}")
response = client.models.generate_content_stream(
model=model,
contents=messages,
config=config,
)
for chunk in response:
if hasattr(chunk, "candidates") and chunk.candidates:
for candidate in chunk.candidates:
if candidate.content and candidate.content.parts:
for part in candidate.content.parts:
if part.function_call:
yield part
elif part.text:
yield part.text
elif hasattr(chunk, "text"):
yield chunk.text
def _supports_tools(self):
return True

View File

@@ -1,45 +1,32 @@
from application.llm.base import BaseLLM
from openai import OpenAI
class GroqLLM(BaseLLM):
def __init__(self, api_key=None, user_api_key=None, *args, **kwargs):
from openai import OpenAI
super().__init__(*args, **kwargs)
self.client = OpenAI(api_key=api_key, base_url="https://api.groq.com/openai/v1")
self.api_key = api_key
self.user_api_key = user_api_key
def _raw_gen(
self,
baseself,
model,
messages,
stream=False,
**kwargs
):
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
return response.choices[0].message.content
def _raw_gen(self, baseself, model, messages, stream=False, tools=None, **kwargs):
if tools:
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, tools=tools, **kwargs
)
return response.choices[0]
else:
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
return response.choices[0].message.content
def _raw_gen_stream(
self,
baseself,
model,
messages,
stream=True,
**kwargs
):
self, baseself, model, messages, stream=True, tools=None, **kwargs
):
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
for line in response:
# import sys
# print(line.choices[0].delta.content, file=sys.stderr)
if line.choices[0].delta.content is not None:
yield line.choices[0].delta.content

View File

@@ -6,6 +6,8 @@ from application.llm.llama_cpp import LlamaCpp
from application.llm.anthropic import AnthropicLLM
from application.llm.docsgpt_provider import DocsGPTAPILLM
from application.llm.premai import PremAILLM
from application.llm.google_ai import GoogleLLM
from application.llm.novita import NovitaLLM
class LLMCreator:
@@ -18,12 +20,16 @@ class LLMCreator:
"anthropic": AnthropicLLM,
"docsgpt": DocsGPTAPILLM,
"premai": PremAILLM,
"groq": GroqLLM
"groq": GroqLLM,
"google": GoogleLLM,
"novita": NovitaLLM,
}
@classmethod
def create_llm(cls, type, api_key, user_api_key, *args, **kwargs):
def create_llm(cls, type, api_key, user_api_key, decoded_token, *args, **kwargs):
llm_class = cls.llms.get(type.lower())
if not llm_class:
raise ValueError(f"No LLM class found for type {type}")
return llm_class(api_key, user_api_key, *args, **kwargs)
return llm_class(
api_key, user_api_key, decoded_token=decoded_token, *args, **kwargs
)

32
application/llm/novita.py Normal file
View File

@@ -0,0 +1,32 @@
from application.llm.base import BaseLLM
from openai import OpenAI
class NovitaLLM(BaseLLM):
def __init__(self, api_key=None, user_api_key=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.client = OpenAI(api_key=api_key, base_url="https://api.novita.ai/v3/openai")
self.api_key = api_key
self.user_api_key = user_api_key
def _raw_gen(self, baseself, model, messages, stream=False, tools=None, **kwargs):
if tools:
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, tools=tools, **kwargs
)
return response.choices[0]
else:
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
return response.choices[0].message.content
def _raw_gen_stream(
self, baseself, model, messages, stream=True, tools=None, **kwargs
):
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
for line in response:
if line.choices[0].delta.content is not None:
yield line.choices[0].delta.content

View File

@@ -1,6 +1,10 @@
from application.llm.base import BaseLLM
from application.core.settings import settings
import json
import base64
import logging
from application.core.settings import settings
from application.llm.base import BaseLLM
from application.storage.storage_creator import StorageCreator
class OpenAILLM(BaseLLM):
@@ -9,15 +13,82 @@ class OpenAILLM(BaseLLM):
from openai import OpenAI
super().__init__(*args, **kwargs)
if settings.OPENAI_BASE_URL:
self.client = OpenAI(
api_key=api_key,
base_url=settings.OPENAI_BASE_URL
)
if isinstance(settings.OPENAI_BASE_URL, str) and settings.OPENAI_BASE_URL.strip():
self.client = OpenAI(api_key=api_key, base_url=settings.OPENAI_BASE_URL)
else:
self.client = OpenAI(api_key=api_key)
DEFAULT_OPENAI_API_BASE = "https://api.openai.com/v1"
self.client = OpenAI(api_key=api_key, base_url=DEFAULT_OPENAI_API_BASE)
self.api_key = api_key
self.user_api_key = user_api_key
self.storage = StorageCreator.get_storage()
def _clean_messages_openai(self, messages):
cleaned_messages = []
for message in messages:
role = message.get("role")
content = message.get("content")
if role == "model":
role = "assistant"
if role and content is not None:
if isinstance(content, str):
cleaned_messages.append({"role": role, "content": content})
elif isinstance(content, list):
for item in content:
if "text" in item:
cleaned_messages.append(
{"role": role, "content": item["text"]}
)
elif "function_call" in item:
tool_call = {
"id": item["function_call"]["call_id"],
"type": "function",
"function": {
"name": item["function_call"]["name"],
"arguments": json.dumps(
item["function_call"]["args"]
),
},
}
cleaned_messages.append(
{
"role": "assistant",
"content": None,
"tool_calls": [tool_call],
}
)
elif "function_response" in item:
cleaned_messages.append(
{
"role": "tool",
"tool_call_id": item["function_response"][
"call_id"
],
"content": json.dumps(
item["function_response"]["response"]["result"]
),
}
)
elif isinstance(item, dict):
content_parts = []
if "text" in item:
content_parts.append({"type": "text", "text": item["text"]})
elif "type" in item and item["type"] == "text" and "text" in item:
content_parts.append(item)
elif "type" in item and item["type"] == "file" and "file" in item:
content_parts.append(item)
elif "type" in item and item["type"] == "image_url" and "image_url" in item:
content_parts.append(item)
cleaned_messages.append({"role": role, "content": content_parts})
else:
raise ValueError(
f"Unexpected content dictionary format: {item}"
)
else:
raise ValueError(f"Unexpected content type: {type(content)}")
return cleaned_messages
def _raw_gen(
self,
@@ -25,14 +96,25 @@ class OpenAILLM(BaseLLM):
model,
messages,
stream=False,
tools=None,
engine=settings.AZURE_DEPLOYMENT_NAME,
**kwargs
):
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
return response.choices[0].message.content
**kwargs,
):
messages = self._clean_messages_openai(messages)
if tools:
response = self.client.chat.completions.create(
model=model,
messages=messages,
stream=stream,
tools=tools,
**kwargs,
)
return response.choices[0]
else:
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
return response.choices[0].message.content
def _raw_gen_stream(
self,
@@ -40,34 +122,204 @@ class OpenAILLM(BaseLLM):
model,
messages,
stream=True,
tools=None,
engine=settings.AZURE_DEPLOYMENT_NAME,
**kwargs
):
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
**kwargs,
):
messages = self._clean_messages_openai(messages)
if tools:
response = self.client.chat.completions.create(
model=model,
messages=messages,
stream=stream,
tools=tools,
**kwargs,
)
else:
response = self.client.chat.completions.create(
model=model, messages=messages, stream=stream, **kwargs
)
for line in response:
# import sys
# print(line.choices[0].delta.content, file=sys.stderr)
if line.choices[0].delta.content is not None:
if len(line.choices) > 0 and line.choices[0].delta.content is not None and len(line.choices[0].delta.content) > 0:
yield line.choices[0].delta.content
elif len(line.choices) > 0:
yield line.choices[0]
def _supports_tools(self):
return True
def get_supported_attachment_types(self):
"""
Return a list of MIME types supported by OpenAI for file uploads.
Returns:
list: List of supported MIME types
"""
return [
'application/pdf',
'image/png',
'image/jpeg',
'image/jpg',
'image/webp',
'image/gif'
]
def prepare_messages_with_attachments(self, messages, attachments=None):
"""
Process attachments using OpenAI's file API for more efficient handling.
Args:
messages (list): List of message dictionaries.
attachments (list): List of attachment dictionaries with content and metadata.
Returns:
list: Messages formatted with file references for OpenAI API.
"""
if not attachments:
return messages
prepared_messages = messages.copy()
# Find the user message to attach file_id to the last one
user_message_index = None
for i in range(len(prepared_messages) - 1, -1, -1):
if prepared_messages[i].get("role") == "user":
user_message_index = i
break
if user_message_index is None:
user_message = {"role": "user", "content": []}
prepared_messages.append(user_message)
user_message_index = len(prepared_messages) - 1
if isinstance(prepared_messages[user_message_index].get("content"), str):
text_content = prepared_messages[user_message_index]["content"]
prepared_messages[user_message_index]["content"] = [
{"type": "text", "text": text_content}
]
elif not isinstance(prepared_messages[user_message_index].get("content"), list):
prepared_messages[user_message_index]["content"] = []
for attachment in attachments:
mime_type = attachment.get('mime_type')
if mime_type and mime_type.startswith('image/'):
try:
base64_image = self._get_base64_image(attachment)
prepared_messages[user_message_index]["content"].append({
"type": "image_url",
"image_url": {
"url": f"data:{mime_type};base64,{base64_image}"
}
})
except Exception as e:
logging.error(f"Error processing image attachment: {e}", exc_info=True)
if 'content' in attachment:
prepared_messages[user_message_index]["content"].append({
"type": "text",
"text": f"[Image could not be processed: {attachment.get('path', 'unknown')}]"
})
# Handle PDFs using the file API
elif mime_type == 'application/pdf':
try:
file_id = self._upload_file_to_openai(attachment)
prepared_messages[user_message_index]["content"].append({
"type": "file",
"file": {"file_id": file_id}
})
except Exception as e:
logging.error(f"Error uploading PDF to OpenAI: {e}", exc_info=True)
if 'content' in attachment:
prepared_messages[user_message_index]["content"].append({
"type": "text",
"text": f"File content:\n\n{attachment['content']}"
})
return prepared_messages
def _get_base64_image(self, attachment):
"""
Convert an image file to base64 encoding.
Args:
attachment (dict): Attachment dictionary with path and metadata.
Returns:
str: Base64-encoded image data.
"""
file_path = attachment.get('path')
if not file_path:
raise ValueError("No file path provided in attachment")
try:
with self.storage.get_file(file_path) as image_file:
return base64.b64encode(image_file.read()).decode('utf-8')
except FileNotFoundError:
raise FileNotFoundError(f"File not found: {file_path}")
def _upload_file_to_openai(self, attachment):
"""
Upload a file to OpenAI and return the file_id.
Args:
attachment (dict): Attachment dictionary with path and metadata.
Expected keys:
- path: Path to the file
- id: Optional MongoDB ID for caching
Returns:
str: OpenAI file_id for the uploaded file.
"""
import logging
if 'openai_file_id' in attachment:
return attachment['openai_file_id']
file_path = attachment.get('path')
if not self.storage.file_exists(file_path):
raise FileNotFoundError(f"File not found: {file_path}")
try:
file_id = self.storage.process_file(
file_path,
lambda local_path, **kwargs: self.client.files.create(
file=open(local_path, 'rb'),
purpose="assistants"
).id
)
from application.core.mongo_db import MongoDB
mongo = MongoDB.get_client()
db = mongo[settings.MONGO_DB_NAME]
attachments_collection = db["attachments"]
if '_id' in attachment:
attachments_collection.update_one(
{"_id": attachment['_id']},
{"$set": {"openai_file_id": file_id}}
)
return file_id
except Exception as e:
logging.error(f"Error uploading file to OpenAI: {e}", exc_info=True)
raise
class AzureOpenAILLM(OpenAILLM):
def __init__(
self, openai_api_key, openai_api_base, openai_api_version, deployment_name
self, api_key, user_api_key, *args, **kwargs
):
super().__init__(openai_api_key)
super().__init__(api_key)
self.api_base = (settings.OPENAI_API_BASE,)
self.api_version = (settings.OPENAI_API_VERSION,)
self.deployment_name = (settings.AZURE_DEPLOYMENT_NAME,)
from openai import AzureOpenAI
self.client = AzureOpenAI(
api_key=openai_api_key,
api_key=api_key,
api_version=settings.OPENAI_API_VERSION,
api_base=settings.OPENAI_API_BASE,
deployment_name=settings.AZURE_DEPLOYMENT_NAME,
azure_endpoint=settings.OPENAI_API_BASE
)

View File

@@ -76,7 +76,7 @@ class SagemakerAPILLM(BaseLLM):
self.endpoint = settings.SAGEMAKER_ENDPOINT
self.runtime = runtime
def _raw_gen(self, baseself, model, messages, stream=False, **kwargs):
def _raw_gen(self, baseself, model, messages, stream=False, tools=None, **kwargs):
context = messages[0]["content"]
user_question = messages[-1]["content"]
prompt = f"### Instruction \n {user_question} \n ### Context \n {context} \n ### Answer \n"
@@ -105,7 +105,7 @@ class SagemakerAPILLM(BaseLLM):
print(result[0]["generated_text"], file=sys.stderr)
return result[0]["generated_text"][len(prompt) :]
def _raw_gen_stream(self, baseself, model, messages, stream=True, **kwargs):
def _raw_gen_stream(self, baseself, model, messages, stream=True, tools=None, **kwargs):
context = messages[0]["content"]
user_question = messages[-1]["content"]
prompt = f"### Instruction \n {user_question} \n ### Context \n {context} \n ### Answer \n"

154
application/logging.py Normal file
View File

@@ -0,0 +1,154 @@
import datetime
import functools
import inspect
import logging
import uuid
from typing import Any, Callable, Dict, Generator, List
from application.core.mongo_db import MongoDB
from application.core.settings import settings
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
)
class LogContext:
def __init__(self, endpoint, activity_id, user, api_key, query):
self.endpoint = endpoint
self.activity_id = activity_id
self.user = user
self.api_key = api_key
self.query = query
self.stacks = []
def build_stack_data(
obj: Any,
include_attributes: List[str] = None,
exclude_attributes: List[str] = None,
custom_data: Dict = None,
) -> Dict:
if obj is None:
raise ValueError("The 'obj' parameter cannot be None")
data = {}
if include_attributes is None:
include_attributes = []
for name, value in inspect.getmembers(obj):
if (
not name.startswith("_")
and not inspect.ismethod(value)
and not inspect.isfunction(value)
):
include_attributes.append(name)
for attr_name in include_attributes:
if exclude_attributes and attr_name in exclude_attributes:
continue
try:
attr_value = getattr(obj, attr_name)
if attr_value is not None:
if isinstance(attr_value, (int, float, str, bool)):
data[attr_name] = attr_value
elif isinstance(attr_value, list):
if all(isinstance(item, dict) for item in attr_value):
data[attr_name] = attr_value
elif all(hasattr(item, "__dict__") for item in attr_value):
data[attr_name] = [item.__dict__ for item in attr_value]
else:
data[attr_name] = [str(item) for item in attr_value]
elif isinstance(attr_value, dict):
data[attr_name] = {k: str(v) for k, v in attr_value.items()}
except AttributeError as e:
logging.warning(f"AttributeError while accessing {attr_name}: {e}")
except AttributeError:
pass
if custom_data:
data.update(custom_data)
return data
def log_activity() -> Callable:
def decorator(func: Callable) -> Callable:
@functools.wraps(func)
def wrapper(*args: Any, **kwargs: Any) -> Any:
activity_id = str(uuid.uuid4())
data = build_stack_data(args[0])
endpoint = data.get("endpoint", "")
user = data.get("user", "local")
api_key = data.get("user_api_key", "")
query = kwargs.get("query", getattr(args[0], "query", ""))
context = LogContext(endpoint, activity_id, user, api_key, query)
kwargs["log_context"] = context
logging.info(
f"Starting activity: {endpoint} - {activity_id} - User: {user}"
)
generator = func(*args, **kwargs)
yield from _consume_and_log(generator, context)
return wrapper
return decorator
def _consume_and_log(generator: Generator, context: "LogContext"):
try:
for item in generator:
yield item
except Exception as e:
logging.exception(f"Error in {context.endpoint} - {context.activity_id}: {e}")
context.stacks.append({"component": "error", "data": {"message": str(e)}})
_log_to_mongodb(
endpoint=context.endpoint,
activity_id=context.activity_id,
user=context.user,
api_key=context.api_key,
query=context.query,
stacks=context.stacks,
level="error",
)
raise
finally:
_log_to_mongodb(
endpoint=context.endpoint,
activity_id=context.activity_id,
user=context.user,
api_key=context.api_key,
query=context.query,
stacks=context.stacks,
level="info",
)
def _log_to_mongodb(
endpoint: str,
activity_id: str,
user: str,
api_key: str,
query: str,
stacks: List[Dict],
level: str,
) -> None:
try:
mongo = MongoDB.get_client()
db = mongo[settings.MONGO_DB_NAME]
user_logs_collection = db["stack_logs"]
log_entry = {
"endpoint": endpoint,
"id": activity_id,
"level": level,
"user": user,
"api_key": api_key,
"query": query,
"stacks": stacks,
"timestamp": datetime.datetime.now(datetime.timezone.utc),
}
user_logs_collection.insert_one(log_entry)
logging.debug(f"Logged activity to MongoDB: {activity_id}")
except Exception as e:
logging.error(f"Failed to log to MongoDB: {e}", exc_info=True)

View File

@@ -0,0 +1,118 @@
import re
from typing import List, Tuple
import logging
from application.parser.schema.base import Document
from application.utils import get_encoding
logger = logging.getLogger(__name__)
class Chunker:
def __init__(
self,
chunking_strategy: str = "classic_chunk",
max_tokens: int = 2000,
min_tokens: int = 150,
duplicate_headers: bool = False,
):
if chunking_strategy not in ["classic_chunk"]:
raise ValueError(f"Unsupported chunking strategy: {chunking_strategy}")
self.chunking_strategy = chunking_strategy
self.max_tokens = max_tokens
self.min_tokens = min_tokens
self.duplicate_headers = duplicate_headers
self.encoding = get_encoding()
def separate_header_and_body(self, text: str) -> Tuple[str, str]:
header_pattern = r"^(.*?\n){3}"
match = re.match(header_pattern, text)
if match:
header = match.group(0)
body = text[len(header):]
else:
header, body = "", text # No header, treat entire text as body
return header, body
def combine_documents(self, doc: Document, next_doc: Document) -> Document:
combined_text = doc.text + " " + next_doc.text
combined_token_count = len(self.encoding.encode(combined_text))
new_doc = Document(
text=combined_text,
doc_id=doc.doc_id,
embedding=doc.embedding,
extra_info={**(doc.extra_info or {}), "token_count": combined_token_count}
)
return new_doc
def split_document(self, doc: Document) -> List[Document]:
split_docs = []
header, body = self.separate_header_and_body(doc.text)
header_tokens = self.encoding.encode(header) if header else []
body_tokens = self.encoding.encode(body)
current_position = 0
part_index = 0
while current_position < len(body_tokens):
end_position = current_position + self.max_tokens - len(header_tokens)
chunk_tokens = (header_tokens + body_tokens[current_position:end_position]
if self.duplicate_headers or part_index == 0 else body_tokens[current_position:end_position])
chunk_text = self.encoding.decode(chunk_tokens)
new_doc = Document(
text=chunk_text,
doc_id=f"{doc.doc_id}-{part_index}",
embedding=doc.embedding,
extra_info={**(doc.extra_info or {}), "token_count": len(chunk_tokens)}
)
split_docs.append(new_doc)
current_position = end_position
part_index += 1
header_tokens = []
return split_docs
def classic_chunk(self, documents: List[Document]) -> List[Document]:
processed_docs = []
i = 0
while i < len(documents):
doc = documents[i]
tokens = self.encoding.encode(doc.text)
token_count = len(tokens)
if self.min_tokens <= token_count <= self.max_tokens:
doc.extra_info = doc.extra_info or {}
doc.extra_info["token_count"] = token_count
processed_docs.append(doc)
i += 1
elif token_count < self.min_tokens:
if i + 1 < len(documents):
next_doc = documents[i + 1]
next_tokens = self.encoding.encode(next_doc.text)
if token_count + len(next_tokens) <= self.max_tokens:
# Combine small documents
combined_doc = self.combine_documents(doc, next_doc)
processed_docs.append(combined_doc)
i += 2
else:
# Keep the small document as is if adding next_doc would exceed max_tokens
doc.extra_info = doc.extra_info or {}
doc.extra_info["token_count"] = token_count
processed_docs.append(doc)
i += 1
else:
# No next document to combine with; add the small document as is
doc.extra_info = doc.extra_info or {}
doc.extra_info["token_count"] = token_count
processed_docs.append(doc)
i += 1
else:
# Split large documents
processed_docs.extend(self.split_document(doc))
i += 1
return processed_docs
def chunk(
self,
documents: List[Document]
) -> List[Document]:
if self.chunking_strategy == "classic_chunk":
return self.classic_chunk(documents)
else:
raise ValueError("Unsupported chunking strategy")

View File

@@ -0,0 +1,86 @@
import os
import logging
from retry import retry
from tqdm import tqdm
from application.core.settings import settings
from application.vectorstore.vector_creator import VectorCreator
@retry(tries=10, delay=60)
def add_text_to_store_with_retry(store, doc, source_id):
"""
Add a document's text and metadata to the vector store with retry logic.
Args:
store: The vector store object.
doc: The document to be added.
source_id: Unique identifier for the source.
"""
try:
doc.metadata["source_id"] = str(source_id)
store.add_texts([doc.page_content], metadatas=[doc.metadata])
except Exception as e:
logging.error(f"Failed to add document with retry: {e}", exc_info=True)
raise
def embed_and_store_documents(docs, folder_name, source_id, task_status):
"""
Embeds documents and stores them in a vector store.
Args:
docs (list): List of documents to be embedded and stored.
folder_name (str): Directory to save the vector store.
source_id (str): Unique identifier for the source.
task_status: Task state manager for progress updates.
Returns:
None
"""
# Ensure the folder exists
if not os.path.exists(folder_name):
os.makedirs(folder_name)
# Initialize vector store
if settings.VECTOR_STORE == "faiss":
docs_init = [docs.pop(0)]
store = VectorCreator.create_vectorstore(
settings.VECTOR_STORE,
docs_init=docs_init,
source_id=folder_name,
embeddings_key=os.getenv("EMBEDDINGS_KEY"),
)
else:
store = VectorCreator.create_vectorstore(
settings.VECTOR_STORE,
source_id=source_id,
embeddings_key=os.getenv("EMBEDDINGS_KEY"),
)
store.delete_index()
total_docs = len(docs)
# Process and embed documents
for idx, doc in tqdm(
enumerate(docs),
desc="Embedding 🦖",
unit="docs",
total=total_docs,
bar_format="{l_bar}{bar}| Time Left: {remaining}",
):
try:
# Update task status for progress tracking
progress = int(((idx + 1) / total_docs) * 100)
task_status.update_state(state="PROGRESS", meta={"current": progress})
# Add document to vector store
add_text_to_store_with_retry(store, doc, source_id)
except Exception as e:
logging.error(f"Error embedding document {idx}: {e}", exc_info=True)
logging.info(f"Saving progress at document {idx} out of {total_docs}")
store.save_local(folder_name)
break
# Save the vector store
if settings.VECTOR_STORE == "faiss":
store.save_local(folder_name)
logging.info("Vector store saved successfully.")

View File

@@ -13,6 +13,7 @@ from application.parser.file.rst_parser import RstParser
from application.parser.file.tabular_parser import PandasCSVParser,ExcelParser
from application.parser.file.json_parser import JSONParser
from application.parser.file.pptx_parser import PPTXParser
from application.parser.file.image_parser import ImageParser
from application.parser.schema.base import Document
DEFAULT_FILE_EXTRACTOR: Dict[str, BaseParser] = {
@@ -27,6 +28,9 @@ DEFAULT_FILE_EXTRACTOR: Dict[str, BaseParser] = {
".mdx": MarkdownParser(),
".json":JSONParser(),
".pptx":PPTXParser(),
".png": ImageParser(),
".jpg": ImageParser(),
".jpeg": ImageParser(),
}
@@ -154,7 +158,7 @@ class SimpleDirectoryReader(BaseReader):
data = f.read()
# Prepare metadata for this file
if self.file_metadata is not None:
file_metadata = self.file_metadata(str(input_file))
file_metadata = self.file_metadata(input_file.name)
else:
# Provide a default empty metadata
file_metadata = {'title': '', 'store': ''}

View File

@@ -7,7 +7,8 @@ from pathlib import Path
from typing import Dict
from application.parser.file.base_parser import BaseParser
from application.core.settings import settings
import requests
class PDFParser(BaseParser):
"""PDF parser."""
@@ -18,22 +19,32 @@ class PDFParser(BaseParser):
def parse_file(self, file: Path, errors: str = "ignore") -> str:
"""Parse file."""
if settings.PARSE_PDF_AS_IMAGE:
doc2md_service = "https://llm.arc53.com/doc2md"
# alternatively you can use local vision capable LLM
with open(file, "rb") as file_loaded:
files = {'file': file_loaded}
response = requests.post(doc2md_service, files=files)
data = response.json()["markdown"]
return data
try:
import PyPDF2
from pypdf import PdfReader
except ImportError:
raise ValueError("PyPDF2 is required to read PDF files.")
raise ValueError("pypdf is required to read PDF files.")
text_list = []
with open(file, "rb") as fp:
# Create a PDF object
pdf = PyPDF2.PdfReader(fp)
pdf = PdfReader(fp)
# Get the number of pages in the PDF document
num_pages = len(pdf.pages)
# Iterate over every page
for page in range(num_pages):
for page_index in range(num_pages):
# Extract the text from the page
page_text = pdf.pages[page].extract_text()
page = pdf.pages[page_index]
page_text = page.extract_text()
text_list.append(page_text)
text = "\n".join(text_list)
@@ -56,4 +67,4 @@ class DocxParser(BaseParser):
text = docx2txt.process(file)
return text
return text

View File

@@ -0,0 +1,27 @@
"""Image parser.
Contains parser for .png, .jpg, .jpeg files.
"""
from pathlib import Path
import requests
from typing import Dict, Union
from application.parser.file.base_parser import BaseParser
class ImageParser(BaseParser):
"""Image parser."""
def _init_parser(self) -> Dict:
"""Init parser."""
return {}
def parse_file(self, file: Path, errors: str = "ignore") -> Union[str, list[str]]:
doc2md_service = "https://llm.arc53.com/doc2md"
# alternatively you can use local vision capable LLM
with open(file, "rb") as file_loaded:
files = {'file': file_loaded}
response = requests.post(doc2md_service, files=files)
data = response.json()["markdown"]
return data

View File

@@ -91,6 +91,25 @@ class RstParser(BaseParser):
]
return rst_tups
def chunk_by_token_count(self, text: str, max_tokens: int = 100) -> List[str]:
"""Chunk text by token count."""
avg_token_length = 5
chunk_size = max_tokens * avg_token_length
chunks = []
for i in range(0, len(text), chunk_size):
chunk = text[i:i+chunk_size]
if i + chunk_size < len(text):
last_space = chunk.rfind(' ')
if last_space != -1:
chunk = chunk[:last_space]
chunks.append(chunk.strip())
return chunks
def remove_images(self, content: str) -> str:
pattern = r"\.\. image:: (.*)"
content = re.sub(pattern, "", content)
@@ -136,7 +155,7 @@ class RstParser(BaseParser):
return {}
def parse_tups(
self, filepath: Path, errors: str = "ignore"
self, filepath: Path, errors: str = "ignore",max_tokens: Optional[int] = 1000
) -> List[Tuple[Optional[str], str]]:
"""Parse file into tuples."""
with open(filepath, "r") as f:
@@ -156,6 +175,15 @@ class RstParser(BaseParser):
rst_tups = self.remove_whitespaces_excess(rst_tups)
if self._remove_characters_excess:
rst_tups = self.remove_characters_excess(rst_tups)
# Apply chunking if max_tokens is provided
if max_tokens is not None:
chunked_tups = []
for header, text in rst_tups:
chunks = self.chunk_by_token_count(text, max_tokens)
for idx, chunk in enumerate(chunks):
chunked_tups.append((f"{header} - Chunk {idx + 1}", chunk))
return chunked_tups
return rst_tups
def parse_file(

View File

@@ -73,7 +73,13 @@ class PandasCSVParser(BaseParser):
for more information.
Set to empty dict by default, this means pandas will try to figure
out the separators, table head, etc. on its own.
header_period (int): Controls how headers are included in output:
- 0: Headers only at the beginning
- 1: Headers in every row
- N > 1: Headers every N rows
header_prefix (str): Prefix for header rows. Default is "HEADERS: ".
"""
def __init__(
@@ -83,6 +89,8 @@ class PandasCSVParser(BaseParser):
col_joiner: str = ", ",
row_joiner: str = "\n",
pandas_config: dict = {},
header_period: int = 20,
header_prefix: str = "HEADERS: ",
**kwargs: Any
) -> None:
"""Init params."""
@@ -91,6 +99,8 @@ class PandasCSVParser(BaseParser):
self._col_joiner = col_joiner
self._row_joiner = row_joiner
self._pandas_config = pandas_config
self._header_period = header_period
self._header_prefix = header_prefix
def _init_parser(self) -> Dict:
"""Init parser."""
@@ -104,15 +114,26 @@ class PandasCSVParser(BaseParser):
raise ValueError("pandas module is required to read CSV files.")
df = pd.read_csv(file, **self._pandas_config)
headers = df.columns.tolist()
header_row = f"{self._header_prefix}{self._col_joiner.join(headers)}"
text_list = df.apply(
lambda row: (self._col_joiner).join(row.astype(str).tolist()), axis=1
).tolist()
if not self._concat_rows:
return df.apply(
lambda row: (self._col_joiner).join(row.astype(str).tolist()), axis=1
).tolist()
text_list = []
if self._header_period != 1:
text_list.append(header_row)
for i, row in df.iterrows():
if (self._header_period > 1 and i > 0 and i % self._header_period == 0):
text_list.append(header_row)
text_list.append(self._col_joiner.join(row.astype(str).tolist()))
if self._header_period == 1 and i < len(df) - 1:
text_list.append(header_row)
if self._concat_rows:
return (self._row_joiner).join(text_list)
else:
return text_list
return self._row_joiner.join(text_list)
class ExcelParser(BaseParser):
@@ -138,7 +159,13 @@ class ExcelParser(BaseParser):
for more information.
Set to empty dict by default, this means pandas will try to figure
out the table structure on its own.
header_period (int): Controls how headers are included in output:
- 0: Headers only at the beginning (default)
- 1: Headers in every row
- N > 1: Headers every N rows
header_prefix (str): Prefix for header rows. Default is "HEADERS: ".
"""
def __init__(
@@ -148,6 +175,8 @@ class ExcelParser(BaseParser):
col_joiner: str = ", ",
row_joiner: str = "\n",
pandas_config: dict = {},
header_period: int = 20,
header_prefix: str = "HEADERS: ",
**kwargs: Any
) -> None:
"""Init params."""
@@ -156,6 +185,8 @@ class ExcelParser(BaseParser):
self._col_joiner = col_joiner
self._row_joiner = row_joiner
self._pandas_config = pandas_config
self._header_period = header_period
self._header_prefix = header_prefix
def _init_parser(self) -> Dict:
"""Init parser."""
@@ -169,12 +200,22 @@ class ExcelParser(BaseParser):
raise ValueError("pandas module is required to read Excel files.")
df = pd.read_excel(file, **self._pandas_config)
headers = df.columns.tolist()
header_row = f"{self._header_prefix}{self._col_joiner.join(headers)}"
if not self._concat_rows:
return df.apply(
lambda row: (self._col_joiner).join(row.astype(str).tolist()), axis=1
).tolist()
text_list = []
if self._header_period != 1:
text_list.append(header_row)
text_list = df.apply(
lambda row: (self._col_joiner).join(row.astype(str).tolist()), axis=1
).tolist()
if self._concat_rows:
return (self._row_joiner).join(text_list)
else:
return text_list
for i, row in df.iterrows():
if (self._header_period > 1 and i > 0 and i % self._header_period == 0):
text_list.append(header_row)
text_list.append(self._col_joiner.join(row.astype(str).tolist()))
if self._header_period == 1 and i < len(df) - 1:
text_list.append(header_row)
return self._row_joiner.join(text_list)

View File

@@ -1,66 +0,0 @@
import os
import javalang
def find_files(directory):
files_list = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.java'):
files_list.append(os.path.join(root, file))
return files_list
def extract_functions(file_path):
with open(file_path, "r") as file:
java_code = file.read()
methods = {}
tree = javalang.parse.parse(java_code)
for _, node in tree.filter(javalang.tree.MethodDeclaration):
method_name = node.name
start_line = node.position.line - 1
end_line = start_line
brace_count = 0
for line in java_code.splitlines()[start_line:]:
end_line += 1
brace_count += line.count("{") - line.count("}")
if brace_count == 0:
break
method_source_code = "\n".join(java_code.splitlines()[start_line:end_line])
methods[method_name] = method_source_code
return methods
def extract_classes(file_path):
with open(file_path, 'r') as file:
source_code = file.read()
classes = {}
tree = javalang.parse.parse(source_code)
for class_decl in tree.types:
class_name = class_decl.name
declarations = []
methods = []
for field_decl in class_decl.fields:
field_name = field_decl.declarators[0].name
field_type = field_decl.type.name
declarations.append(f"{field_type} {field_name}")
for method_decl in class_decl.methods:
methods.append(method_decl.name)
class_string = "Declarations: " + ", ".join(declarations) + "\n Method name: " + ", ".join(methods)
classes[class_name] = class_string
return classes
def extract_functions_and_classes(directory):
files = find_files(directory)
functions_dict = {}
classes_dict = {}
for file in files:
functions = extract_functions(file)
if functions:
functions_dict[file] = functions
classes = extract_classes(file)
if classes:
classes_dict[file] = classes
return functions_dict, classes_dict

View File

@@ -1,70 +0,0 @@
import os
import escodegen
import esprima
def find_files(directory):
files_list = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.js'):
files_list.append(os.path.join(root, file))
return files_list
def extract_functions(file_path):
with open(file_path, 'r') as file:
source_code = file.read()
functions = {}
tree = esprima.parseScript(source_code)
for node in tree.body:
if node.type == 'FunctionDeclaration':
func_name = node.id.name if node.id else '<anonymous>'
functions[func_name] = escodegen.generate(node)
elif node.type == 'VariableDeclaration':
for declaration in node.declarations:
if declaration.init and declaration.init.type == 'FunctionExpression':
func_name = declaration.id.name if declaration.id else '<anonymous>'
functions[func_name] = escodegen.generate(declaration.init)
elif node.type == 'ClassDeclaration':
for subnode in node.body.body:
if subnode.type == 'MethodDefinition':
func_name = subnode.key.name
functions[func_name] = escodegen.generate(subnode.value)
elif subnode.type == 'VariableDeclaration':
for declaration in subnode.declarations:
if declaration.init and declaration.init.type == 'FunctionExpression':
func_name = declaration.id.name if declaration.id else '<anonymous>'
functions[func_name] = escodegen.generate(declaration.init)
return functions
def extract_classes(file_path):
with open(file_path, 'r') as file:
source_code = file.read()
classes = {}
tree = esprima.parseScript(source_code)
for node in tree.body:
if node.type == 'ClassDeclaration':
class_name = node.id.name
function_names = []
for subnode in node.body.body:
if subnode.type == 'MethodDefinition':
function_names.append(subnode.key.name)
classes[class_name] = ", ".join(function_names)
return classes
def extract_functions_and_classes(directory):
files = find_files(directory)
functions_dict = {}
classes_dict = {}
for file in files:
functions = extract_functions(file)
if functions:
functions_dict[file] = functions
classes = extract_classes(file)
if classes:
classes_dict[file] = classes
return functions_dict, classes_dict

View File

@@ -1,75 +0,0 @@
import os
from retry import retry
from application.core.settings import settings
from application.vectorstore.vector_creator import VectorCreator
# from langchain_community.embeddings import HuggingFaceEmbeddings
# from langchain_community.embeddings import HuggingFaceInstructEmbeddings
# from langchain_community.embeddings import CohereEmbeddings
@retry(tries=10, delay=60)
def store_add_texts_with_retry(store, i, id):
# add source_id to the metadata
i.metadata["source_id"] = str(id)
store.add_texts([i.page_content], metadatas=[i.metadata])
# store_pine.add_texts([i.page_content], metadatas=[i.metadata])
def call_openai_api(docs, folder_name, id, task_status):
# Function to create a vector store from the documents and save it to disk
if not os.path.exists(f"{folder_name}"):
os.makedirs(f"{folder_name}")
from tqdm import tqdm
c1 = 0
if settings.VECTOR_STORE == "faiss":
docs_init = [docs[0]]
docs.pop(0)
store = VectorCreator.create_vectorstore(
settings.VECTOR_STORE,
docs_init=docs_init,
source_id=f"{folder_name}",
embeddings_key=os.getenv("EMBEDDINGS_KEY"),
)
else:
store = VectorCreator.create_vectorstore(
settings.VECTOR_STORE,
source_id=str(id),
embeddings_key=os.getenv("EMBEDDINGS_KEY"),
)
store.delete_index()
# Uncomment for MPNet embeddings
# model_name = "sentence-transformers/all-mpnet-base-v2"
# hf = HuggingFaceEmbeddings(model_name=model_name)
# store = FAISS.from_documents(docs_test, hf)
s1 = len(docs)
for i in tqdm(
docs,
desc="Embedding 🦖",
unit="docs",
total=len(docs),
bar_format="{l_bar}{bar}| Time Left: {remaining}",
):
try:
task_status.update_state(
state="PROGRESS", meta={"current": int((c1 / s1) * 100)}
)
store_add_texts_with_retry(store, i, id)
except Exception as e:
print(e)
print("Error on ", i)
print("Saving progress")
print(f"stopped at {c1} out of {len(docs)}")
store.save_local(f"{folder_name}")
break
c1 += 1
if settings.VECTOR_STORE == "faiss":
store.save_local(f"{folder_name}")

View File

@@ -1,121 +0,0 @@
import ast
import os
from pathlib import Path
import tiktoken
from langchain.llms import OpenAI
from langchain.prompts import PromptTemplate
def find_files(directory):
files_list = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.py'):
files_list.append(os.path.join(root, file))
return files_list
def extract_functions(file_path):
with open(file_path, 'r') as file:
source_code = file.read()
functions = {}
tree = ast.parse(source_code)
for node in ast.walk(tree):
if isinstance(node, ast.FunctionDef):
func_name = node.name
func_def = ast.get_source_segment(source_code, node)
functions[func_name] = func_def
return functions
def extract_classes(file_path):
with open(file_path, 'r') as file:
source_code = file.read()
classes = {}
tree = ast.parse(source_code)
for node in ast.walk(tree):
if isinstance(node, ast.ClassDef):
class_name = node.name
function_names = []
for subnode in ast.walk(node):
if isinstance(subnode, ast.FunctionDef):
function_names.append(subnode.name)
classes[class_name] = ", ".join(function_names)
return classes
def extract_functions_and_classes(directory):
files = find_files(directory)
functions_dict = {}
classes_dict = {}
for file in files:
functions = extract_functions(file)
if functions:
functions_dict[file] = functions
classes = extract_classes(file)
if classes:
classes_dict[file] = classes
return functions_dict, classes_dict
def parse_functions(functions_dict, formats, dir):
c1 = len(functions_dict)
for i, (source, functions) in enumerate(functions_dict.items(), start=1):
print(f"Processing file {i}/{c1}")
source_w = source.replace(dir + "/", "").replace("." + formats, ".md")
subfolders = "/".join(source_w.split("/")[:-1])
Path(f"outputs/{subfolders}").mkdir(parents=True, exist_ok=True)
for j, (name, function) in enumerate(functions.items(), start=1):
print(f"Processing function {j}/{len(functions)}")
prompt = PromptTemplate(
input_variables=["code"],
template="Code: \n{code}, \nDocumentation: ",
)
llm = OpenAI(temperature=0)
response = llm(prompt.format(code=function))
mode = "a" if Path(f"outputs/{source_w}").exists() else "w"
with open(f"outputs/{source_w}", mode) as f:
f.write(
f"\n\n# Function name: {name} \n\nFunction: \n```\n{function}\n```, \nDocumentation: \n{response}")
def parse_classes(classes_dict, formats, dir):
c1 = len(classes_dict)
for i, (source, classes) in enumerate(classes_dict.items()):
print(f"Processing file {i + 1}/{c1}")
source_w = source.replace(dir + "/", "").replace("." + formats, ".md")
subfolders = "/".join(source_w.split("/")[:-1])
Path(f"outputs/{subfolders}").mkdir(parents=True, exist_ok=True)
for name, function_names in classes.items():
print(f"Processing Class {i + 1}/{c1}")
prompt = PromptTemplate(
input_variables=["class_name", "functions_names"],
template="Class name: {class_name} \nFunctions: {functions_names}, \nDocumentation: ",
)
llm = OpenAI(temperature=0)
response = llm(prompt.format(class_name=name, functions_names=function_names))
with open(f"outputs/{source_w}", "a" if Path(f"outputs/{source_w}").exists() else "w") as f:
f.write(f"\n\n# Class name: {name} \n\nFunctions: \n{function_names}, \nDocumentation: \n{response}")
def transform_to_docs(functions_dict, classes_dict, formats, dir):
docs_content = ''.join([str(key) + str(value) for key, value in functions_dict.items()])
docs_content += ''.join([str(key) + str(value) for key, value in classes_dict.items()])
num_tokens = len(tiktoken.get_encoding("cl100k_base").encode(docs_content))
total_price = ((num_tokens / 1000) * 0.02)
print(f"Number of Tokens = {num_tokens:,d}")
print(f"Approx Cost = ${total_price:,.2f}")
user_input = input("Price Okay? (Y/N)\n").lower()
if user_input == "y" or user_input == "":
if not Path("outputs").exists():
Path("outputs").mkdir()
parse_functions(functions_dict, formats, dir)
parse_classes(classes_dict, formats, dir)
print("All done!")
else:
print("The API was not called. No money was spent.")

View File

@@ -1,17 +1,18 @@
import logging
import requests
from urllib.parse import urlparse, urljoin
from bs4 import BeautifulSoup
from application.parser.remote.base import BaseRemote
from application.parser.schema.base import Document
from langchain_community.document_loaders import WebBaseLoader
class CrawlerLoader(BaseRemote):
def __init__(self, limit=10):
from langchain_community.document_loaders import WebBaseLoader
self.loader = WebBaseLoader # Initialize the document loader
self.limit = limit # Set the limit for the number of pages to scrape
def load_data(self, inputs):
url = inputs
# Check if the input is a list and if it is, use the first element
if isinstance(url, list) and url:
url = url[0]
@@ -19,25 +20,30 @@ class CrawlerLoader(BaseRemote):
if not urlparse(url).scheme:
url = "http://" + url
visited_urls = set() # Keep track of URLs that have been visited
base_url = urlparse(url).scheme + "://" + urlparse(url).hostname # Extract the base URL
urls_to_visit = [url] # List of URLs to be visited, starting with the initial URL
loaded_content = [] # Store the loaded content from each URL
visited_urls = set()
base_url = urlparse(url).scheme + "://" + urlparse(url).hostname
urls_to_visit = [url]
loaded_content = []
# Continue crawling until there are no more URLs to visit
while urls_to_visit:
current_url = urls_to_visit.pop(0) # Get the next URL to visit
visited_urls.add(current_url) # Mark the URL as visited
current_url = urls_to_visit.pop(0)
visited_urls.add(current_url)
# Try to load and process the content from the current URL
try:
response = requests.get(current_url) # Fetch the content of the current URL
response.raise_for_status() # Raise an exception for HTTP errors
loader = self.loader([current_url]) # Initialize the document loader for the current URL
loaded_content.extend(loader.load()) # Load the content and add it to the loaded_content list
response = requests.get(current_url)
response.raise_for_status()
loader = self.loader([current_url])
docs = loader.load()
# Convert the loaded documents to your Document schema
for doc in docs:
loaded_content.append(
Document(
doc.page_content,
extra_info=doc.metadata
)
)
except Exception as e:
# Print an error message if loading or processing fails and continue with the next URL
print(f"Error processing URL {current_url}: {e}")
logging.error(f"Error processing URL {current_url}: {e}", exc_info=True)
continue
# Parse the HTML content to extract all links
@@ -45,15 +51,15 @@ class CrawlerLoader(BaseRemote):
all_links = [
urljoin(current_url, a['href'])
for a in soup.find_all('a', href=True)
if base_url in urljoin(current_url, a['href']) # Ensure links are from the same domain
if base_url in urljoin(current_url, a['href'])
]
# Add new links to the list of URLs to visit if they haven't been visited yet
urls_to_visit.extend([link for link in all_links if link not in visited_urls])
urls_to_visit = list(set(urls_to_visit)) # Remove duplicate URLs
urls_to_visit = list(set(urls_to_visit))
# Stop crawling if the limit of pages to scrape is reached
if self.limit is not None and len(visited_urls) >= self.limit:
break
return loaded_content # Return the loaded content from all visited URLs
return loaded_content

View File

@@ -0,0 +1,139 @@
import requests
from urllib.parse import urlparse, urljoin
from bs4 import BeautifulSoup
from application.parser.remote.base import BaseRemote
import re
from markdownify import markdownify
from application.parser.schema.base import Document
import tldextract
class CrawlerLoader(BaseRemote):
def __init__(self, limit=10, allow_subdomains=False):
"""
Given a URL crawl web pages up to `self.limit`,
convert HTML content to Markdown, and returning a list of Document objects.
:param limit: The maximum number of pages to crawl.
:param allow_subdomains: If True, crawl pages on subdomains of the base domain.
"""
self.limit = limit
self.allow_subdomains = allow_subdomains
self.session = requests.Session()
def load_data(self, inputs):
url = inputs
if isinstance(url, list) and url:
url = url[0]
# Ensure the URL has a scheme (if not, default to http)
if not urlparse(url).scheme:
url = "http://" + url
# Keep track of visited URLs to avoid revisiting the same page
visited_urls = set()
# Determine the base domain for link filtering using tldextract
base_domain = self._get_base_domain(url)
urls_to_visit = {url}
documents = []
while urls_to_visit:
current_url = urls_to_visit.pop()
# Skip if already visited
if current_url in visited_urls:
continue
visited_urls.add(current_url)
# Fetch the page content
html_content = self._fetch_page(current_url)
if html_content is None:
continue
# Convert the HTML to Markdown for cleaner text formatting
title, language, processed_markdown = self._process_html_to_markdown(html_content, current_url)
if processed_markdown:
# Create a Document for each visited page
documents.append(
Document(
processed_markdown, # content
None, # doc_id
None, # embedding
{"source": current_url, "title": title, "language": language} # extra_info
)
)
# Extract links and filter them according to domain rules
new_links = self._extract_links(html_content, current_url)
filtered_links = self._filter_links(new_links, base_domain)
# Add any new, not-yet-visited links to the queue
urls_to_visit.update(link for link in filtered_links if link not in visited_urls)
# If we've reached the limit, stop crawling
if self.limit is not None and len(visited_urls) >= self.limit:
break
return documents
def _fetch_page(self, url):
try:
response = self.session.get(url, timeout=10)
response.raise_for_status()
return response.text
except requests.exceptions.RequestException as e:
print(f"Error fetching URL {url}: {e}")
return None
def _process_html_to_markdown(self, html_content, current_url):
soup = BeautifulSoup(html_content, 'html.parser')
title_tag = soup.find('title')
title = title_tag.text.strip() if title_tag else "No Title"
# Extract language
language_tag = soup.find('html')
language = language_tag.get('lang', 'en') if language_tag else "en"
markdownified = markdownify(html_content, heading_style="ATX", newline_style="BACKSLASH")
# Reduce sequences of more than two newlines to exactly three
markdownified = re.sub(r'\n{3,}', '\n\n\n', markdownified)
return title, language, markdownified
def _extract_links(self, html_content, current_url):
soup = BeautifulSoup(html_content, 'html.parser')
links = []
for a in soup.find_all('a', href=True):
full_url = urljoin(current_url, a['href'])
links.append((full_url, a.text.strip()))
return links
def _get_base_domain(self, url):
extracted = tldextract.extract(url)
# Reconstruct the domain as domain.suffix
base_domain = f"{extracted.domain}.{extracted.suffix}"
return base_domain
def _filter_links(self, links, base_domain):
"""
Filter the extracted links to only include those that match the crawling criteria:
- If allow_subdomains is True, allow any link whose domain ends with the base_domain.
- If allow_subdomains is False, only allow exact matches of the base_domain.
"""
filtered = []
for link, _ in links:
parsed_link = urlparse(link)
if not parsed_link.netloc:
continue
extracted = tldextract.extract(parsed_link.netloc)
link_base = f"{extracted.domain}.{extracted.suffix}"
if self.allow_subdomains:
# For subdomains: sub.example.com ends with example.com
if link_base == base_domain or link_base.endswith("." + base_domain):
filtered.append(link)
else:
# Exact domain match
if link_base == base_domain:
filtered.append(link)
return filtered

View File

@@ -1,10 +1,19 @@
from application.parser.remote.base import BaseRemote
from langchain_community.document_loaders import RedditPostsLoader
import json
class RedditPostsLoaderRemote(BaseRemote):
def load_data(self, inputs):
data = eval(inputs)
try:
data = json.loads(inputs)
except json.JSONDecodeError as e:
raise ValueError(f"Invalid JSON input: {e}")
required_fields = ["client_id", "client_secret", "user_agent", "search_queries"]
missing_fields = [field for field in required_fields if field not in data]
if missing_fields:
raise ValueError(f"Missing required fields: {', '.join(missing_fields)}")
client_id = data.get("client_id")
client_secret = data.get("client_secret")
user_agent = data.get("user_agent")

View File

@@ -1,3 +1,4 @@
import logging
import requests
import re # Import regular expression library
import xml.etree.ElementTree as ET
@@ -32,7 +33,7 @@ class SitemapLoader(BaseRemote):
documents.extend(loader.load())
processed_urls += 1 # Increment the counter after processing each URL
except Exception as e:
print(f"Error processing URL {url}: {e}")
logging.error(f"Error processing URL {url}: {e}", exc_info=True)
continue
return documents

View File

@@ -1,5 +1,8 @@
import logging
from application.parser.remote.base import BaseRemote
from application.parser.schema.base import Document
from langchain_community.document_loaders import WebBaseLoader
from urllib.parse import urlparse
headers = {
"User-Agent": "Mozilla/5.0",
@@ -23,10 +26,20 @@ class WebLoader(BaseRemote):
urls = [urls]
documents = []
for url in urls:
# Check if the URL scheme is provided, if not, assume http
if not urlparse(url).scheme:
url = "http://" + url
try:
loader = self.loader([url], header_template=headers)
documents.extend(loader.load())
loaded_docs = loader.load()
for doc in loaded_docs:
documents.append(
Document(
doc.page_content,
extra_info=doc.metadata,
)
)
except Exception as e:
print(f"Error processing URL {url}: {e}")
logging.error(f"Error processing URL {url}: {e}", exc_info=True)
continue
return documents

View File

@@ -1,79 +0,0 @@
import re
from math import ceil
from typing import List
import tiktoken
from application.parser.schema.base import Document
def separate_header_and_body(text):
header_pattern = r"^(.*?\n){3}"
match = re.match(header_pattern, text)
header = match.group(0)
body = text[len(header):]
return header, body
def group_documents(documents: List[Document], min_tokens: int, max_tokens: int) -> List[Document]:
docs = []
current_group = None
for doc in documents:
doc_len = len(tiktoken.get_encoding("cl100k_base").encode(doc.text))
# Check if current group is empty or if the document can be added based on token count and matching metadata
if (current_group is None or
(len(tiktoken.get_encoding("cl100k_base").encode(current_group.text)) + doc_len < max_tokens and
doc_len < min_tokens and
current_group.extra_info == doc.extra_info)):
if current_group is None:
current_group = doc # Use the document directly to retain its metadata
else:
current_group.text += " " + doc.text # Append text to the current group
else:
docs.append(current_group)
current_group = doc # Start a new group with the current document
if current_group is not None:
docs.append(current_group)
return docs
def split_documents(documents: List[Document], max_tokens: int) -> List[Document]:
docs = []
for doc in documents:
token_length = len(tiktoken.get_encoding("cl100k_base").encode(doc.text))
if token_length <= max_tokens:
docs.append(doc)
else:
header, body = separate_header_and_body(doc.text)
if len(tiktoken.get_encoding("cl100k_base").encode(header)) > max_tokens:
body = doc.text
header = ""
num_body_parts = ceil(token_length / max_tokens)
part_length = ceil(len(body) / num_body_parts)
body_parts = [body[i:i + part_length] for i in range(0, len(body), part_length)]
for i, body_part in enumerate(body_parts):
new_doc = Document(text=header + body_part.strip(),
doc_id=f"{doc.doc_id}-{i}",
embedding=doc.embedding,
extra_info=doc.extra_info)
docs.append(new_doc)
return docs
def group_split(documents: List[Document], max_tokens: int = 2000, min_tokens: int = 150, token_check: bool = True):
if not token_check:
return documents
print("Grouping small documents")
try:
documents = group_documents(documents=documents, min_tokens=min_tokens, max_tokens=max_tokens)
except Exception:
print("Grouping failed, try running without token_check")
print("Separating large documents")
try:
documents = split_documents(documents=documents, max_tokens=max_tokens)
except Exception:
print("Grouping failed, try running without token_check")
return documents

View File

@@ -1,9 +1,15 @@
You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible.
Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses.
You have access to chat history, and can use it to help answer the question.
When using code examples, use the following format:
You are a helpful AI assistant, DocsGPT. You are proactive and helpful. Try to use tools, if they are available to you,
be proactive and fill in missing information.
Users can Upload documents for your context as attachments or sources via UI using the Conversation input box.
If appropriate, your answers can include code examples, formatted as follows:
```(language)
(code)
```
Users are also able to see charts and diagrams if you use them with valid mermaid syntax in your responses.
Try to respond with mermaid charts if visualization helps with users queries.
You effectively utilize chat history, ensuring relevant and tailored responses.
Try to use additional provided context if it's available, otherwise use your knowledge and tool capabilities.
Allow yourself to be very creative and use your imagination.
----------------
Possible additional context from uploaded sources:
{summaries}

View File

@@ -1,9 +1,14 @@
You are a helpful AI assistant, DocsGPT, specializing in document assistance, designed to offer detailed and informative responses.
You are a helpful AI assistant, DocsGPT. You are proactive and helpful. Try to use tools, if they are available to you,
be proactive and fill in missing information.
Users can Upload documents for your context as attachments or sources via UI using the Conversation input box.
If appropriate, your answers can include code examples, formatted as follows:
```(language)
(code)
```
Users are also able to see charts and diagrams if you use them with valid mermaid syntax in your responses.
Try to respond with mermaid charts if visualization helps with users queries.
You effectively utilize chat history, ensuring relevant and tailored responses.
If a question doesn't align with your context, you provide friendly and helpful replies.
Try to use additional provided context if it's available, otherwise use your knowledge and tool capabilities.
----------------
Possible additional context from uploaded sources:
{summaries}

View File

@@ -1,13 +1,17 @@
You are an AI Assistant, DocsGPT, adept at offering document assistance.
Your expertise lies in providing answer on top of provided context.
You can leverage the chat history if needed.
Answer the question based on the context below.
Keep the answer concise. Respond "Irrelevant context" if not sure about the answer.
If question is not related to the context, respond "Irrelevant context".
When using code examples, use the following format:
You are a helpful AI assistant, DocsGPT. You are proactive and helpful. Try to use tools, if they are available to you,
be proactive and fill in missing information.
Users can Upload documents for your context as attachments or sources via UI using the Conversation input box.
If appropriate, your answers can include code examples, formatted as follows:
```(language)
(code)
```
----------------
Context:
{summaries}
Users are also able to see charts and diagrams if you use them with valid mermaid syntax in your responses.
Try to respond with mermaid charts if visualization helps with users queries.
You effectively utilize chat history, ensuring relevant and tailored responses.
Use context provided below or use available tools tool capabilities to answer user queries.
If you dont have enough information from the context or tools, answer "I don't know" or "I don't have enough information".
Never make up information or provide false information!
Allow yourself to be very creative and use your imagination.
----------------
Context from uploaded sources:
{summaries}

View File

@@ -0,0 +1,3 @@
Query: {query}
Observations: {observations}
Now, using the insights from the observations, formulate a well-structured and precise final answer.

View File

@@ -0,0 +1,13 @@
You are an AI assistant and talk like you're thinking out loud. Given the following query, outline a concise thought process that includes key steps and considerations necessary for effective analysis and response. Avoid pointwise formatting. The goal is to break down the query into manageable components without excessive detail, focusing on clarity and logical progression.
Include the following elements in your thought and execution process:
1. Identify the main objective of the query.
2. Determine any relevant context or background information needed to understand the query.
3. List potential approaches or methods to address the query.
4. Highlight any critical factors or constraints that may influence the outcome.
5. Plan with available tools to help you with the analysis but dont execute them. Tools will be executed by another AI.
Query: {query}
Summaries: {summaries}
Prompt: {prompt}
Observations(potentially previous tool calls): {observations}

View File

@@ -1,89 +1,85 @@
anthropic==0.34.2
boto3==1.34.153
beautifulsoup4==4.12.3
celery==5.3.6
anthropic==0.49.0
boto3==1.38.18
beautifulsoup4==4.13.4
celery==5.4.0
dataclasses-json==0.6.7
docx2txt==0.8
duckduckgo-search==6.3.0
duckduckgo-search==7.5.2
ebooklib==0.18
elastic-transport==8.15.0
elasticsearch==8.15.1
escodegen==1.0.11
esprima==4.0.1
esutils==1.0.1
Flask==3.0.3
faiss-cpu==1.8.0.post1
Flask==3.1.1
faiss-cpu==1.9.0.post1
flask-restx==1.3.0
gTTS==2.3.2
google-genai==1.3.0
gTTS==2.5.4
gunicorn==23.0.0
html2text==2024.2.26
javalang==0.13.0
jinja2==3.1.4
jiter==0.5.0
jinja2==3.1.6
jiter==0.8.2
jmespath==1.0.1
joblib==1.4.2
jsonpatch==1.33
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-spec==0.2.4
jsonschema-specifications==2023.7.1
kombu==5.4.2
langchain==0.3.0
langchain-community==0.3.0
langchain-core==0.3.2
langchain-openai==0.2.0
langchain-text-splitters==0.3.0
langsmith==0.1.125
langchain==0.3.20
langchain-community==0.3.19
langchain-core==0.3.59
langchain-openai==0.3.16
langchain-text-splitters==0.3.8
langsmith==0.3.42
lazy-object-proxy==1.10.0
lxml==5.3.0
markupsafe==2.1.5
marshmallow==3.22.0
lxml==5.3.1
markupsafe==3.0.2
marshmallow==3.26.1
mpmath==1.3.0
multidict==6.1.0
multidict==6.4.3
mypy-extensions==1.0.0
networkx==3.3
numpy==1.26.4
openai==1.46.1
openapi-schema-validator==0.6.2
openapi-spec-validator==0.6.0
openapi3-parser==1.1.18
orjson==3.10.7
packaging==24.1
networkx==3.4.2
numpy==2.2.1
openai==1.78.1
openapi3-parser==1.1.21
orjson==3.10.14
packaging==24.2
pandas==2.2.3
openpyxl==3.1.5
pathable==0.4.3
pillow==10.4.0
portalocker==2.10.1
pathable==0.4.4
pillow==11.1.0
portalocker>=2.7.0,<3.0.0
prance==23.6.21.0
primp==0.6.3
prompt-toolkit==3.0.47
protobuf==5.28.2
prompt-toolkit==3.0.51
protobuf==5.29.3
psycopg2-binary==2.9.10
py==1.11.0
pydantic==2.9.2
pydantic-core==2.23.4
pydantic-settings==2.4.0
pymongo==4.8.0
pypdf2==3.0.1
pydantic==2.10.6
pydantic-core==2.27.2
pydantic-settings==2.7.1
pymongo==4.11.3
pypdf==5.5.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-jose==3.4.0
python-pptx==1.0.2
qdrant-client==1.11.0
redis==5.0.1
referencing==0.30.2
regex==2024.9.11
requests==2.32.3
redis==5.2.1
referencing>=0.28.0,<0.31.0
regex==2024.11.6
requests==2.32.4
retry==0.9.2
sentence-transformers==3.0.1
tiktoken==0.7.0
tokenizers==0.19.1
torch==2.4.1
tqdm==4.66.5
transformers==4.44.2
sentence-transformers==3.3.1
tiktoken==0.8.0
tokenizers==0.21.0
torch==2.7.1
tqdm==4.67.1
transformers==4.51.3
typing-extensions==4.12.2
typing-inspect==0.9.0
tzdata==2024.2
urllib3==2.2.3
urllib3==2.3.0
vine==5.1.0
wcwidth==0.2.13
werkzeug==3.0.4
yarl==1.11.1
werkzeug==3.1.3
yarl==1.20.0
markdownify==1.1.0
tldextract==5.1.3
websockets==14.1

View File

@@ -1,16 +1,16 @@
import json
from application.retriever.base import BaseRetriever
from langchain_community.tools import BraveSearch
from application.core.settings import settings
from application.llm.llm_creator import LLMCreator
from application.utils import num_tokens_from_string
from langchain_community.tools import BraveSearch
from application.retriever.base import BaseRetriever
class BraveRetSearch(BaseRetriever):
def __init__(
self,
question,
source,
chat_history,
prompt,
@@ -18,8 +18,9 @@ class BraveRetSearch(BaseRetriever):
token_limit=150,
gpt_model="docsgpt",
user_api_key=None,
decoded_token=None,
):
self.question = question
self.question = ""
self.source = source
self.chat_history = chat_history
self.prompt = prompt
@@ -36,6 +37,7 @@ class BraveRetSearch(BaseRetriever):
)
)
self.user_api_key = user_api_key
self.decoded_token = decoded_token
def _get_data(self):
if self.chunks == 0:
@@ -72,33 +74,29 @@ class BraveRetSearch(BaseRetriever):
for doc in docs:
yield {"source": doc}
if len(self.chat_history) > 1:
tokens_current_history = 0
# count tokens in history
if len(self.chat_history) > 0:
for i in self.chat_history:
if "prompt" in i and "response" in i:
tokens_batch = num_tokens_from_string(i["prompt"]) + num_tokens_from_string(
i["response"]
messages_combine.append({"role": "user", "content": i["prompt"]})
messages_combine.append(
{"role": "assistant", "content": i["response"]}
)
if tokens_current_history + tokens_batch < self.token_limit:
tokens_current_history += tokens_batch
messages_combine.append(
{"role": "user", "content": i["prompt"]}
)
messages_combine.append(
{"role": "system", "content": i["response"]}
)
messages_combine.append({"role": "user", "content": self.question})
llm = LLMCreator.create_llm(
settings.LLM_NAME, api_key=settings.API_KEY, user_api_key=self.user_api_key
settings.LLM_NAME,
api_key=settings.API_KEY,
user_api_key=self.user_api_key,
decoded_token=self.decoded_token,
)
completion = llm.gen_stream(model=self.gpt_model, messages=messages_combine)
for line in completion:
yield {"answer": str(line)}
def search(self):
def search(self, query: str = ""):
if query:
self.question = query
return self._get_data()
def get_params(self):
@@ -110,5 +108,5 @@ class BraveRetSearch(BaseRetriever):
"chunks": self.chunks,
"token_limit": self.token_limit,
"gpt_model": self.gpt_model,
"user_api_key": self.user_api_key
"user_api_key": self.user_api_key,
}

View File

@@ -1,27 +1,27 @@
from application.retriever.base import BaseRetriever
import logging
from application.core.settings import settings
from application.vectorstore.vector_creator import VectorCreator
from application.llm.llm_creator import LLMCreator
from application.retriever.base import BaseRetriever
from application.utils import num_tokens_from_string
from application.vectorstore.vector_creator import VectorCreator
class ClassicRAG(BaseRetriever):
def __init__(
self,
question,
source,
chat_history,
prompt,
chat_history=None,
prompt="",
chunks=2,
token_limit=150,
gpt_model="docsgpt",
user_api_key=None,
llm_name=settings.LLM_NAME,
api_key=settings.API_KEY,
decoded_token=None,
):
self.question = question
self.vectorstore = source['active_docs'] if 'active_docs' in source else None
self.chat_history = chat_history
self.original_question = ""
self.chat_history = chat_history if chat_history is not None else []
self.prompt = prompt
self.chunks = chunks
self.gpt_model = gpt_model
@@ -36,16 +36,56 @@ class ClassicRAG(BaseRetriever):
)
)
self.user_api_key = user_api_key
self.llm_name = llm_name
self.api_key = api_key
self.llm = LLMCreator.create_llm(
self.llm_name,
api_key=self.api_key,
user_api_key=self.user_api_key,
decoded_token=decoded_token,
)
self.vectorstore = source["active_docs"] if "active_docs" in source else None
self.question = self._rephrase_query()
self.decoded_token = decoded_token
def _rephrase_query(self):
if (
not self.original_question
or not self.chat_history
or self.chat_history == []
or self.chunks == 0
or self.vectorstore is None
):
return self.original_question
prompt = f"""Given the following conversation history:
{self.chat_history}
Rephrase the following user question to be a standalone search query
that captures all relevant context from the conversation:
"""
messages = [
{"role": "system", "content": prompt},
{"role": "user", "content": self.original_question},
]
try:
rephrased_query = self.llm.gen(model=self.gpt_model, messages=messages)
print(f"Rephrased query: {rephrased_query}")
return rephrased_query if rephrased_query else self.original_question
except Exception as e:
logging.error(f"Error rephrasing query: {e}", exc_info=True)
return self.original_question
def _get_data(self):
if self.chunks == 0:
if self.chunks == 0 or self.vectorstore is None:
docs = []
else:
docsearch = VectorCreator.create_vectorstore(
settings.VECTOR_STORE, self.vectorstore, settings.EMBEDDINGS_KEY
)
docs_temp = docsearch.search(self.question, k=self.chunks)
print(docs_temp)
docs = [
{
"title": i.metadata.get(
@@ -60,57 +100,25 @@ class ClassicRAG(BaseRetriever):
}
for i in docs_temp
]
if settings.LLM_NAME == "llama.cpp":
docs = [docs[0]]
return docs
def gen(self):
docs = self._get_data()
def gen():
pass
# join all page_content together with a newline
docs_together = "\n".join([doc["text"] for doc in docs])
p_chat_combine = self.prompt.replace("{summaries}", docs_together)
messages_combine = [{"role": "system", "content": p_chat_combine}]
for doc in docs:
yield {"source": doc}
if len(self.chat_history) > 1:
tokens_current_history = 0
# count tokens in history
for i in self.chat_history:
if "prompt" in i and "response" in i:
tokens_batch = num_tokens_from_string(i["prompt"]) + num_tokens_from_string(
i["response"]
)
if tokens_current_history + tokens_batch < self.token_limit:
tokens_current_history += tokens_batch
messages_combine.append(
{"role": "user", "content": i["prompt"]}
)
messages_combine.append(
{"role": "system", "content": i["response"]}
)
messages_combine.append({"role": "user", "content": self.question})
llm = LLMCreator.create_llm(
settings.LLM_NAME, api_key=settings.API_KEY, user_api_key=self.user_api_key
)
completion = llm.gen_stream(model=self.gpt_model, messages=messages_combine)
for line in completion:
yield {"answer": str(line)}
def search(self):
def search(self, query: str = ""):
if query:
self.original_question = query
self.question = self._rephrase_query()
return self._get_data()
def get_params(self):
return {
"question": self.question,
"question": self.original_question,
"rephrased_question": self.question,
"source": self.vectorstore,
"chat_history": self.chat_history,
"prompt": self.prompt,
"chunks": self.chunks,
"token_limit": self.token_limit,
"gpt_model": self.gpt_model,
"user_api_key": self.user_api_key
"user_api_key": self.user_api_key,
}

View File

@@ -1,16 +1,15 @@
from application.retriever.base import BaseRetriever
from application.core.settings import settings
from application.llm.llm_creator import LLMCreator
from application.utils import num_tokens_from_string
from langchain_community.tools import DuckDuckGoSearchResults
from langchain_community.utilities import DuckDuckGoSearchAPIWrapper
from application.core.settings import settings
from application.llm.llm_creator import LLMCreator
from application.retriever.base import BaseRetriever
class DuckDuckSearch(BaseRetriever):
def __init__(
self,
question,
source,
chat_history,
prompt,
@@ -18,8 +17,9 @@ class DuckDuckSearch(BaseRetriever):
token_limit=150,
gpt_model="docsgpt",
user_api_key=None,
decoded_token=None,
):
self.question = question
self.question = ""
self.source = source
self.chat_history = chat_history
self.prompt = prompt
@@ -36,42 +36,26 @@ class DuckDuckSearch(BaseRetriever):
)
)
self.user_api_key = user_api_key
def _parse_lang_string(self, input_string):
result = []
current_item = ""
inside_brackets = False
for char in input_string:
if char == "[":
inside_brackets = True
elif char == "]":
inside_brackets = False
result.append(current_item)
current_item = ""
elif inside_brackets:
current_item += char
if inside_brackets:
result.append(current_item)
return result
self.decoded_token = decoded_token
def _get_data(self):
if self.chunks == 0:
docs = []
else:
wrapper = DuckDuckGoSearchAPIWrapper(max_results=self.chunks)
search = DuckDuckGoSearchResults(api_wrapper=wrapper)
search = DuckDuckGoSearchResults(api_wrapper=wrapper, output_format="list")
results = search.run(self.question)
results = self._parse_lang_string(results)
docs = []
for i in results:
try:
text = i.split("title:")[0]
title = i.split("title:")[1].split("link:")[0]
link = i.split("link:")[1]
docs.append({"text": text, "title": title, "link": link})
docs.append(
{
"text": i.get("snippet", "").strip(),
"title": i.get("title", "").strip(),
"link": i.get("link", "").strip(),
}
)
except IndexError:
pass
if settings.LLM_NAME == "llama.cpp":
@@ -89,35 +73,31 @@ class DuckDuckSearch(BaseRetriever):
for doc in docs:
yield {"source": doc}
if len(self.chat_history) > 1:
tokens_current_history = 0
# count tokens in history
if len(self.chat_history) > 0:
for i in self.chat_history:
if "prompt" in i and "response" in i:
tokens_batch = num_tokens_from_string(i["prompt"]) + num_tokens_from_string(
i["response"]
messages_combine.append({"role": "user", "content": i["prompt"]})
messages_combine.append(
{"role": "assistant", "content": i["response"]}
)
if tokens_current_history + tokens_batch < self.token_limit:
tokens_current_history += tokens_batch
messages_combine.append(
{"role": "user", "content": i["prompt"]}
)
messages_combine.append(
{"role": "system", "content": i["response"]}
)
messages_combine.append({"role": "user", "content": self.question})
llm = LLMCreator.create_llm(
settings.LLM_NAME, api_key=settings.API_KEY, user_api_key=self.user_api_key
settings.LLM_NAME,
api_key=settings.API_KEY,
user_api_key=self.user_api_key,
decoded_token=self.decoded_token,
)
completion = llm.gen_stream(model=self.gpt_model, messages=messages_combine)
for line in completion:
yield {"answer": str(line)}
def search(self):
def search(self, query: str = ""):
if query:
self.question = query
return self._get_data()
def get_params(self):
return {
"question": self.question,
@@ -127,5 +107,5 @@ class DuckDuckSearch(BaseRetriever):
"chunks": self.chunks,
"token_limit": self.token_limit,
"gpt_model": self.gpt_model,
"user_api_key": self.user_api_key
"user_api_key": self.user_api_key,
}

View File

@@ -3,18 +3,18 @@ from application.retriever.duckduck_search import DuckDuckSearch
from application.retriever.brave_search import BraveRetSearch
class RetrieverCreator:
retrievers = {
'classic': ClassicRAG,
'duckduck_search': DuckDuckSearch,
'brave_search': BraveRetSearch,
'default': ClassicRAG
"classic": ClassicRAG,
"duckduck_search": DuckDuckSearch,
"brave_search": BraveRetSearch,
"default": ClassicRAG,
}
@classmethod
def create_retriever(cls, type, *args, **kwargs):
retiever_class = cls.retrievers.get(type.lower())
retriever_type = (type or "default").lower()
retiever_class = cls.retrievers.get(retriever_type)
if not retiever_class:
raise ValueError(f"No retievers class found for type {type}")
return retiever_class(*args, **kwargs)
return retiever_class(*args, **kwargs)

View File

@@ -0,0 +1,94 @@
"""Base storage class for file system abstraction."""
from abc import ABC, abstractmethod
from typing import BinaryIO, List, Callable
class BaseStorage(ABC):
"""Abstract base class for storage implementations."""
@abstractmethod
def save_file(self, file_data: BinaryIO, path: str) -> dict:
"""
Save a file to storage.
Args:
file_data: File-like object containing the data
path: Path where the file should be stored
Returns:
dict: A dictionary containing metadata about the saved file, including:
- 'path': The path where the file was saved
- 'storage_type': The type of storage (e.g., 'local', 's3')
- Other storage-specific metadata (e.g., 'uri', 'bucket_name', etc.)
"""
pass
@abstractmethod
def get_file(self, path: str) -> BinaryIO:
"""
Retrieve a file from storage.
Args:
path: Path to the file
Returns:
BinaryIO: File-like object containing the file data
"""
pass
@abstractmethod
def process_file(self, path: str, processor_func: Callable, **kwargs):
"""
Process a file using the provided processor function.
This method handles the details of retrieving the file and providing
it to the processor function in an appropriate way based on the storage type.
Args:
path: Path to the file
processor_func: Function that processes the file
**kwargs: Additional arguments to pass to the processor function
Returns:
The result of the processor function
"""
pass
@abstractmethod
def delete_file(self, path: str) -> bool:
"""
Delete a file from storage.
Args:
path: Path to the file
Returns:
bool: True if deletion was successful
"""
pass
@abstractmethod
def file_exists(self, path: str) -> bool:
"""
Check if a file exists.
Args:
path: Path to the file
Returns:
bool: True if the file exists
"""
pass
@abstractmethod
def list_files(self, directory: str) -> List[str]:
"""
List all files in a directory.
Args:
directory: Directory path to list
Returns:
List[str]: List of file paths
"""
pass

View File

@@ -0,0 +1,103 @@
"""Local file system implementation."""
import os
import shutil
from typing import BinaryIO, List, Callable
from application.storage.base import BaseStorage
class LocalStorage(BaseStorage):
"""Local file system storage implementation."""
def __init__(self, base_dir: str = None):
"""
Initialize local storage.
Args:
base_dir: Base directory for all operations. If None, uses current directory.
"""
self.base_dir = base_dir or os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
def _get_full_path(self, path: str) -> str:
"""Get absolute path by combining base_dir and path."""
if os.path.isabs(path):
return path
return os.path.join(self.base_dir, path)
def save_file(self, file_data: BinaryIO, path: str) -> dict:
"""Save a file to local storage."""
full_path = self._get_full_path(path)
os.makedirs(os.path.dirname(full_path), exist_ok=True)
if hasattr(file_data, 'save'):
file_data.save(full_path)
else:
with open(full_path, 'wb') as f:
shutil.copyfileobj(file_data, f)
return {
'storage_type': 'local'
}
def get_file(self, path: str) -> BinaryIO:
"""Get a file from local storage."""
full_path = self._get_full_path(path)
if not os.path.exists(full_path):
raise FileNotFoundError(f"File not found: {full_path}")
return open(full_path, 'rb')
def delete_file(self, path: str) -> bool:
"""Delete a file from local storage."""
full_path = self._get_full_path(path)
if not os.path.exists(full_path):
return False
os.remove(full_path)
return True
def file_exists(self, path: str) -> bool:
"""Check if a file exists in local storage."""
full_path = self._get_full_path(path)
return os.path.exists(full_path)
def list_files(self, directory: str) -> List[str]:
"""List all files in a directory in local storage."""
full_path = self._get_full_path(directory)
if not os.path.exists(full_path):
return []
result = []
for root, _, files in os.walk(full_path):
for file in files:
rel_path = os.path.relpath(os.path.join(root, file), self.base_dir)
result.append(rel_path)
return result
def process_file(self, path: str, processor_func: Callable, **kwargs):
"""
Process a file using the provided processor function.
For local storage, we can directly pass the full path to the processor.
Args:
path: Path to the file
processor_func: Function that processes the file
**kwargs: Additional arguments to pass to the processor function
Returns:
The result of the processor function
"""
full_path = self._get_full_path(path)
if not os.path.exists(full_path):
raise FileNotFoundError(f"File not found: {full_path}")
return processor_func(local_path=full_path, **kwargs)

120
application/storage/s3.py Normal file
View File

@@ -0,0 +1,120 @@
"""S3 storage implementation."""
import io
from typing import BinaryIO, List, Callable
import os
import boto3
from botocore.exceptions import ClientError
from application.storage.base import BaseStorage
from application.core.settings import settings
class S3Storage(BaseStorage):
"""AWS S3 storage implementation."""
def __init__(self, bucket_name=None):
"""
Initialize S3 storage.
Args:
bucket_name: S3 bucket name (optional, defaults to settings)
"""
self.bucket_name = bucket_name or getattr(settings, "S3_BUCKET_NAME", "docsgpt-test-bucket")
# Get credentials from settings
aws_access_key_id = getattr(settings, "SAGEMAKER_ACCESS_KEY", None)
aws_secret_access_key = getattr(settings, "SAGEMAKER_SECRET_KEY", None)
region_name = getattr(settings, "SAGEMAKER_REGION", None)
self.s3 = boto3.client(
's3',
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
region_name=region_name
)
def save_file(self, file_data: BinaryIO, path: str) -> dict:
"""Save a file to S3 storage."""
self.s3.upload_fileobj(file_data, self.bucket_name, path)
region = getattr(settings, "SAGEMAKER_REGION", None)
return {
'storage_type': 's3',
'bucket_name': self.bucket_name,
'uri': f's3://{self.bucket_name}/{path}',
'region': region
}
def get_file(self, path: str) -> BinaryIO:
"""Get a file from S3 storage."""
if not self.file_exists(path):
raise FileNotFoundError(f"File not found: {path}")
file_obj = io.BytesIO()
self.s3.download_fileobj(self.bucket_name, path, file_obj)
file_obj.seek(0)
return file_obj
def delete_file(self, path: str) -> bool:
"""Delete a file from S3 storage."""
try:
self.s3.delete_object(Bucket=self.bucket_name, Key=path)
return True
except ClientError:
return False
def file_exists(self, path: str) -> bool:
"""Check if a file exists in S3 storage."""
try:
self.s3.head_object(Bucket=self.bucket_name, Key=path)
return True
except ClientError:
return False
def list_files(self, directory: str) -> List[str]:
"""List all files in a directory in S3 storage."""
# Ensure directory ends with a slash if it's not empty
if directory and not directory.endswith('/'):
directory += '/'
result = []
paginator = self.s3.get_paginator('list_objects_v2')
pages = paginator.paginate(Bucket=self.bucket_name, Prefix=directory)
for page in pages:
if 'Contents' in page:
for obj in page['Contents']:
result.append(obj['Key'])
return result
def process_file(self, path: str, processor_func: Callable, **kwargs):
"""
Process a file using the provided processor function.
Args:
path: Path to the file
processor_func: Function that processes the file
**kwargs: Additional arguments to pass to the processor function
Returns:
The result of the processor function
"""
import tempfile
import logging
if not self.file_exists(path):
raise FileNotFoundError(f"File not found in S3: {path}")
with tempfile.NamedTemporaryFile(suffix=os.path.splitext(path)[1], delete=True) as temp_file:
try:
# Download the file from S3 to the temporary file
self.s3.download_fileobj(self.bucket_name, path, temp_file)
temp_file.flush()
return processor_func(local_path=temp_file.name, **kwargs)
except Exception as e:
logging.error(f"Error processing S3 file {path}: {e}", exc_info=True)
raise

View File

@@ -0,0 +1,32 @@
"""Storage factory for creating different storage implementations."""
from typing import Dict, Type
from application.storage.base import BaseStorage
from application.storage.local import LocalStorage
from application.storage.s3 import S3Storage
from application.core.settings import settings
class StorageCreator:
storages: Dict[str, Type[BaseStorage]] = {
"local": LocalStorage,
"s3": S3Storage,
}
_instance = None
@classmethod
def get_storage(cls) -> BaseStorage:
if cls._instance is None:
storage_type = getattr(settings, "STORAGE_TYPE", "local")
cls._instance = cls.create_storage(storage_type)
return cls._instance
@classmethod
def create_storage(cls, type_name: str, *args, **kwargs) -> BaseStorage:
storage_class = cls.storages.get(type_name.lower())
if not storage_class:
raise ValueError(f"No storage implementation found for type {type_name}")
return storage_class(*args, **kwargs)

View File

@@ -1,29 +1,84 @@
from io import BytesIO
import asyncio
import websockets
import json
import base64
from io import BytesIO
from application.tts.base import BaseTTS
class ElevenlabsTTS(BaseTTS):
def __init__(self):
from elevenlabs.client import ElevenLabs
self.client = ElevenLabs(
api_key="ELEVENLABS_API_KEY",
)
def __init__(self):
self.api_key = 'ELEVENLABS_API_KEY'# here you should put your api key
self.model = "eleven_flash_v2_5"
self.voice = "VOICE_ID" # this is the hash code for the voice not the name!
self.write_audio = 1
def text_to_speech(self, text):
lang = "en"
audio = self.client.generate(
text=text,
model="eleven_multilingual_v2",
voice="Brian",
)
audio_data = BytesIO()
for chunk in audio:
audio_data.write(chunk)
audio_bytes = audio_data.getvalue()
asyncio.run(self._text_to_speech_websocket(text))
# Encode to base64
audio_base64 = base64.b64encode(audio_bytes).decode("utf-8")
return audio_base64, lang
async def _text_to_speech_websocket(self, text):
uri = f"wss://api.elevenlabs.io/v1/text-to-speech/{self.voice}/stream-input?model_id={self.model}"
websocket = await websockets.connect(uri)
payload = {
"text": " ",
"voice_settings": {
"stability": 0.5,
"similarity_boost": 0.8,
},
"xi_api_key": self.api_key,
}
await websocket.send(json.dumps(payload))
async def listen():
while 1:
try:
msg = await websocket.recv()
data = json.loads(msg)
if data.get("audio"):
print("audio received")
yield base64.b64decode(data["audio"])
elif data.get("isFinal"):
break
except websockets.exceptions.ConnectionClosed:
print("websocket closed")
break
listen_task = asyncio.create_task(self.stream(listen()))
await websocket.send(json.dumps({"text": text}))
# this is to signal the end of the text, either use this or flush
await websocket.send(json.dumps({"text": ""}))
await listen_task
async def stream(self, audio_stream):
if self.write_audio:
audio_bytes = BytesIO()
async for chunk in audio_stream:
if chunk:
audio_bytes.write(chunk)
with open("output_audio.mp3", "wb") as f:
f.write(audio_bytes.getvalue())
else:
async for chunk in audio_stream:
pass # depends on the streamer!
def test_elevenlabs_websocket():
"""
Tests the ElevenlabsTTS text_to_speech method with a sample prompt.
Prints out the base64-encoded result and writes it to 'output_audio.mp3'.
"""
# Instantiate your TTS class
tts = ElevenlabsTTS()
# Call the method with some sample text
tts.text_to_speech("Hello from ElevenLabs WebSocket!")
print("Saved audio to output_audio.mp3.")
if __name__ == "__main__":
test_elevenlabs_websocket()

View File

@@ -1,17 +1,24 @@
import sys
from datetime import datetime
from application.core.mongo_db import MongoDB
from application.utils import num_tokens_from_string
from application.core.settings import settings
from application.utils import num_tokens_from_object_or_list, num_tokens_from_string
mongo = MongoDB.get_client()
db = mongo["docsgpt"]
db = mongo[settings.MONGO_DB_NAME]
usage_collection = db["token_usage"]
def update_token_usage(user_api_key, token_usage):
def update_token_usage(decoded_token, user_api_key, token_usage):
if "pytest" in sys.modules:
return
if decoded_token:
user_id = decoded_token["sub"]
else:
user_id = None
usage_data = {
"user_id": user_id,
"api_key": user_api_key,
"prompt_tokens": token_usage["prompt_tokens"],
"generated_tokens": token_usage["generated_tokens"],
@@ -21,28 +28,38 @@ def update_token_usage(user_api_key, token_usage):
def gen_token_usage(func):
def wrapper(self, model, messages, stream, **kwargs):
def wrapper(self, model, messages, stream, tools, **kwargs):
for message in messages:
self.token_usage["prompt_tokens"] += num_tokens_from_string(message["content"])
result = func(self, model, messages, stream, **kwargs)
self.token_usage["generated_tokens"] += num_tokens_from_string(result)
update_token_usage(self.user_api_key, self.token_usage)
if message["content"]:
self.token_usage["prompt_tokens"] += num_tokens_from_string(
message["content"]
)
result = func(self, model, messages, stream, tools, **kwargs)
if isinstance(result, str):
self.token_usage["generated_tokens"] += num_tokens_from_string(result)
else:
self.token_usage["generated_tokens"] += num_tokens_from_object_or_list(
result
)
update_token_usage(self.decoded_token, self.user_api_key, self.token_usage)
return result
return wrapper
def stream_token_usage(func):
def wrapper(self, model, messages, stream, **kwargs):
def wrapper(self, model, messages, stream, tools, **kwargs):
for message in messages:
self.token_usage["prompt_tokens"] += num_tokens_from_string(message["content"])
self.token_usage["prompt_tokens"] += num_tokens_from_string(
message["content"]
)
batch = []
result = func(self, model, messages, stream, **kwargs)
result = func(self, model, messages, stream, tools, **kwargs)
for r in result:
batch.append(r)
yield r
for line in batch:
self.token_usage["generated_tokens"] += num_tokens_from_string(line)
update_token_usage(self.user_api_key, self.token_usage)
update_token_usage(self.decoded_token, self.user_api_key, self.token_usage)
return wrapper

View File

@@ -1,5 +1,7 @@
import tiktoken
import hashlib
import re
import tiktoken
from flask import jsonify, make_response
@@ -15,8 +17,22 @@ def get_encoding():
def num_tokens_from_string(string: str) -> int:
encoding = get_encoding()
num_tokens = len(encoding.encode(string))
return num_tokens
if isinstance(string, str):
num_tokens = len(encoding.encode(string))
return num_tokens
else:
return 0
def num_tokens_from_object_or_list(thing):
if isinstance(thing, list):
return sum([num_tokens_from_object_or_list(x) for x in thing])
elif isinstance(thing, dict):
return sum([num_tokens_from_object_or_list(x) for x in thing.values()])
elif isinstance(thing, str):
return num_tokens_from_string(thing)
else:
return 0
def count_tokens_docs(docs):
@@ -44,5 +60,52 @@ def check_required_fields(data, required_fields):
def get_hash(data):
return hashlib.md5(data.encode()).hexdigest()
return hashlib.md5(data.encode(), usedforsecurity=False).hexdigest()
def limit_chat_history(history, max_token_limit=None, gpt_model="docsgpt"):
"""
Limits chat history based on token count.
Returns a list of messages that fit within the token limit.
"""
from application.core.settings import settings
max_token_limit = (
max_token_limit
if max_token_limit
and max_token_limit
< settings.MODEL_TOKEN_LIMITS.get(gpt_model, settings.DEFAULT_MAX_HISTORY)
else settings.MODEL_TOKEN_LIMITS.get(gpt_model, settings.DEFAULT_MAX_HISTORY)
)
if not history:
return []
trimmed_history = []
tokens_current_history = 0
for message in reversed(history):
tokens_batch = 0
if "prompt" in message and "response" in message:
tokens_batch += num_tokens_from_string(message["prompt"])
tokens_batch += num_tokens_from_string(message["response"])
if "tool_calls" in message:
for tool_call in message["tool_calls"]:
tool_call_string = f"Tool: {tool_call.get('tool_name')} | Action: {tool_call.get('action_name')} | Args: {tool_call.get('arguments')} | Response: {tool_call.get('result')}"
tokens_batch += num_tokens_from_string(tool_call_string)
if tokens_current_history + tokens_batch < max_token_limit:
tokens_current_history += tokens_batch
trimmed_history.insert(0, message)
else:
break
return trimmed_history
def validate_function_name(function_name):
"""Validates if a function name matches the allowed pattern."""
if not re.match(r"^[a-zA-Z0-9_-]+$", function_name):
return False
return True

View File

@@ -75,9 +75,9 @@ class BaseVectorStore(ABC):
openai_api_key=embeddings_key
)
elif embeddings_name == "huggingface_sentence-transformers/all-mpnet-base-v2":
if os.path.exists("./model/all-mpnet-base-v2"):
if os.path.exists("./models/all-mpnet-base-v2"):
embedding_instance = EmbeddingsSingleton.get_instance(
embeddings_name="./model/all-mpnet-base-v2",
embeddings_name = "./models/all-mpnet-base-v2",
)
else:
embedding_instance = EmbeddingsSingleton.get_instance(
@@ -86,4 +86,5 @@ class BaseVectorStore(ABC):
else:
embedding_instance = EmbeddingsSingleton.get_instance(embeddings_name)
return embedding_instance
return embedding_instance

View File

@@ -1,9 +1,6 @@
from application.vectorstore.base import BaseVectorStore
from application.core.settings import settings
from application.vectorstore.document_class import Document
import elasticsearch
class ElasticsearchStore(BaseVectorStore):
@@ -26,8 +23,7 @@ class ElasticsearchStore(BaseVectorStore):
else:
raise ValueError("Please provide either elasticsearch_url or cloud_id.")
import elasticsearch
ElasticsearchStore._es_connection = elasticsearch.Elasticsearch(**connection_params)
self.docsearch = ElasticsearchStore._es_connection
@@ -155,8 +151,6 @@ class ElasticsearchStore(BaseVectorStore):
**kwargs,
):
from elasticsearch.helpers import BulkIndexError, bulk
bulk_kwargs = bulk_kwargs or {}
import uuid
embeddings = []
@@ -189,6 +183,7 @@ class ElasticsearchStore(BaseVectorStore):
if len(requests) > 0:
from elasticsearch.helpers import BulkIndexError, bulk
try:
success, failed = bulk(
self._es_connection,

View File

@@ -1,30 +1,64 @@
from langchain_community.vectorstores import FAISS
from application.vectorstore.base import BaseVectorStore
from application.core.settings import settings
import os
import tempfile
from langchain_community.vectorstores import FAISS
from application.core.settings import settings
from application.parser.schema.base import Document
from application.vectorstore.base import BaseVectorStore
from application.storage.storage_creator import StorageCreator
def get_vectorstore(path: str) -> str:
if path:
vectorstore = os.path.join("application", "indexes", path)
vectorstore = f"indexes/{path}"
else:
vectorstore = os.path.join("application")
vectorstore = "indexes"
return vectorstore
class FaissStore(BaseVectorStore):
def __init__(self, source_id: str, embeddings_key: str, docs_init=None):
super().__init__()
self.source_id = source_id
self.path = get_vectorstore(source_id)
embeddings = self._get_embeddings(settings.EMBEDDINGS_NAME, embeddings_key)
self.embeddings = self._get_embeddings(settings.EMBEDDINGS_NAME, embeddings_key)
self.storage = StorageCreator.get_storage()
try:
if docs_init:
self.docsearch = FAISS.from_documents(docs_init, embeddings)
self.docsearch = FAISS.from_documents(docs_init, self.embeddings)
else:
self.docsearch = FAISS.load_local(self.path, embeddings, allow_dangerous_deserialization=True)
except Exception:
raise
with tempfile.TemporaryDirectory() as temp_dir:
faiss_path = f"{self.path}/index.faiss"
pkl_path = f"{self.path}/index.pkl"
self.assert_embedding_dimensions(embeddings)
if not self.storage.file_exists(
faiss_path
) or not self.storage.file_exists(pkl_path):
raise FileNotFoundError(
f"Index files not found in storage at {self.path}"
)
faiss_file = self.storage.get_file(faiss_path)
pkl_file = self.storage.get_file(pkl_path)
local_faiss_path = os.path.join(temp_dir, "index.faiss")
local_pkl_path = os.path.join(temp_dir, "index.pkl")
with open(local_faiss_path, "wb") as f:
f.write(faiss_file.read())
with open(local_pkl_path, "wb") as f:
f.write(pkl_file.read())
self.docsearch = FAISS.load_local(
temp_dir, self.embeddings, allow_dangerous_deserialization=True
)
except Exception as e:
raise Exception(f"Error loading FAISS index: {str(e)}")
self.assert_embedding_dimensions(self.embeddings)
def search(self, *args, **kwargs):
return self.docsearch.similarity_search(*args, **kwargs)
@@ -40,11 +74,42 @@ class FaissStore(BaseVectorStore):
def assert_embedding_dimensions(self, embeddings):
"""Check that the word embedding dimension of the docsearch index matches the dimension of the word embeddings used."""
if settings.EMBEDDINGS_NAME == "huggingface_sentence-transformers/all-mpnet-base-v2":
word_embedding_dimension = getattr(embeddings, 'dimension', None)
if (
settings.EMBEDDINGS_NAME
== "huggingface_sentence-transformers/all-mpnet-base-v2"
):
word_embedding_dimension = getattr(embeddings, "dimension", None)
if word_embedding_dimension is None:
raise AttributeError("'dimension' attribute not found in embeddings instance.")
raise AttributeError(
"'dimension' attribute not found in embeddings instance."
)
docsearch_index_dimension = self.docsearch.index.d
if word_embedding_dimension != docsearch_index_dimension:
raise ValueError(f"Embedding dimension mismatch: embeddings.dimension ({word_embedding_dimension}) != docsearch index dimension ({docsearch_index_dimension})")
raise ValueError(
f"Embedding dimension mismatch: embeddings.dimension ({word_embedding_dimension}) != docsearch index dimension ({docsearch_index_dimension})"
)
def get_chunks(self):
chunks = []
if self.docsearch:
for doc_id, doc in self.docsearch.docstore._dict.items():
chunk_data = {
"doc_id": doc_id,
"text": doc.page_content,
"metadata": doc.metadata,
}
chunks.append(chunk_data)
return chunks
def add_chunk(self, text, metadata=None):
metadata = metadata or {}
doc = Document(text=text, extra_info=metadata).to_langchain_format()
doc_id = self.docsearch.add_documents([doc])
self.save_local(self.path)
return doc_id
def delete_chunk(self, chunk_id):
self.delete_index([chunk_id])
self.save_local(self.path)
return True

View File

@@ -1,3 +1,4 @@
import logging
from application.core.settings import settings
from application.vectorstore.base import BaseVectorStore
from application.vectorstore.document_class import Document
@@ -124,3 +125,53 @@ class MongoDBVectorStore(BaseVectorStore):
def delete_index(self, *args, **kwargs):
self._collection.delete_many({"source_id": self._source_id})
def get_chunks(self):
try:
chunks = []
cursor = self._collection.find({"source_id": self._source_id})
for doc in cursor:
doc_id = str(doc.get("_id"))
text = doc.get(self._text_key)
metadata = {
k: v
for k, v in doc.items()
if k
not in ["_id", self._text_key, self._embedding_key, "source_id"]
}
if text:
chunks.append(
{"doc_id": doc_id, "text": text, "metadata": metadata}
)
return chunks
except Exception as e:
logging.error(f"Error getting chunks: {e}", exc_info=True)
return []
def add_chunk(self, text, metadata=None):
metadata = metadata or {}
embeddings = self._embedding.embed_documents([text])
if not embeddings:
raise ValueError("Could not generate embedding for chunk")
chunk_data = {
self._text_key: text,
self._embedding_key: embeddings[0],
"source_id": self._source_id,
**metadata,
}
result = self._collection.insert_one(chunk_data)
return str(result.inserted_id)
def delete_chunk(self, chunk_id):
try:
from bson.objectid import ObjectId
object_id = ObjectId(chunk_id)
result = self._collection.delete_one({"_id": object_id})
return result.deleted_count > 0
except Exception as e:
logging.error(f"Error deleting chunk: {e}", exc_info=True)
return False

View File

@@ -1,11 +1,12 @@
from langchain_community.vectorstores.qdrant import Qdrant
from application.vectorstore.base import BaseVectorStore
from application.core.settings import settings
from qdrant_client import models
class QdrantStore(BaseVectorStore):
def __init__(self, source_id: str = "", embeddings_key: str = "embeddings"):
from qdrant_client import models
from langchain_community.vectorstores.qdrant import Qdrant
self._filter = models.Filter(
must=[
models.FieldCondition(

View File

@@ -1,25 +1,37 @@
import datetime
import json
import logging
import mimetypes
import os
import shutil
import string
import tempfile
import zipfile
from collections import Counter
from urllib.parse import urljoin
import requests
from bson.dbref import DBRef
from bson.objectid import ObjectId
from application.agents.agent_creator import AgentCreator
from application.api.answer.routes import get_prompt
from application.core.mongo_db import MongoDB
from application.core.settings import settings
from application.parser.chunking import Chunker
from application.parser.embedding_pipeline import embed_and_store_documents
from application.parser.file.bulk import SimpleDirectoryReader
from application.parser.open_ai_func import call_openai_api
from application.parser.remote.remote_creator import RemoteCreator
from application.parser.schema.base import Document
from application.parser.token_func import group_split
from application.utils import count_tokens_docs
from application.retriever.retriever_creator import RetrieverCreator
from application.storage.storage_creator import StorageCreator
from application.utils import count_tokens_docs, num_tokens_from_string
mongo = MongoDB.get_client()
db = mongo["docsgpt"]
db = mongo[settings.MONGO_DB_NAME]
sources_collection = db["sources"]
# Constants
@@ -27,18 +39,22 @@ MIN_TOKENS = 150
MAX_TOKENS = 1250
RECURSION_DEPTH = 2
# Define a function to extract metadata from a given filename.
def metadata_from_filename(title):
return {"title": title}
# Define a function to generate a random string of a given length.
def generate_random_string(length):
return "".join([string.ascii_letters[i % 52] for i in range(length)])
current_dir = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
def extract_zip_recursive(zip_path, extract_to, current_depth=0, max_depth=5):
"""
Recursively extract zip files with a limit on recursion depth.
@@ -58,7 +74,7 @@ def extract_zip_recursive(zip_path, extract_to, current_depth=0, max_depth=5):
zip_ref.extractall(extract_to)
os.remove(zip_path) # Remove the zip file after extracting
except Exception as e:
logging.error(f"Error extracting zip file {zip_path}: {e}")
logging.error(f"Error extracting zip file {zip_path}: {e}", exc_info=True)
return
# Check for nested zip files and extract them
@@ -69,6 +85,7 @@ def extract_zip_recursive(zip_path, extract_to, current_depth=0, max_depth=5):
file_path = os.path.join(root, file)
extract_zip_recursive(file_path, root, current_depth + 1, max_depth)
def download_file(url, params, dest_path):
try:
response = requests.get(url, params=params)
@@ -79,6 +96,7 @@ def download_file(url, params, dest_path):
logging.error(f"Error downloading file: {e}")
raise
def upload_index(full_path, file_data):
try:
if settings.VECTOR_STORE == "faiss":
@@ -87,7 +105,9 @@ def upload_index(full_path, file_data):
"file_pkl": open(full_path + "/index.pkl", "rb"),
}
response = requests.post(
urljoin(settings.API_URL, "/api/upload_index"), files=files, data=file_data
urljoin(settings.API_URL, "/api/upload_index"),
files=files,
data=file_data,
)
else:
response = requests.post(
@@ -102,6 +122,76 @@ def upload_index(full_path, file_data):
for file in files.values():
file.close()
def run_agent_logic(agent_config, input_data):
try:
source = agent_config.get("source")
retriever = agent_config.get("retriever", "classic")
if isinstance(source, DBRef):
source_doc = db.dereference(source)
source = str(source_doc["_id"])
retriever = source_doc.get("retriever", agent_config.get("retriever"))
else:
source = {}
source = {"active_docs": source}
chunks = int(agent_config.get("chunks", 2))
prompt_id = agent_config.get("prompt_id", "default")
user_api_key = agent_config["key"]
agent_type = agent_config.get("agent_type", "classic")
decoded_token = {"sub": agent_config.get("user")}
prompt = get_prompt(prompt_id)
agent = AgentCreator.create_agent(
agent_type,
endpoint="webhook",
llm_name=settings.LLM_NAME,
gpt_model=settings.MODEL_NAME,
api_key=settings.API_KEY,
user_api_key=user_api_key,
prompt=prompt,
chat_history=[],
decoded_token=decoded_token,
attachments=[],
)
retriever = RetrieverCreator.create_retriever(
retriever,
source=source,
chat_history=[],
prompt=prompt,
chunks=chunks,
token_limit=settings.DEFAULT_MAX_HISTORY,
gpt_model=settings.MODEL_NAME,
user_api_key=user_api_key,
decoded_token=decoded_token,
)
answer = agent.gen(query=input_data, retriever=retriever)
response_full = ""
thought = ""
source_log_docs = []
tool_calls = []
for line in answer:
if "answer" in line:
response_full += str(line["answer"])
elif "sources" in line:
source_log_docs.extend(line["sources"])
elif "tool_calls" in line:
tool_calls.extend(line["tool_calls"])
elif "thought" in line:
thought += line["thought"]
result = {
"answer": response_full,
"sources": source_log_docs,
"tool_calls": tool_calls,
"thought": thought,
}
logging.info(f"Agent response: {result}")
return result
except Exception as e:
logging.error(f"Error in run_agent_logic: {e}", exc_info=True)
raise
# Define the main function for ingesting and processing documents.
def ingest_worker(
self, directory, formats, name_job, filename, user, retriever="classic"
@@ -126,61 +216,87 @@ def ingest_worker(
limit = None
exclude = True
sample = False
token_check = True
storage = StorageCreator.get_storage()
full_path = os.path.join(directory, user, name_job)
source_file_path = os.path.join(full_path, filename)
logging.info(f"Ingest file: {full_path}", extra={"user": user, "job": name_job})
file_data = {"name": name_job, "file": filename, "user": user}
if not os.path.exists(full_path):
os.makedirs(full_path)
download_file(urljoin(settings.API_URL, "/api/download"), file_data, os.path.join(full_path, filename))
# Create temporary working directory
with tempfile.TemporaryDirectory() as temp_dir:
try:
os.makedirs(temp_dir, exist_ok=True)
# check if file is .zip and extract it
if filename.endswith(".zip"):
extract_zip_recursive(
os.path.join(full_path, filename), full_path, 0, RECURSION_DEPTH
)
# Download file from storage to temp directory
temp_file_path = os.path.join(temp_dir, filename)
file_data = storage.get_file(source_file_path)
self.update_state(state="PROGRESS", meta={"current": 1})
with open(temp_file_path, "wb") as f:
f.write(file_data.read())
raw_docs = SimpleDirectoryReader(
input_dir=full_path,
input_files=input_files,
recursive=recursive,
required_exts=formats,
num_files_limit=limit,
exclude_hidden=exclude,
file_metadata=metadata_from_filename,
).load_data()
raw_docs = group_split(
documents=raw_docs,
min_tokens=MIN_TOKENS,
max_tokens=MAX_TOKENS,
token_check=token_check,
)
self.update_state(state="PROGRESS", meta={"current": 1})
docs = [Document.to_langchain_format(raw_doc) for raw_doc in raw_docs]
id = ObjectId()
# Handle zip files
if filename.endswith(".zip"):
logging.info(f"Extracting zip file: {filename}")
extract_zip_recursive(
temp_file_path, temp_dir, current_depth=0, max_depth=RECURSION_DEPTH
)
call_openai_api(docs, full_path, id, self)
tokens = count_tokens_docs(docs)
self.update_state(state="PROGRESS", meta={"current": 100})
if sample:
logging.info(f"Sample mode enabled. Using {limit} documents.")
if sample:
for i in range(min(5, len(raw_docs))):
logging.info(f"Sample document {i}: {raw_docs[i]}")
reader = SimpleDirectoryReader(
input_dir=temp_dir,
input_files=input_files,
recursive=recursive,
required_exts=formats,
exclude_hidden=exclude,
file_metadata=metadata_from_filename,
)
raw_docs = reader.load_data()
file_data.update({
"tokens": tokens,
"retriever": retriever,
"id": str(id),
"type": "local",
})
upload_index(full_path, file_data)
chunker = Chunker(
chunking_strategy="classic_chunk",
max_tokens=MAX_TOKENS,
min_tokens=MIN_TOKENS,
duplicate_headers=False,
)
raw_docs = chunker.chunk(documents=raw_docs)
# delete local
shutil.rmtree(full_path)
docs = [Document.to_langchain_format(raw_doc) for raw_doc in raw_docs]
id = ObjectId()
vector_store_path = os.path.join(temp_dir, "vector_store")
os.makedirs(vector_store_path, exist_ok=True)
embed_and_store_documents(docs, vector_store_path, id, self)
tokens = count_tokens_docs(docs)
self.update_state(state="PROGRESS", meta={"current": 100})
if sample:
for i in range(min(5, len(raw_docs))):
logging.info(f"Sample document {i}: {raw_docs[i]}")
file_data = {
"name": name_job,
"file": filename,
"user": user,
"tokens": tokens,
"retriever": retriever,
"id": str(id),
"type": "local",
}
upload_index(vector_store_path, file_data)
except Exception as e:
logging.error(f"Error in ingest_worker: {e}", exc_info=True)
raise
return {
"directory": directory,
@@ -191,6 +307,7 @@ def ingest_worker(
"limited": False,
}
def remote_worker(
self,
source_data,
@@ -203,53 +320,63 @@ def remote_worker(
operation_mode="upload",
doc_id=None,
):
token_check = True
full_path = os.path.join(directory, user, name_job)
if not os.path.exists(full_path):
os.makedirs(full_path)
self.update_state(state="PROGRESS", meta={"current": 1})
logging.info(
f"Remote job: {full_path}",
extra={"user": user, "job": name_job, "source_data": source_data},
)
try:
logging.info("Initializing remote loader with type: %s", loader)
remote_loader = RemoteCreator.create_loader(loader)
raw_docs = remote_loader.load_data(source_data)
remote_loader = RemoteCreator.create_loader(loader)
raw_docs = remote_loader.load_data(source_data)
chunker = Chunker(
chunking_strategy="classic_chunk",
max_tokens=MAX_TOKENS,
min_tokens=MIN_TOKENS,
duplicate_headers=False,
)
docs = chunker.chunk(documents=raw_docs)
docs = [Document.to_langchain_format(raw_doc) for raw_doc in raw_docs]
tokens = count_tokens_docs(docs)
logging.info("Total tokens calculated: %d", tokens)
docs = group_split(
documents=raw_docs,
min_tokens=MIN_TOKENS,
max_tokens=MAX_TOKENS,
token_check=token_check,
)
tokens = count_tokens_docs(docs)
if operation_mode == "upload":
id = ObjectId()
call_openai_api(docs, full_path, id, self)
elif operation_mode == "sync":
if not doc_id or not ObjectId.is_valid(doc_id):
raise ValueError("doc_id must be provided for sync operation.")
id = ObjectId(doc_id)
call_openai_api(docs, full_path, id, self)
self.update_state(state="PROGRESS", meta={"current": 100})
if operation_mode == "upload":
id = ObjectId()
embed_and_store_documents(docs, full_path, id, self)
elif operation_mode == "sync":
if not doc_id or not ObjectId.is_valid(doc_id):
logging.error("Invalid doc_id provided for sync operation: %s", doc_id)
raise ValueError("doc_id must be provided for sync operation.")
id = ObjectId(doc_id)
embed_and_store_documents(docs, full_path, id, self)
file_data = {
"name": name_job,
"user": user,
"tokens": tokens,
"retriever": retriever,
"id": str(id),
"type": loader,
"remote_data": source_data,
"sync_frequency": sync_frequency,
}
upload_index(full_path, file_data)
self.update_state(state="PROGRESS", meta={"current": 100})
shutil.rmtree(full_path)
file_data = {
"name": name_job,
"user": user,
"tokens": tokens,
"retriever": retriever,
"id": str(id),
"type": loader,
"remote_data": source_data,
"sync_frequency": sync_frequency,
}
upload_index(full_path, file_data)
except Exception as e:
logging.error("Error in remote_worker task: %s", str(e), exc_info=True)
raise
finally:
if os.path.exists(full_path):
shutil.rmtree(full_path)
logging.info("remote_worker task completed successfully")
return {"urls": source_data, "name_job": name_job, "user": user, "limited": False}
def sync(
self,
source_data,
@@ -275,10 +402,11 @@ def sync(
doc_id,
)
except Exception as e:
logging.error(f"Error during sync: {e}")
logging.error(f"Error during sync: {e}", exc_info=True)
return {"status": "error", "error": str(e)}
return {"status": "success"}
def sync_worker(self, frequency):
sync_counts = Counter()
sources = sources_collection.find()
@@ -302,3 +430,121 @@ def sync_worker(self, frequency):
key: sync_counts[key]
for key in ["total_sync_count", "sync_success", "sync_failure"]
}
def attachment_worker(self, file_info, user):
"""
Process and store a single attachment without vectorization.
"""
mongo = MongoDB.get_client()
db = mongo[settings.MONGO_DB_NAME]
attachments_collection = db["attachments"]
filename = file_info["filename"]
attachment_id = file_info["attachment_id"]
relative_path = file_info["path"]
metadata = file_info.get("metadata", {})
try:
self.update_state(state="PROGRESS", meta={"current": 10})
storage = StorageCreator.get_storage()
self.update_state(
state="PROGRESS", meta={"current": 30, "status": "Processing content"}
)
content = storage.process_file(
relative_path,
lambda local_path, **kwargs: SimpleDirectoryReader(
input_files=[local_path], exclude_hidden=True, errors="ignore"
).load_data()[0].text
)
token_count = num_tokens_from_string(content)
self.update_state(
state="PROGRESS", meta={"current": 80, "status": "Storing in database"}
)
mime_type = mimetypes.guess_type(filename)[0] or "application/octet-stream"
doc_id = ObjectId(attachment_id)
attachments_collection.insert_one(
{
"_id": doc_id,
"user": user,
"path": relative_path,
"content": content,
"token_count": token_count,
"mime_type": mime_type,
"date": datetime.datetime.now(),
"metadata": metadata,
}
)
logging.info(
f"Stored attachment with ID: {attachment_id}", extra={"user": user}
)
self.update_state(
state="PROGRESS", meta={"current": 100, "status": "Complete"}
)
return {
"filename": filename,
"path": relative_path,
"token_count": token_count,
"attachment_id": attachment_id,
"mime_type": mime_type,
"metadata": metadata,
}
except Exception as e:
logging.error(
f"Error processing file {filename}: {e}",
extra={"user": user},
exc_info=True,
)
raise
def agent_webhook_worker(self, agent_id, payload):
"""
Process the webhook payload for an agent.
Args:
self: Reference to the instance of the task.
agent_id (str): Unique identifier for the agent.
payload (dict): The payload data from the webhook.
Returns:
dict: Information about the processed webhook.
"""
mongo = MongoDB.get_client()
db = mongo["docsgpt"]
agents_collection = db["agents"]
self.update_state(state="PROGRESS", meta={"current": 1})
try:
agent_oid = ObjectId(agent_id)
agent_config = agents_collection.find_one({"_id": agent_oid})
if not agent_config:
raise ValueError(f"Agent with ID {agent_id} not found.")
input_data = json.dumps(payload)
except Exception as e:
logging.error(f"Error processing agent webhook: {e}", exc_info=True)
return {"status": "error", "error": str(e)}
self.update_state(state="PROGRESS", meta={"current": 50})
try:
result = run_agent_logic(agent_config, input_data)
except Exception as e:
logging.error(f"Error running agent logic: {e}", exc_info=True)
return {"status": "error", "error": str(e)}
finally:
self.update_state(state="PROGRESS", meta={"current": 100})
logging.info(
f"Webhook processed for agent {agent_id}", extra={"agent_id": agent_id}
)
return {"status": "success", "result": result}

View File

@@ -1,6 +1,6 @@
services:
frontend:
build: ./frontend
build: ../frontend
environment:
- VITE_API_HOST=http://localhost:7091
- VITE_API_STREAMING=$VITE_API_STREAMING
@@ -10,7 +10,7 @@ services:
- backend
backend:
build: ./application
build: ../application
environment:
- API_KEY=$OPENAI_API_KEY
- EMBEDDINGS_KEY=$OPENAI_API_KEY
@@ -25,15 +25,15 @@ services:
ports:
- "7091:7091"
volumes:
- ./application/indexes:/app/application/indexes
- ./application/inputs:/app/application/inputs
- ./application/vectors:/app/application/vectors
- ../application/indexes:/app/application/indexes
- ../application/inputs:/app/application/inputs
- ../application/vectors:/app/application/vectors
depends_on:
- redis
- mongo
worker:
build: ./application
build: ../application
command: celery -A application.app.celery worker -l INFO
environment:
- API_KEY=$OPENAI_API_KEY

View File

@@ -0,0 +1,18 @@
services:
redis:
image: redis:6-alpine
ports:
- 6379:6379
mongo:
image: mongo:6
ports:
- 27017:27017
volumes:
- mongodb_data_container:/data/db
volumes:
mongodb_data_container:

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