Compare commits

..

340 Commits

Author SHA1 Message Date
Archer
608e58ba41 4.8.13 test (#3107)
* perf: select file

* perf: drop files

* fix: imple mode adapt files
2024-11-09 15:07:24 +08:00
Archer
044b0c57f7 4.8.13 test (#3106)
* perf: select file

* perf: drop files

* perf: env template
2024-11-09 14:46:14 +08:00
a.e.
7d7454ef3b feat: source id prefix env (#3103) 2024-11-09 14:44:10 +08:00
Archer
0d658c0114 fix: plugin select files and ai response check (#3104)
* fix: plugin select files and ai response check

* perf: text editor selector;tool call tip;remove invalid image url;

* perf: select file

* perf: drop files
2024-11-09 14:43:15 +08:00
Archer
d58cf44778 4.8.13 test (#3102)
* fix: loop index;edge parent check

* perf: reference invalid check

* fix: ts
2024-11-08 20:53:58 +08:00
Archer
7537330a3b feat: loop start add index (#3101)
* feat: loop start add index

* update doc
2024-11-08 17:21:19 +08:00
heheer
a7f881fc5e array reference check & node ui (#3100) 2024-11-08 17:19:05 +08:00
Archer
fc7304d3cd 4.8.13 test (#3098)
* perf: loop node refresh

* rename context

* comment

* fix: ts

* perf: push chat log
2024-11-08 16:02:33 +08:00
a.e.
aa50174066 feat: support push chat log (#3093)
* feat: custom uid/metadata

* to: custom info

* fix: chat push latest

* feat: add chat log envs

* refactor: move timer to pushChatLog

* fix: using precise log

---------

Co-authored-by: Finley Ge <m13203533462@163.com>
2024-11-08 15:35:27 +08:00
heheer
5b2cc097b0 loop node dynamic height (#3092)
* loop node dynamic height

* fix

* fix
2024-11-08 12:10:15 +08:00
Archer
7a933f73b6 fix: http tool response (#3097) 2024-11-08 11:56:18 +08:00
Archer
3e5d7d0d7a fix: workflow file upload refresh (#3088) 2024-11-07 15:04:46 +08:00
Archer
d15ec1ae69 4.8.13 test (#3087)
* fix: image expired

* fix: datacard navbar ui

* perf: build action
2024-11-07 14:01:00 +08:00
heheer
3b82ed0aa1 feat: support sub route config (#3071)
* feat: support sub route config

* dockerfile

* fix upload

* delete unused code
2024-11-07 13:53:23 +08:00
Archer
dc95ab1dc1 4.8.13 test (#3085)
* perf: workflow node ui

* chat iframe url
2024-11-07 12:03:21 +08:00
Archer
fa2fbc1ddd perf: workflow context split (#3083)
* perf: workflow context split

* perf: context
2024-11-07 10:05:03 +08:00
heheer
10421d73f4 add dispatch try catch (#3075) 2024-11-07 10:05:03 +08:00
Archer
a9ee6e6a5e feat: View will move when workflow check error;fix: ui refresh error when continuous file upload (#3077)
* fix: plugin output check

* fix: ui refresh error when continuous file upload

* feat: View will move when workflow check error
2024-11-07 10:05:03 +08:00
heheer
0f1932aadc node pluginoutput check (#3074) 2024-11-07 10:05:02 +08:00
Archer
65a39e80b8 feat: iframe code block;perf: workflow selector type (#3076)
* feat: iframe code block

* perf: workflow selector type
2024-11-07 10:05:02 +08:00
heheer
0db0cbf376 feat: support array reference multi-select (#3041)
* feat: support array reference multi-select

* fix build

* fix

* fix loop multi-select

* adjust condition

* fix get value

* array and non-array conversion

* fix plugin input

* merge func
2024-11-07 10:05:02 +08:00
heheer
f4dbe7c021 fix ui (#3065)
* fix ui

* fix
2024-11-07 10:05:02 +08:00
Archer
07b3a0a35d perf: dockerfile proxy (#3067) 2024-11-07 10:05:01 +08:00
Archer
fd49ad1342 Adapt findLast api;perf: markdown zh format. (#3066)
* perf: context code

* fix: adapt findLast api

* perf: commercial plugin run error

* perf: markdown zh format
2024-11-07 10:05:01 +08:00
Finley Ge
f90803c558 pref: slow query of full text search (#3044) 2024-11-07 10:05:01 +08:00
papapatrick
49cd2d7a3c add chatType (#3060) 2024-11-07 10:05:01 +08:00
papapatrick
727bd7144c feat: add chat history time label (#3024)
* feat:add chat and logs time

* feat: add chat history time label

* code perf

* code perf

---------

Co-authored-by: 勤劳上班的卑微小张 <jiazhan.zhang@ggimage.com>
2024-11-07 10:05:01 +08:00
Archer
469858877e New file upload (#3058)
* feat: toolNode aiNode readFileNode adapt new version

* update docker-compose

* update tip

* feat: adapt new file version

* perf: file input

* fix: ts
2024-11-07 10:05:01 +08:00
heheer
7a929db0a5 chore(ui): login page & workflow page (#3046)
* login page & number input & multirow select & llm select

* workflow

* adjust nodes
2024-11-07 10:04:58 +08:00
Carson Yang
0645b274da Docs: add docs for loop node (#3069) 2024-11-05 10:11:59 +08:00
heheer
cf8786b194 fix: node version update flicker (#3052) 2024-11-01 15:54:12 +08:00
tzq84
be6269688b feat(voice): add fallback for browsers without MediaSource support (#3043)
- Add MediaSource support detection function
- Implement fallback solution for browsers that don't support MediaSource:
  - For single audio: Read full stream before playing
  - For segmented audio: Wait until all text is received then play as one audio
- Improve code robustness and browser compatibility
2024-11-01 14:50:49 +08:00
Archer
912b264a47 perf: forbid image to base64 (#3038)
* perf: forbid image to base64

* update file upload path

* feat: support promptCall use image

* fix: echarts load

* update doc
2024-11-01 14:29:20 +08:00
Archer
7ef1821557 Update 4812.md (#3051) 2024-11-01 11:16:27 +08:00
Archer
4061b11922 fix: dataset select check (#3048) 2024-10-31 17:25:02 +08:00
Finley Ge
bc171db945 fix: alldataset get dataset without folders. omit the permission check (#3047) 2024-10-31 17:06:56 +08:00
Jiangween
eb365fef44 Update i18n files and Upload component (#3040)
* Update i18n files and Upload component

* 完善 i18n 和优化 Upload.tsx 文件

* 修改Upload.tsx 文件的问题...
2024-10-31 15:25:00 +08:00
Archer
2e7047cb3b Update 4812.md (#3036) 2024-10-31 00:48:36 +08:00
Archer
89a817d1c9 fix: dataset select cannot refresh (#3032)
* fix: dataset select cannot refresh

* update cors
2024-10-30 19:30:31 +08:00
Finley Ge
e788bcaabe fix: only owner or team owner can change app's owner (#3033) 2024-10-30 19:11:54 +08:00
heheer
9219903341 add goole tag manager (#3028) 2024-10-30 19:04:26 +08:00
Finley Ge
6939899baa fix: allDataset (#3031) 2024-10-30 19:02:08 +08:00
papapatrick
732b6d7780 add more market template (#3030)
* add more market template

* delete long translate avatar
2024-10-30 18:42:46 +08:00
heheer
e361279208 feat: add baidu conversion tracking (#3016)
* feat: add baidu conversion tracking

* chore
2024-10-30 14:40:49 +08:00
Archer
946fda0843 4.8.12 test (#3026)
* perf: app list permission

* perf: create dataset tip

* fix: create dataset
2024-10-30 14:23:37 +08:00
Archer
97216eec59 perf: app list permission (#3023)
* perf: app list permission

* perf: create dataset tip
2024-10-30 12:38:16 +08:00
Finley Ge
9f4aa3160e fix: app/dataset auth (#3021) 2024-10-30 11:50:25 +08:00
Archer
8e4084f7ee update text splitter (#3020) 2024-10-30 01:10:35 +08:00
Archer
ee718750e2 perf: dataset data auth (#3015) 2024-10-29 15:44:46 +08:00
Archer
1e02544c3a feat: reset milvus (#3013) 2024-10-29 14:55:27 +08:00
heheer
98771284e4 app list open-api & completion with appid & get history source (#3011)
* app list open-api & completion with appid & get history source

* change default value position
2024-10-29 14:27:29 +08:00
Finley Ge
efc4e860b7 fix/group (#3012)
* fix: app/dataset list private resource bug

* fix: auth owner
2024-10-29 11:22:21 +08:00
Archer
e06d72e86e 4.8.12 test (#3006)
* perf: oneapi error tip

* fix: qps limit condition error

* perf: Plan tip

* fix: permission modal ui

* perf: dataset slider ui

* perf: api key auth tmbId problem

* perf: dataset upload i18n

* fix: http json path check
2024-10-28 22:47:45 +08:00
Finley Ge
b712a821f8 fix: upload file (#2992)
* fix: upload file

* chore: remove wasm, support html image parse

* chore: adjust

* chore: move base64match function into htmlstr2md
2024-10-28 21:44:50 +08:00
Finley Ge
4e3d817b63 fix: milvus (#3004) 2024-10-28 16:06:08 +08:00
heheer
78a85bf847 fix: optimize tool node check in workflow (#3002)
* fix: optimize tool node check in workflow

* comment
2024-10-28 15:37:00 +08:00
ainuoyan
a5b913f1b1 Update chat.md (#2996) 2024-10-27 18:44:52 +08:00
Jiangween
7ee1a340e6 Re-add RAG documentation and images (#2995) 2024-10-27 09:15:44 +08:00
Archer
c722ced68d 4.8.12 test (#2994)
* perf: run loop code

* doc

* fix: mulity loop node will error; loop node variables cannot inherit

* back save tip position

* fix: child workflow runtime

* stream connection
2024-10-25 23:13:53 +08:00
Archer
f89452acdd Group role (#2993)
* feat: app/dataset support group (#2898)

* pref: member-group (#2862)

* feat: group list ordered by updateTime

* fix: transfer ownership of group when deleting member

* fix: i18n fix

* feat: can not set member as admin/owner when user is not active

* fix: GroupInfoModal hover input do not change color

* fix(fe): searchinput do not scroll

* feat: app collaborator with group, remove default permission

* feat: dataset collaborator with group, remove default permission

* chore(test): pref mock

* chore: remove useless code

* chore: adjust

* fix: add self as collaborator when creating folder

* fix(fe): folder manage menu do not show when user has write permission
only

* fix: dataset folder create

* feat: Add code comment

* Pref: app move (#2952)

* perf: app schema

* doc

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
2024-10-25 19:39:11 +08:00
Archer
74d58d562b 4.8.12 test fix (#2988)
* perf: qps limit

* perf: http response data

* perf: json path check

* fix: ts

* loop support reference parent variable
2024-10-25 16:34:26 +08:00
heheer
165fe077bc fix: http raw response undefined (#2981) 2024-10-25 11:53:32 +08:00
Finley Ge
75494f8d01 feat: QPS Limit middleware (#2956)
* feat: QPS Limit middleware

* chore: use request-ip to get client ip

* feat: frequencyLimit schema
2024-10-25 10:08:59 +08:00
papapatrick
bb727b0710 add bing search plugins (#2970) 2024-10-23 22:45:06 +08:00
Archer
9b0706ed92 HTTP support jsonPath; System plugin support save file. (#2969)
* perf: system plugin auto save file

* feat: http support jsonPath

* fix: assistant response

* reset milvus version

* fix: textarea register

* fix: global variable

* delete tip

* doc
2024-10-23 00:40:54 +08:00
Finley Ge
718108a552 fix: milvus (#2968) 2024-10-22 21:53:48 +08:00
heheer
025facbc2d perf:textarea auto height (#2967)
* perf:textarea auto height

* optimize editor height & fix variable label split
2024-10-22 18:33:02 +08:00
Archer
87b4061302 System plugin adapt reference type in plugin input (#2965)
* perf: plugin input support reference

* perf: system plugin adapt plugin input reference
2024-10-22 14:51:15 +08:00
Archer
618729a254 Concat textinput to input type (#2963)
* perf: toast position

* concat textinput to input
2024-10-22 12:04:16 +08:00
heheer
3f34c33d4c perf: all plugin variables type support referense & replace input and textarea with prompt editor (#2950)
* support reference as plugin variables

* replace input and textarea with prompt editor

* adjust height & optimize textarea and input

* input select
2024-10-22 11:21:28 +08:00
zhengkai
779ff29ed5 typofix:laf函数调用时,弹出文字错误 (#2951)
* typofix:laf函数调用时,弹出文字错误

laf函数调用,新增/编辑输出时,显示错误,目前显示为新增/编辑输入

* fix typo ui
2024-10-22 08:50:03 +08:00
papapatrick
445a38924f add google search plugin (#2947) 2024-10-22 08:49:05 +08:00
silencezhang
7ec2253f0a 新增数据源配置:可以直接执行sql,支持MySQL,PG数据库 (#2958) 2024-10-21 14:26:33 +08:00
heheer
6522cc7dfa chore: adjust toast top distance (#2953)
* adjust toast top distance

* save button top
2024-10-18 17:20:57 +08:00
Archer
40f527a021 4.8.12 test (#2936)
* system config tip

* perf: prompt editor code

* perf: cookie tip
2024-10-18 16:49:35 +08:00
Zhenyi-Wang
4aaf9bfeb0 在“发布成功”通知中,显示关闭按钮 (#2948)
* feat: remove style tag when fetching url

* 在“发布成功”通知中,显示关闭按钮

---------

Co-authored-by: zhenyiwang <zhenyiwang@intl.zju.edu.cn>
2024-10-17 18:12:40 +08:00
papapatrick
5efa70f3a1 feat: add cookies tip drawer (#2935) 2024-10-16 15:18:55 +08:00
heheer
d45d18cc3b fix: variable label i18n & create question guide language (#2933) 2024-10-16 14:21:53 +08:00
heheer
8bdb35ff51 fix: quote settings default value & zindex & i18n (#2931) 2024-10-16 13:26:51 +08:00
居里栈栈
e56965a8ed feat: add AI Icon Svg Logo (#2930)
Co-authored-by: 勤劳上班的卑微小张 <jiazhan.zhang@ggimage.com>
2024-10-16 12:19:53 +08:00
Archer
d4e0a43771 4.8.12 dev (#2928)
* perf: optimize global variables (#2863)

* feat: add global variable types

* add global variables to debug

* fix select dnd

* unify InputTypeConfig params

* feat: http node url support variables (#2891)

* feat: http node url support variables

* change to prompt editor

* fix: global variables (#2892)

* fix global variables

* fix type

* perf: global variables

* perf: workflow delete node error (#2905)

* update lock

* update 4812 doc

* feat: add node course url config (#2897)

* feat: add node course url config

* change plugin course url

* change default doc url

* change url store

* delete unused code

* fix: global variable (#2915)

* fix: global variable

* add comment

* fix: interactive check

* locj

* perf: debug switch to global tab when click run & global var default reset (#2925)

* fix: tool course url

* fix: global var default value & wrap variable form (#2926)

* fix: add dataset tags not update render (#2927)

* feat: tool will save histories

* perf: global variables code

* perf: FE_DOMAIN config

---------

Co-authored-by: heheer <heheer@sealos.io>
2024-10-15 20:23:18 +08:00
heheer
00638d6ee7 fix: add dataset tags not update render (#2927) 2024-10-15 17:44:50 +08:00
Archer
da281ea9ec perf: variable replace rang (#2923) 2024-10-15 16:42:42 +08:00
Archer
4f1ce640a7 Tool call support interactive node (#2903)
* feat: tool call support interactive node

* feat: interactive node tool response

* fix: tool call concat

* fix: llm history concat
2024-10-14 21:55:18 +08:00
Zhenyi-Wang
2a2b919daf feat: remove style tag when fetching url (#2913)
Co-authored-by: zhenyiwang <zhenyiwang@intl.zju.edu.cn>
2024-10-14 14:37:29 +08:00
Archer
3f01cc9c63 Doc (#2916)
* perf: community code

* update doc
2024-10-14 14:36:28 +08:00
Archer
bc70428d89 update feishu-img (#2914) 2024-10-14 12:31:07 +08:00
Archer
d55ccc9f64 Doc (#2910)
* feat: add app chat openapi (#2908)

* add chat openapi

* create question guide openapi

* change auth method

* add chat openapi doc

* delete unused code

* feat: chat openapi doc

* rerank doc

* add chat detail openapi & doc

* update chat openapi doc

---------

Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: heheer <1239331448@qq.com>
2024-10-14 10:26:57 +08:00
Nathanael
27ef4dc8ea Updated readme english (#2907) 2024-10-13 15:48:27 +08:00
papapatrick
daa5b552b1 plugins: add wiki search (#2886)
* plugins: add wiki search

* 扁平化代码

* fix: url error
2024-10-12 15:02:00 +08:00
Finley Ge
fe6c8897ce fix: resource permission indexes (#2890) 2024-10-12 09:59:59 +08:00
heheer
0dcda9822e change app template default author (#2893) 2024-10-12 09:59:16 +08:00
heheer
06e1c5d68d fix: not delete edges when deleting non-deletable nodes (#2887) 2024-10-11 12:09:33 +08:00
methol
d52da7d4e0 fix:fastgpt-sandbox image version (#2882) 2024-10-10 22:20:24 +08:00
Archer
a42707064a Update 469.md (#2880) 2024-10-10 19:51:23 +08:00
Archer
02bcab8802 fix: workflow delete error (#2879)
* fix: workflow delete key error

* fix: chat auth error
2024-10-10 19:31:51 +08:00
Archer
27291faa66 fix: dataset data list api adapt (#2878)
* fix: dataset data list api adapt

* update doc version

* perf: fedomain env

* add fedomain env
2024-10-10 18:10:19 +08:00
Archer
3878a50d0f fix: file extension check (#2876) 2024-10-10 17:35:56 +08:00
Archer
15b8353c7d Update README.md (#2875)
* Update README.md

* Update README.md
2024-10-10 16:56:59 +08:00
Archer
b950146031 update o1 config (#2874)
* update o1 config

* update yml
2024-10-10 16:52:32 +08:00
Archer
887e1d53d6 fix: o1 model cannot run in simpleApp (#2873) 2024-10-10 16:46:32 +08:00
Archer
1dcd39bfbe action (#2872) 2024-10-10 15:46:15 +08:00
Archer
01dad96618 4.8.11 test (#2871)
* fix: variables check

* remove log

* update version doc
2024-10-10 14:54:09 +08:00
Archer
13401294ad IOS safari whisper support (#2870)
* fix: variables check

* remove log

* perf: safari whisper

* feat: comment

* perf: connetion check

* doc
2024-10-10 12:24:07 +08:00
heheer
8273c96bbc fix: form-data not display in http node log (#2868)
* fix: fix form-data not display in http node log

* fix
2024-10-10 11:47:45 +08:00
Archer
61c6b1e471 Perf: delete app tip; fix: can't stop debug. (#2865)
* fix: variables check

* remove log

* perf: delete app tip

* perf: remove node code

* fix: can not stop debug

* update version

* update version intro

* fix: per error

* perf: apikey manager

* Add permission check

* update README
2024-10-10 11:30:36 +08:00
heheer
f06aca9874 fix: customize flow remove change (#2858)
* fix: customize flow remove change

* fix when mouse not in canvas
2024-10-09 22:02:17 +08:00
Archer
3a4b4a866b Team group (#2864)
* feat(member-group): Team (#2616)

* feat: member-group schema define

* feat(fe): create group

* feat: add group edit modal

* feat(fe): add avatar group component

* feat: edit group
fix: permission select menu style

* feat: bio-mode support for select-member component

* fix: avatar group key unique

* feat: group manage

* feat: divide member into group and clbs

* feat: finish team permission

* chore: adjust

* fix: get clbs

* perf: groups code

* pref: member group for team (#2706)

* chore: fe adjust
fix: remove the member from groups when removing from team
feat: change the groups avatar when updating the team's avatar

* chore: DefaultGroupName as a constant string ''

* fix: create default group when create team for root

* feat: comment

* feat: 4811 init

* pref: member group for team (#2732)

* chore: default group name

* feat: get default group when get by tmbid

* feat(fe): adjust

* member ui

* fix: delete group (#2736)

* perf: init4811

* pref: member group (#2818)

* fix: update clb per then refetch clb list

* fix: calculate group permission

* feat(fe): group tag

* refactor(fe): team and group manage

* feat: manage group member

* feat: add group transfer owner modal

* feat: group manage member

* chore: adjust the file structure

* pref: member group

* chore: adjust fe style

* fix: ts error

* chore: fe adjust

* chore: fe adjust

* chore: adjust

* chore: adjust the code

* perf: i18n and schema name

* pref: member-group (#2862)

* feat: group list ordered by updateTime

* fix: transfer ownership of group when deleting member

* fix: i18n fix

* feat: can not set member as admin/owner when user is not active

* fix: GroupInfoModal hover input do not change color

* fix(fe): searchinput do not scroll

* perf: team group ui

* doc

* remove enum

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
2024-10-09 18:32:10 +08:00
Finley Ge
7afa8f00b8 pref: trim the input of outlink (#2860) 2024-10-09 14:05:23 +08:00
Archer
f6c5695df4 Optimize base64 storage in files to support concurrent storage (#2856)
* fix: variables check

* remove log

* perf: file img saved

* update doc
2024-10-08 12:58:33 +08:00
papapatrick
dd3a1b910b docs: add FAQ (#2833) 2024-10-08 12:36:23 +08:00
Archer
a66d9d2e98 4.8.11 test (#2850)
* fix: variables check

* remove log

* fix: variables refresh

* perf: team select button

* perf: remove change fn
2024-10-04 10:25:20 +08:00
Archer
fc6f28f26e fix: variables check (#2849)
* fix: variables check

* remove log
2024-10-01 11:11:19 +08:00
Archer
d4b99ddcab fix: login ip check (#2848) 2024-09-30 18:24:03 +08:00
Archer
df328b2a73 fix: comment node cannot save (#2847) 2024-09-30 18:16:20 +08:00
Archer
fadb389294 fix: loop node cannot save parentId (#2845) 2024-09-30 17:58:17 +08:00
Archer
7c38d1da9a 4.8.11 test (#2843)
* feat: app version test

* update doc

* fix: paging num error

* fix: doc api domain

* rename variable

* perf: memment node min size
2024-09-30 17:28:03 +08:00
heheer
7c829febec feat: add context menu & comment node (#2834)
* feat: add comment node

* useMemo
2024-09-29 10:08:19 +08:00
heheer
7bdff9ce9c perf: change tool params type label & enum input conditional rendering (#2835) 2024-09-28 18:00:22 +08:00
heheer
1599d144ce feat: add tool params node & tool params add array type (#2824)
* add tool params node

* add tool params enum

* node response

* tool add array type params

* fix tool params

* fix

* fix

* fix
2024-09-28 15:58:55 +08:00
Archer
f2749cbb00 4.8.11 perf (#2832)
* save toast

* perf: surya ocr

* perf: remove same model name

* fix: indexes

* perf: ip check

* feat: Fixed the version number of the subapplication

* feat: simple app get latest child version

* perf: update child dispatch variables

* feat: variables update doc
2024-09-28 15:31:25 +08:00
heheer
f7a8203454 fix:variable not update in nested workflow runs (#2830) 2024-09-28 13:59:35 +08:00
Archer
d95f71e9e3 Update dataset_engine.md (#2829) 2024-09-28 10:08:54 +08:00
Deepturn
a43d845298 Update configuration.md (#2828)
修改 claude
2024-09-28 09:57:16 +08:00
papapatrick
3e64f46d92 fix: change ip detect url (#2827) 2024-09-27 22:19:48 +08:00
yiming-alicloud
0335f16742 submit ocr module (#2815) 2024-09-27 16:07:28 +08:00
Archer
98dbec2cf7 4.8.11 fix (#2822)
* fix: tool choice hostiry error

* fix: chat page auth error redirect

* perf: ip redirect tip

* feat: fedomain env

* fix: tool desc empty

* feat: 4811 doc
2024-09-27 15:52:33 +08:00
silencezhang7
d259eda6b4 新增BI圖標功能-柱狀圖 (#2779)
* 新增BI圖標功能-柱狀圖

* 新增BI图表功能-柱狀圖,优化代码,删除无用代码

* 优化生成逻辑,支持插件手动选择图表类型:目前支持柱状图,折线图,饼图

* 修改包名称,完成基础图表
2024-09-27 13:50:42 +08:00
heheer
7c8f2ab6f5 perf: support prompt editor dynamic height increase & modify aichat placeholder (#2817) 2024-09-27 13:45:44 +08:00
papapatrick
691476c821 feat: add login page ip detect (#2819)
* feat: add login page ip detect

* code perf
2024-09-27 13:39:10 +08:00
Archer
efcb53cd6d Rename node(#2814) 2024-09-26 18:25:42 +08:00
Archer
21ab855871 perf: stream response (#2813)
* perf: stream response

* fold code
2024-09-26 18:09:01 +08:00
heheer
aee5de29c7 fix: tool node fold (#2811)
* fix: tool node fold

* delete console
2024-09-26 18:04:43 +08:00
heheer
78d15c2a2f fix: form input value type & default form & ui (#2802)
* fix: form input value type & default form & ui

* variables form ui
2024-09-26 16:33:38 +08:00
Archer
54e0a0eab1 4.8.11 code perf (#2804)
* perf: support child layout

* perf: user form ui

* perf: plugin tool output code

* perf: code

* perf: node fold hook
2024-09-26 16:27:28 +08:00
papapatrick
e6bad93b32 fix: mobile history slider records disappear (#2806)
* fix: mobile history slider records disappear

* change h
2024-09-26 16:26:00 +08:00
heheer
12d7ba5d73 feat: support workflow node fold (#2797)
* feat: support workflow node fold

* fix

* fix
2024-09-26 15:44:04 +08:00
Zhenyi-Wang
5ad8c81ef3 fix: 网页抓取:正确处理//开头的超链接 (#2803)
Co-authored-by: zhenyiwang <zhenyiwang@intl.zju.edu.cn>
2024-09-26 14:53:24 +08:00
papapatrick
cb6fe9d0da feat: support select field as tool output (#2798)
* feat: support select field as tool output

* defaultOutput
2024-09-26 14:37:06 +08:00
heheer
1cf76ee7df feat: add form input node (#2773)
* add node

* dispatch

* extract InputTypeConfig component

* question tip

* fix build

* fix

* fix
2024-09-26 13:48:03 +08:00
Archer
edebfdf5ef fix: ts (#2799) 2024-09-26 13:20:05 +08:00
Archer
86436d55ff 4.8.11 test (#2794)
* perf: version list type

* perf: add node default value

* perf: snapshot status

* fix: version detail auth

* fix: export defalt
2024-09-26 11:02:09 +08:00
Archer
e31d6ec2c1 remove invalid code (#2785) 2024-09-25 09:49:51 +08:00
heheer
6bb10ca150 perf: optimize simple app history (#2782)
* simple app history

* ui

* extract context content into hooks
2024-09-24 21:09:59 +08:00
Archer
7aa75f8ee0 fix: chat page render performance (#2784)
* fix: chat page render performance

* fix: ts
2024-09-24 18:05:27 +08:00
Archer
afd2c394d8 Perf ui detail (#2775)
* perf: tool response tip

* perf: image extract

* perf: user question tool desc

* fix: simple mode load app module

* perf: simple mode plugin version

* perf: share page reload

* refresh simple mode data
2024-09-24 18:04:11 +08:00
Archer
434c03c955 Record scroll test (#2783)
* perf: history add scrollList (#2696)

* perf: chatHistorySlider add virtualList

* perf: chat records add scrollList

* delete console

* perf: ScrollData add ref props

* 优化代码

* optimize code && add line breaks

* add total records display

* finish test

* perf: ScrollComponent load data

* perf: Scroll components load

* perf: scroll code

---------

Co-authored-by: papapatrick <109422393+Patrickill@users.noreply.github.com>
2024-09-24 17:13:32 +08:00
Archer
f4d4d6516c Support simpleApp select workflow (#2772)
* fix: share page id error

* feat: simple workflow support childApp tool

* perf: aichat box animation
2024-09-23 15:43:57 +08:00
zqhong
b6833ca3ea updated: docs/docker.md,修改 config.json 的地址 (#2771)
原先 config.json 的地址是:
https://github.com/labring/FastGPT/blob/main/projects/app/data/config.json

如果没有考虑太多,直接 wget "https://github.com/labring/FastGPT/blob/main/projects/app/data/config.json",则会下载到网页版的 `config.json`。这不是一个 json 文件,而是 github 的网页。

所以,修改为 `https://raw.githubusercontent.com/labring/FastGPT/refs/heads/main/projects/app/data/config.json` 更加合理
2024-09-23 15:24:55 +08:00
Archer
3ab934771f 4.8.11 perf (#2768)
* perf: watch local

* perf: dataset list ui

* perf: Check workflow invalid edges in saved

* remove log

* perf: Forbid touch scale

* perf: rename dataset process

* feat: support child app unstream mode

* feat: Dispatch child app will record detail

* feat: Save childApp run log

* fix: share page init error

* perf: chatId reset
2024-09-23 10:17:49 +08:00
Archer
4245ea4998 Update README.md (#2769) 2024-09-22 14:40:09 +08:00
Archer
9eb02b7e38 feat: plan index;flat i18n and add variable value type (#2762)
* feat: plan index

* flat i18n and add variable value type

* fix: ts

* perf: free plan tip
2024-09-20 17:36:33 +08:00
Archer
75af549c7f Plugin support select file (#2756)
* feat: plugin support upload files (#2716)

* feat: plugin support file upload

* file history

* fix history & chattest

* chore: code

* plugin config icon & file preview padding

* perf: undefined fn

* fix: plugin file numbers & plugin template add config (#2743)

* perf: run plugin without human message (#2749)

* perf: run plugin without human message

* fix build

* fix build

* rename node

* perf: ui

* perf: plugin rerun with last params & plugin log add file (#2755)

* perf: plugin run with last params & plugin log add file

* delete console

* perf: plugin refresh code

* fix: ts

---------

Co-authored-by: heheer <heheer@sealos.io>
2024-09-20 14:12:58 +08:00
Archer
5e7c97b7b8 4.8.11 test fix (#2746)
* fix: refresh tool param

* perf: load image message

* fix: cannot remoce externalReadUrl

* perf: variables update dom

* perf: empty response tip

* fix: conflict
2024-09-20 11:28:58 +08:00
Finley Ge
6c2a7574c3 perf: app list (#2747) 2024-09-20 10:16:27 +08:00
Finley Ge
ca9f36ef9f chore: Jest Testing structure (#2707)
* deps: add jest deps

* chore: mock

* feat: use mocinggoose

* feat: jest

* chore: remove babel.config.js
2024-09-19 13:34:03 +08:00
Archer
265434799f Add externalfile api params (#2745)
* feat: external dataset api

* perf: doc
2024-09-19 13:28:55 +08:00
Archer
258de4471e Update 4810.md (#2744) 2024-09-19 11:34:33 +08:00
Archer
d83bb9d2c7 remove code (#2735) 2024-09-18 13:47:42 +08:00
Archer
093bfa2134 feat: dataset quote role support system; fix: adapt o1 model (#2733)
* feat: dataset quote support system role

* perf: adapt dataset quote role

* fix: adapt o1 model
2024-09-18 13:38:50 +08:00
Archer
539bc77934 fix: aichat response (#2728) 2024-09-17 23:07:30 +08:00
Archer
aabbe06e41 Update intro.md (#2726) 2024-09-16 16:18:05 +08:00
Archer
bb22fa6548 Update 4810.md (#2725) 2024-09-16 16:15:13 +08:00
Archer
bd2509bd41 Update doc and domain (#2722)
* feat: doc

* replace domain

* README
2024-09-16 01:39:50 +08:00
Archer
561516eeef feat: doc (#2721) 2024-09-15 23:02:52 +08:00
Archer
2bdda4638d Feat: Workflow loop node;feat: support openai o1;perf: query extension prompt;fix: intro was not delivered when the datase was created (#2719)
* feat: loop node (#2675)

* loop node frontend

* loop-node

* fix-code

* fix version

* fix

* fix

* fix

* perf: loop array code

* perf: get histories error tip

* feat: support openai o1

* perf: query extension prompt

* feat: 4811 doc

* remove log

* fix: loop node zindex & variable picker type (#2710)

* perf: performance

* perf: workflow performance

* remove uninvalid code

* perf:code

* fix: invoice table refresh

* perf: loop node data type

* fix: loop node store assistants

* perf: target connection

* feat: loop node support help line

* perf: add default icon

---------

Co-authored-by: heheer <heheer@sealos.io>
2024-09-15 22:41:05 +08:00
Finley Ge
1ebc95a282 feat: specify the api's auth type (#2715) 2024-09-15 13:06:51 +08:00
Archer
d0e8f7203c perf: plugin support files (#2708) 2024-09-14 15:11:44 +08:00
Archer
092bb9ab17 feat: sandbox support str to base64 function;feat: compiance text ui (#2702)
* feat: sandbox strToBase64 function

* feat: compiance text ui
2024-09-13 17:54:22 +08:00
Patrickill
9de8849193 优化代码 2024-09-13 17:25:45 +08:00
Patrickill
3d5da27079 add ComplianceTip for dataset&chat 2024-09-13 17:25:45 +08:00
Archer
c454fe07cb Update 4810.md 2024-09-13 15:28:56 +08:00
Patrickill
3e144c4227 remove the trailing #xx when copy 2024-09-13 13:18:08 +08:00
Archer
d8b2887625 feat: comment (#2697) 2024-09-13 11:37:32 +08:00
勤劳上班的卑微小张
ba3b3280b4 Fixed an issue where chunk splitter were lost when clicking on the link sync 2024-09-13 11:08:00 +08:00
Archer
390b8f5b86 Update index.tsx 2024-09-12 18:23:59 +08:00
Finley Ge
d74e6a47d6 fix: chat log get member info 2024-09-12 18:23:59 +08:00
shilin66
424c745cbb fix: Stream模式下使用toolChoice,toolCall的function和type可能为null 2024-09-12 18:12:17 +08:00
archer
0abbcf1401 fix: ts 2024-09-12 18:11:34 +08:00
Archer
da1126ed3c fix: share init error (#2690) 2024-09-12 18:04:31 +08:00
Archer
56281d92f2 Perf: worfklow scroll cannot wheel. Adapt wrokflow skip circle. Change tab alway output stream (#2688)
* perf: teaxtarea no wheel

* remove render error

* adapt workflow skip circle

* perf: change tab can stream output
2024-09-12 17:22:52 +08:00
Archer
fde1618af2 Workflow experience optimization (#2681)
* perf: workflow handle connect

* feat: pan drag mode

* perf: workflow keyboard and touchTable adapt

* perf: teaxtarea no wheel

* remove render error
2024-09-12 17:10:39 +08:00
Archer
22bb4c1e2e Update official_account.md (#2677) 2024-09-12 17:10:39 +08:00
Archer
6331f4b845 perf scroll components (#2676)
* perf: add scroll list && virtualist (#2665)

* perf: chatHistorySlider add virtualList

* perf: dataCard add scroll

* fix: ts

* perf: scroll list components

* perf: hook refresh

---------

Co-authored-by: papapatrick <109422393+Patrickill@users.noreply.github.com>
2024-09-11 19:53:49 +08:00
湛露先生
5101c7a6dc Fix typo location of python bge-rerank (#2674)
Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
2024-09-11 19:46:12 +08:00
Archer
02bf400bf3 Add workflow rename; Fix: userselect chatId unrefresh (#2672)
* feat: workflow node support rename

* perf: push data to training queue

* fix: userselect chatId unrefresh
2024-09-11 15:27:47 +08:00
Archer
11cbcca2d4 Update 4810.md (#2668) 2024-09-11 10:09:56 +08:00
Finley Ge
34422f9549 fix: sso (#2661) 2024-09-10 18:24:29 +08:00
Archer
aeba79267a Workflow deep and workflow connection performance (#2664)
* feat: Workflow dispatch deep

* perf: workflow connection
2024-09-10 16:57:59 +08:00
Archer
7473be5922 pay pre wrap (#2659) 2024-09-10 14:04:57 +08:00
Finley Ge
de59b3d2e5 fix: app select dataset (#2660) 2024-09-10 13:50:23 +08:00
Archer
08190c2f0d fix: toolNode max tokens and toolDescription i18n (#2655)
* fix: toolNode max tokens

* fix: toolNode max tokens

* fix: workflow  tool desc i18n
2024-09-09 22:26:20 +08:00
heheer
6a85c8c2b6 fix: cq template missing chatconfig (#2654) 2024-09-09 19:37:15 +08:00
Archer
bbdab1d40e fix: entry (#2652) 2024-09-09 16:21:22 +08:00
Finley Ge
78ad2791cd chore: openapi doc generator (#2644)
* chore: extract the type and comment from apis

* chore: template code

* feat: openapi

* pref: openapi generator. send into public/openapi folder
2024-09-09 15:43:09 +08:00
Archer
5f3c8e9046 Fix: workflow init status (#2649)
* i18n

* fix: entry
2024-09-09 15:37:20 +08:00
papapatrick
30057f01a6 fix: workflow i18n (#2645)
* fix: workflow i18n

* i18n completion
2024-09-09 14:36:35 +08:00
Archer
3ea185315d fix: workflow clear repeat check run (#2646) 2024-09-09 14:14:32 +08:00
Finley Ge
a1ae08f62b perf: logs, auth root as super admin, etc (#2615)
* chore: usePagination hook type

* feat: chat log show outlinkuid or tmb avatar and name

* fix: ts error for pagination

* feat: auth root
2024-09-09 10:05:18 +08:00
Archer
91ec895fd2 fix: oauth (#2640)
* fix: oauth

* remove log

* fix: oauth dispatch
2024-09-08 20:56:33 +08:00
xianlezheng
1a33642635 Fixs:当最后一条数据因大模型没返回数据时导致调试时前端报错。 (#2637)
在lastMessageValue取值时需要提前判断空值。

Co-authored-by: zhengxianle <nopanic@ilikejobs.com>
2024-09-08 15:26:05 +08:00
archer
e9681c8ed5 log 2024-09-08 15:03:29 +08:00
imgbot[bot]
69ff65973f [ImgBot] Optimize images (#2639)
*Total -- 6,985.44kb -> 4,501.25kb (35.56%)

/python/sensevoice/app/iic/SenseVoiceSmall/fig/inference.png -- 935.23kb -> 292.81kb (68.69%)
/python/sensevoice/app/iic/SenseVoiceSmall/fig/asr_results.png -- 238.19kb -> 76.62kb (67.83%)
/python/sensevoice/app/iic/SenseVoiceSmall/fig/sensevoice.png -- 879.78kb -> 332.45kb (62.21%)
/python/sensevoice/app/iic/SenseVoiceSmall/fig/ser_table.png -- 318.12kb -> 145.67kb (54.21%)
/docSite/assets/imgs/wechat6.png -- 208.98kb -> 119.19kb (42.97%)
/docSite/assets/imgs/collection-tags-2.png -- 83.02kb -> 52.57kb (36.67%)
/.github/imgs/intro3.png -- 258.74kb -> 167.94kb (35.09%)
/python/sensevoice/app/iic/speech_fsmn_vad_zh-cn-16k-common-pytorch/fig/struct.png -- 27.26kb -> 17.81kb (34.66%)
/.github/imgs/intro1.png -- 259.12kb -> 173.33kb (33.11%)
/docSite/assets/imgs/fileinpu-2.png -- 214.61kb -> 147.20kb (31.41%)
/.github/imgs/intro4.png -- 227.64kb -> 158.71kb (30.28%)
/docSite/assets/imgs/questionGuide.png -- 38.89kb -> 27.95kb (28.13%)
/python/sensevoice/app/iic/SenseVoiceSmall/fig/aed_figure.png -- 115.93kb -> 85.46kb (26.28%)
/.github/imgs/intro2.png -- 370.64kb -> 273.45kb (26.22%)
/docSite/assets/imgs/offiaccount-9.png -- 38.62kb -> 28.89kb (25.18%)
/docSite/assets/imgs/collection-tags-3.png -- 125.71kb -> 98.27kb (21.83%)
/docSite/assets/imgs/offiaccount-3.png -- 90.57kb -> 71.85kb (20.66%)
/docSite/assets/imgs/feishu-bot-4.png -- 85.73kb -> 68.44kb (20.17%)
/docSite/assets/imgs/feishu-bot-2.png -- 92.49kb -> 73.94kb (20.05%)
/docSite/assets/imgs/offiaccount-1.png -- 99.70kb -> 79.77kb (19.98%)
/docSite/assets/imgs/feishu-bot-1.png -- 154.50kb -> 126.89kb (17.87%)
/docSite/assets/imgs/feishu-bot-6.png -- 160.72kb -> 133.59kb (16.88%)
/docSite/assets/imgs/fileinpu-6.jpg -- 179.04kb -> 150.60kb (15.88%)
/docSite/assets/imgs/feishu-bot-8.png -- 43.64kb -> 36.83kb (15.61%)
/docSite/assets/imgs/offiaccount-7.png -- 73.88kb -> 62.58kb (15.29%)
/python/sensevoice/app/iic/SenseVoiceSmall/fig/ser_figure.png -- 194.25kb -> 167.12kb (13.97%)
/docSite/assets/imgs/feishu-bot-5.png -- 169.50kb -> 146.65kb (13.48%)
/docSite/assets/imgs/offiaccount-8.png -- 129.99kb -> 114.37kb (12.02%)
/docSite/assets/imgs/offiaccount-6.png -- 131.04kb -> 115.30kb (12.01%)
/docSite/assets/imgs/feishu-bot-3.png -- 165.20kb -> 145.86kb (11.71%)
/docSite/assets/imgs/offiaccount-4.png -- 158.75kb -> 140.69kb (11.38%)
/docSite/assets/imgs/feishu-bot-7.png -- 95.10kb -> 84.29kb (11.37%)
/docSite/assets/imgs/offiaccount-5.png -- 158.34kb -> 140.59kb (11.21%)
/docSite/assets/imgs/offiaccount-2.png -- 163.30kb -> 145.59kb (10.84%)
/docSite/assets/imgs/gpt-translate-example.png -- 299.24kb -> 297.98kb (0.42%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2024-09-08 10:23:27 +08:00
Archer
52ac445557 fix: mobild sso login (#2636)
* fix: mobild sso login

* feat: max call tool times
2024-09-07 18:24:38 +08:00
Archer
d45cb2f84a Update 4810.md (#2634) 2024-09-06 17:29:23 +08:00
Archer
1cb71c6bfb 4.8.10 perf (#2633)
* perf: i18n init

* i18n

* 4.8.10 doc

* doc
2024-09-06 17:22:24 +08:00
papapatrick
fb59b60761 addition i18n (#2631) 2024-09-06 16:57:47 +08:00
Archer
9334a0dcf6 4.8.10 perf (#2630)
* perf: i18n init

* i18n

* fix: user select end status

* fix: interactive workflow

* fix: restart chat

* fix: oauth login
2024-09-06 15:45:02 +08:00
Archer
c614f8b9ca Perf: i18n change and captcha code. (#2625)
* perf: send captcha check

* perf: back router

* perf: i18n init

* perf: ui

* i18n

* perf: ui duration
2024-09-05 23:01:12 +08:00
heheer
478386c612 chore: template author name & icon border radius (#2624) 2024-09-05 20:44:31 +08:00
papapatrick
dfcffc7fc1 I18n: Completed i18n&&proofread some translations (#2619)
* i18n-1

* i18n: Completed the remaining parts of i18n and proofread some translations

* i18n: add default lang&&add app template i18n
2024-09-05 17:29:36 +08:00
Finley Ge
b4238257b6 feat: dynamic website crawler (#2609)
* feat: cheerio returns cherrio.load for pro version website sync

* chore: rename
2024-09-05 14:49:57 +08:00
Archer
38f47956cd fix: ts (#2621) 2024-09-05 14:04:45 +08:00
Archer
7fed4d697f perf: captcha code (#2620)
* perf:  captcha code

* perf: dockerfile
2024-09-05 13:41:11 +08:00
EthanD4869
5ed89130ef add sensevoice & cosevoice (#2562)
Signed-off-by: EthanD <EthanD4869@gmail.com>
Co-authored-by: EthanD <EthanD4869@gmail.com>
2024-09-05 13:36:11 +08:00
Archer
3671e55001 4.8.10 test (#2618)
* perf: menu arrow ui

* perf: http node placeholder

* perf: http node form input

* perf: chatBox performance
2024-09-05 11:49:13 +08:00
papapatrick
3bcc3430fb feat: add captcha (#2613)
* feat: captcha

* add borderRadius

* code perf
2024-09-05 11:46:51 +08:00
heheer
d6233cd7b1 fix: add http params focus & ui (#2611) 2024-09-04 13:37:29 +08:00
Archer
64708ea424 Update userselect ux (#2610)
* perf: user select ux and api

* perf: http variables replace code

* perf: http variables replace code

* perf: chat box question guide adapt interactive

* remove comment
2024-09-04 11:11:08 +08:00
heheer
85a11d08b2 feat: http body type & http input support editor variable (#2603)
* feat: http body type & http input support editor variable

* fix type

* chore: code

* code
2024-09-03 23:43:21 +08:00
papapatrick
a7569037fe perf: modal add size props&menu add menuItemStyles (#2600)
* perf: modal add size props&menu add menuItemStyles

* delete minH

* mobile adaptation

* 优化部分代码
2024-09-03 14:56:09 +08:00
Archer
4726034344 Update official_account.md (#2604) 2024-09-03 14:41:46 +08:00
Archer
9a57e94b79 4.8.10 test (#2601)
* perf: workflow children run params

* feat: workflow userId

* fix: ui size

* perf: Markdown whitespace and ai images split

* fix: openai sdk ts
2024-09-03 13:43:56 +08:00
Archer
761e35c226 4.8.10 workflow perf (#2596)
* perf: run plugin variables init

* perf: init free plan

* perf: dataset data ui

* perf: workflow theme

* perf: plugin input modal ui

* perf: workflow dispatch

* fix: account ui

* feat: 4810 doc
2024-09-03 09:56:33 +08:00
papapatrick
5ebe0017a0 perf: user default avatar (#2594)
* perf: user default avatar

* refactor: 修改文件路径
2024-09-02 21:04:49 +08:00
papapatrick
036097243a perf: workflow&plugins json config import and export (#2592) 2024-09-02 15:05:58 +08:00
heheer
84de95d294 fix: plugin input type options & save button (#2590) 2024-09-02 13:06:48 +08:00
papapatrick
fdab383b26 Style-dataset-2.5 (#2580)
* style: dataset detail page 2.5

* fix merge error

* fix: flash bug

* fix: build error

* revert: 滚动变回分页
2024-09-02 10:00:55 +08:00
Archer
060492dbf7 feat: admin add custom plugin (#2582)
* feat: admin add custom plugin

* refresh plugins

* plugin input box ui

* fix: run plugin varialbes error

* perf: comment

* fix: ts
2024-08-30 22:45:35 +08:00
heheer
9d5fd24085 feat: plugin input type add select and custom var (#2571)
* feat: plugin input type add select and custom var

* fix

* fix ui

* fix

* fix
2024-08-30 18:03:04 +08:00
heheer
903f39fe17 feat: add plugin instruction config (#2579)
* feat: add plugin instruction config

* fix build
2024-08-30 17:12:57 +08:00
Archer
2ef98c24be 4.8.10 test (#2578)
* fix: auth error

* perf: refresh members

* fix: variable run

* fix: runtime check

* fix: dataset info show
2024-08-30 10:27:07 +08:00
Archer
6d00f73e91 4.8.10 test (#2573)
* feat: more debug response

* fix: debug edge status

* perf: doc

* fix: workflow edge check

* perf: i18n

* package.json

* perf: markdown mask
2024-08-29 23:19:39 +08:00
Archer
813eaacfd0 4.8.10 fix (#2572)
* fix: circle workflow response modal

* perf: workflow runtime check
2024-08-29 18:00:56 +08:00
Archer
322ca757af 4.8.10 test (#2568)
* perf: i18n perf

* fix: detail=fasle response

* fix: dataset tag load repeat

* feat :doc

* perf: rename fun

* code comment
2024-08-29 14:51:34 +08:00
heheer
a177a302d4 fix: plugin input (#2567) 2024-08-29 14:19:16 +08:00
heheer
034108c218 fix: global variable during debug & variable update textarea rerender (#2553)
* fix: global variable during debug & variable update textarea rerender

* update var node use prompt editor

* fix
2024-08-29 14:09:20 +08:00
heheer
0632dfed80 fix: tags manage (#2556)
* fix: tags manage

* fix infinite invoke
2024-08-29 12:04:45 +08:00
居里栈栈
6c16fa9166 Fix: Custom delimiter does not take effect when document type is link (#2565)
Co-authored-by: 勤劳上班的卑微小张 <jiazhan.zhang@ggimage.com>
2024-08-29 11:16:17 +08:00
papapatrick
ac4854a47b template add i18n (#2558)
* template add i18n

* add English translation
2024-08-28 21:33:03 +08:00
Archer
b9a6b71fe9 perf: Dataset new ui (#2555)
* perf: dataset detail ui

* fix: collection tag modal

* perf: data card support markdown

* fix :ts
2024-08-28 12:48:55 +08:00
papapatrick
aba50e958e style: 知识库二期 (#2554) 2024-08-28 12:17:45 +08:00
Archer
52cbfeace3 feat: custom read file service (#2548) 2024-08-28 11:35:06 +08:00
papapatrick
bebf565c06 style: dataset detail page style refactor (#2501)
* style: dataset detail page style refactor

* remove px

* remove py px px

* change shadow

* style: 2期联调结束

* 优化部分代码
2024-08-28 10:17:49 +08:00
Archer
c9bb39d802 4.8.10 test (#2539)
* fix: i18n

* fix: null value

* fix: workflow refresh variables

* perf: copy data

* doc

* perf: run app code

* perf: variable store

* update doc

* perf: pay ui

* fix: log header ui

* fix: log header ui
2024-08-27 19:48:42 +08:00
papapatrick
454a479fd8 style: pay page perf (#2535)
* style: pay page perf

* perf: package status logic && add pay text
2024-08-27 18:56:08 +08:00
heheer
d057ad3a45 fix: global variable persist during api calls (#2544) 2024-08-27 18:23:15 +08:00
heheer
a206d77287 fix: run app node display (#2546) 2024-08-27 18:16:35 +08:00
不吃辣不喝酒
14bd1b5404 fix: toolCall.function.arguments maybe undefined (#2545)
当arg===undefined时,会导致 currentTool.function.arguments += arg; 字符串拼接出问题。
2024-08-27 17:41:59 +08:00
Archer
450167c951 App run node update (#2542)
* feat(workflow): allow apps to be invoked like plugins (#2521)

* feat(workflow): allow apps to be invoked like plugins

* fix type

* Encapsulate SSE response methods (#2530)

* perf: sse response fn

* perf: sse response

* fix: ts

* perf: not ssl copy

* perf: myselect auto scroll

* perf: run app code

* fix: app plugin (#2538)

---------

Co-authored-by: heheer <heheer@sealos.io>
2024-08-27 16:43:19 +08:00
heheer
67445b40bc fix: global variable key repeat & value type (#2540) 2024-08-27 16:04:00 +08:00
heheer
d3731d221a fix: change workflow start node output when change file config (#2527) 2024-08-27 13:47:26 +08:00
Archer
f6e2d13e21 fix: load member list (#2536)
* fix: load member list

* fix: extract field type error

* fix: workflow runtime error

* fix: ts
2024-08-27 12:07:57 +08:00
Carson Yang
77e6cf4157 Docs: update baseURL (#2533)
Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
2024-08-27 09:47:20 +08:00
heheer
fd3f32d083 fix welcome text rerender & add copyright (#2525) 2024-08-26 16:03:15 +08:00
Archer
f7544ea47b 4.8.10 test fix (#2517)
* fix: chat config load error

* prompt perf
2024-08-26 14:26:45 +08:00
Finley Ge
a1a9a0b463 chore: add i18n query script (#2518) 2024-08-26 12:31:30 +08:00
Finley Ge
dbfe1fca31 fix: fix i18n (#2516) 2024-08-26 12:23:19 +08:00
Archer
94f3b7f2d6 conversion points (#2514) 2024-08-26 10:48:02 +08:00
Archer
22a0f6bcfa perf: plan tip (#2513) 2024-08-26 10:43:52 +08:00
Archer
c1d08c0ccc New pay (#2484) (#2510)
* New pay (#2484)

* remove sub status

* feat: new pay mode

* fix: ts

* limit
2024-08-26 09:52:09 +08:00
Archer
a4c19fbd0a 4810 doc (#2504)
* 4810 doc

* doc

* feishu doc

* 4811 文档
2024-08-26 01:00:11 +08:00
Archer
ace84f015e 4.8.10 test (#2499)
* 48190 init

* path
2024-08-25 01:06:18 +08:00
heheer
bb7adc96ed perf: disabled change version when change version name (#2497)
* perf: disabled change version when change version name

* fix

* fix

* toast condition
2024-08-25 00:49:33 +08:00
Archer
ad63210f45 perf: onpublish app (#2498) 2024-08-24 23:43:52 +08:00
Archer
fa106eb24c fix: dispatch workflow skip status (#2496) 2024-08-24 23:36:59 +08:00
heheer
3248e95d53 fix: undo & redo (#2493)
* fix: undo & redo

* fix

* fix
2024-08-24 23:15:28 +08:00
Archer
3e57c7f559 perf: workflow code (#2492)
* perf: workflow code

* perf: converpoints ui

* perf: account page ui
2024-08-23 17:56:38 +08:00
Finley Ge
eaaf6f5978 feat(fe): balance conversion button and modal (#2491)
* feat: add balance conversion api declaration

* feat(fe): add conversion modal

* fix: show button when standplan and the user has manage permission

* feat: hide balance when <= 0
2024-08-23 17:14:07 +08:00
heheer
6288dc9492 feat: undo-redo & edit snapshots (#2436)
* feat: undo-redo & edit snapshots

* fix merge

* add simple history back

* fix some undo

* change app latest version

* fix

* chatconfig

* fix snapshot

* fix

* fix

* fix

* fix compare

* fix initial

* fix merge:

* fix useEffect

* fix snapshot initial and saved state

* chore

* fix

* compare snapshot

* nodes edges useEffct

* fix chatconfig

* fix

* delete unused method

* fix

* fix

* fix

* default version name
2024-08-23 15:58:43 +08:00
Archer
de573e4303 4.8.10 test fix (#2488)
* perf: update vision default

* fix: update dataset default permission

* perf: no network request
2024-08-23 14:57:52 +08:00
Archer
b3acd570f7 4.8.10 test (#2470)
* i18n

* perf: invoice type

* fix: helper line change error

* perf: base64 image

* perf: app list ui

* perf: upload max size check

* perf: init system plugin

* perf: dataset list ui

* perf: http node ui

* perf: ui

* perf: invoice tip

* fix: ts

* perf: invoice table

* perf: null check
2024-08-22 13:43:19 +08:00
Archer
19904e648b Update official_account.md (#2472) 2024-08-22 13:38:52 +08:00
Archer
785ba03239 Update official_account.md (#2471) 2024-08-22 13:37:05 +08:00
papapatrick
366fe0eada perf: invoice page refresh after apply (#2469)
* perf: 发票申请弹窗成功后刷新

* refactor: 组件内拿invoiceTab
2024-08-22 12:24:33 +08:00
Archer
225554f22c Update README.md (#2468) 2024-08-22 10:12:40 +08:00
heheer
5627a4bfde feat: add http node timeout (#2465)
* fix $ in replacement string misinterpreted as regex special character

* add http timeout

* delete console log
2024-08-21 20:23:35 +08:00
papapatrick
113c57bcbe style: database refactor (#2460)
* fix: dataset folder modal

* style: dataset style refactor

* sideTag i18n pef
2024-08-21 18:15:05 +08:00
Finley Ge
649de7f028 pref: login/forgetpass texts (#2457)
* chore: fastgptfeconfig type

* pref: login, forget password, texts
2024-08-21 14:46:53 +08:00
Archer
26d800981c 4.8.10 test (#2433)
* perf: node template ui

* perf: select tool path load error

* pay i18n

* i18n

* perf: oneapi code

* perf: doc

* node templates

* perf: usage table role

* feat: count vector total by datasetId

* perf: user select tip and tempalte market ui

* i18n

* perf: sso config tip
2024-08-20 18:31:40 +08:00
papapatrick
40b1d22d9d style: 知识库新列表 (#2448)
* style: 知识库新列表

* i18n adjust

* fix:  i18n
2024-08-20 17:29:41 +08:00
Finley Ge
2d0e6bd085 feat: SSO (#2414)
* feat: sso button

* feat: sso

* feat: sso callback url should be a page

* feat: sso redirect page

* chore: sso fe adjusting
2024-08-20 17:09:29 +08:00
Finley Ge
226cae5ab9 perf: add docs entries in the publish page (#2449) 2024-08-20 17:08:45 +08:00
Finley Ge
238381256d feat: custom-censor-check (#2437)
* feat: custom-censor-check

* chore: adjust
2024-08-20 10:05:19 +08:00
Archer
5fab3734fa Invoice (#2435)
* feat: invoice (#2293)

* feat: default voice header

* add i18n

* refactor: 优化代码

* feat: 用户开票

* refactor: 代码优化&&样式联调 (#2384)

* Feat: invoice upload (#2424)

* refactor: 验收问题&&样式调整

* feat: 文件上传

* 小调整

* perf: invoice ui

---------

Co-authored-by: papapatrick <109422393+Patrickill@users.noreply.github.com>
2024-08-19 17:44:48 +08:00
papapatrick
884c2d9553 fix: i18n display (#2429) 2024-08-19 15:15:33 +08:00
Finley Ge
918d7fb257 docs(offiaccount): add offiaccount docs (#2427) 2024-08-19 12:17:15 +08:00
heheer
0719f7bd4a chore(ui): dataset-tags (#2415) 2024-08-16 18:32:20 +08:00
Finley Ge
9b74437417 fix(publish): generate correct chat history and usage (#2412) 2024-08-16 15:59:17 +08:00
heheer
bebbba399a perf: change value desc position & fix templates (#2413) 2024-08-16 15:58:21 +08:00
Archer
14e22687e3 4.8.10 test (#2411)
* update doc

* update doc

* update doc imgs
2024-08-16 13:27:44 +08:00
Archer
61347d9aaa 4.8.10 test (#2401)
* perf: i18n

* perf: i18n and img tip

* perf: readme

* perf: hide tool ai response

* fix: copy app

* fix: parse image url regx

* perf: folder collection forbid update
2024-08-16 13:09:17 +08:00
折戟沉沙、丿
5bf0dd0ef1 feat(http): text/plain is allowed (#2376)
* feat(http): plan/txt is allowed

* Update http468.ts

* Update http468.ts

* body 添加string类型
2024-08-16 10:03:43 +08:00
何翀彬
5545e84bb9 调整.env.template关于mongodb的说明,使得更易于理解 (#2398) 2024-08-16 09:58:50 +08:00
Archer
86c27e85ef 4.8.10 perf (#2378)
* perf: helpline code

* fix: prompt call stream=false response prefix

* fix: app chat log auth

* perf: new chat i18n

* fix: milvus dataset cannot export data

* perf: doc intro
2024-08-15 13:12:39 +08:00
Archer
fdeb1590d7 User select node (#2397)
* feat: add user select node (#2300)

* feat: add user select node

* fix

* type

* fix

* fix

* fix

* perf: user select code

* perf: user select histories

* perf: i18n

---------

Co-authored-by: heheer <heheer@sealos.io>
2024-08-15 12:27:04 +08:00
Finley Ge
f8b8fcc172 feat(publish): Wechat OffiAccount (#2386)
* feat: OffiAccount fe

* feat: offiaccount

* fix: wecom requires AES key

* fix: OffiAccountEditModal

* chore: change wechat svg icon

* chore: add offiaccount svg

* chore: hide unimplemented wecom entries
2024-08-15 12:06:13 +08:00
changan-77
5bbaa8264a Update feishu.md (#2382) 2024-08-14 11:45:03 +08:00
Archer
0f3418daf5 Publish app - feishu and wecom (#2375)
* feat(app publish): feishu bot (#2290)

* feat: feishu publish channel fe

* feat: enable feishu fe,
feat: feishu token api

* feat: feishu bot

* chore: extract saveChat from projects/app

* chore: remove debug log output

* feat: Basic Info

* chore: feishu bot fe adjusting

* feat: feishu bot docs

* feat: new tmpData collection for all tmpdata

* chore: compress the image

* perf: feishu config

* feat: source name

* perf: text desc

* perf: load system plugins

* perf: chat source

* feat(publish): Wecom bot (#2343)

* chore: Wecom Config

* feat(fe): wecom config fe

* feat: wecom fe

* chore: uses the newest editmodal

* feat: update png; adjust the fe

* chore: adjust fe

* perf: publish app ui

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
2024-08-13 21:52:18 +08:00
heheer
7417de74da feat: add workflow helperline (#2356)
* feat: add workflow helperline

* del console

* across zoom & adjust distance
2024-08-13 21:42:17 +08:00
Archer
fe9cb437e5 feat: file input doc (#2359) 2024-08-13 14:25:49 +08:00
Zong
2827c633cd docs(bge-rerank): qa docs (#2358) 2024-08-13 14:11:38 +08:00
Archer
dd1e2d5eb7 Update 489.md (#2353) 2024-08-13 10:06:29 +08:00
Zong
6293801bfa fix(docs): home host typo (#2352) 2024-08-13 10:04:34 +08:00
Zong
7f2aa97de7 fix(docs): reranker typo (#2341) 2024-08-12 18:25:06 +08:00
Archer
2196930005 App template market (#2337)
* feat: add app template market (#2012)

* feat: add app template market

* fix

* fix

* i18n

* fix

* perf: template market ux

* perf: simple mode app ui

* perf: tempalte modal ui

* perf: tempalte market ui

* perf: template position

* feat: create app modal

* regiter default app

* perf: icon

* change templates position (#2331)

* change templates position

* fix

* perf: template market ux

---------

Co-authored-by: heheer <heheer@sealos.io>
2024-08-12 16:21:21 +08:00
Archer
231afc4ac5 Update README.md (#2335) 2024-08-12 13:58:49 +08:00
Archer
2dc0b0fbec feat: 4.8.9 doc (#2334)
* feat: 4.8.9 doc

* doc

* README.md
2024-08-12 13:58:04 +08:00
Archer
72bb3f667b fix: doc (#2332) 2024-08-12 12:15:09 +08:00
Archer
02d6b7c788 4.8.9 test fix (#2330)
* perf: query extension prompt

* perf: get preview histories

* perf: i18n

* fix: share page cannot feedback

* fix: publish i18n
2024-08-12 12:09:14 +08:00
Archer
e098b2f1dc Update ExtraPlan.tsx 2024-08-10 00:43:25 +08:00
Finley Ge
832a4d6638 chore: change notification account bind hint text (#2310) 2024-08-09 17:56:03 +08:00
Menghuan1918
4d570ecd4f 修改插件:Doc2X插件适配文件上传功能 (#2284)
* Change to download first and check contentType

* Up to date

* Some bug fix, still some bug with img

* Update tool to read from file

* improve formatting in PDF

* Add tool of img file OCR , but meet some bug

* Bug fix for parameter passing error.

* Modification Introduction
2024-08-08 18:56:05 +08:00
Zong
067f3f4098 fix(query): extension prompt template (#2288) 2024-08-08 18:47:34 +08:00
Archer
d682a8252f 4.8.9 test (#2299)
* perf: read file prompt

* perf: read file prompt

* perf: free plan tip

* feat: cron job usage

* perf: app templates

* perf: get llm model by name

* feat: support outlink upload file

* fix: upload limit
2024-08-08 17:45:15 +08:00
papapatrick
c6dd3076c5 fix: quote display error (#2298) 2024-08-08 14:41:21 +08:00
Finley Ge
b4f3a77b01 fix: bind notification account (#2297) 2024-08-08 14:40:56 +08:00
Finley Ge
7141189102 chore(notification bind): team member notification bind hint text (#2295)
adjusting
2024-08-08 11:54:57 +08:00
Archer
3ba9c21828 4.8.9 test fix (#2291)
* perf: read file icon

* perf:icon

* fix: i18n

* perf: hide pro api

* perf: upload expired time

* perf: upload file frequency limit

* perf: upload file ux

* perf: input file tip

* perf: qa custom chunk size

* feat: dataset openapi

* fix: auth dataset list

* fix: openapi doc

* perf: zero temperature change to 0.01

* perf: read file prompt

* perf: read file prompt

* perf: free plan tip

* feat: cron job usage
2024-08-08 10:07:24 +08:00
Coder-Wjt
7b388b287a Adjust the parameters of gpt-40-mini model, custom for QA mode Add chunkSize setting input (#2139)
* Adjust the parameters of gpt-40-mini model, custom for QA mode Add chunkSize setting input

* Adjust the parameters of gpt-40-mini model
2024-08-07 18:05:41 +08:00
shilin
e9ba00d38f fix(dataset): 知识库列表右下角类型的名称上下居中 (#2287) 2024-08-07 18:01:13 +08:00
Archer
a109c59cc6 Move app owner (#2280)
* feat: app owner change (#2271)

* feat(app): changeOwner api

* feat: changeOwner api

* feat: ChangeOwnerModal

* feat: update change owner api

* chore: move change owner api into pro version
feat(fe): change owner modal

* feat: add change owner button and modal to InfoModal

* change owner ux

* feat: doc

* perf: remove info change owner btn

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
2024-08-06 22:13:16 +08:00
Archer
91bc573571 Update 482.md (#2283) 2024-08-06 20:16:30 +08:00
Hwting
2712ef21ff docs: Repair and supplement document content xinference.md (#2278)
Repair and supplement document content
2024-08-06 19:59:34 +08:00
Archer
593af8f7dc Update README.md (#2274) 2024-08-06 12:13:58 +08:00
Archer
96ebec9809 Fix navbar (#2273)
* fix: phone navbar cannot scroll; fix: file uplaod process error

* perf: select repeat file
2024-08-06 11:49:52 +08:00
shilin
f35ba8e5a7 feat(chatbot-extension): a Chrome extension that can be using for chat with AI on any website (#2235)
* feat(chatbot-extension): a Chrome extension that can be using for chat with AI on any website

* fix: 插件支持语音输入
feat:chatbot支持切换

* fix: 切换chatbot后,自动隐藏bot列表
2024-08-06 10:53:01 +08:00
Archer
e36d9d794f File input (#2270)
* doc

* feat: file upload  config

* perf: chat box file params

* feat: markdown show file

* feat: chat file store and clear

* perf: read file contentType

* feat: llm vision config

* feat: file url output

* perf: plugin error text

* perf: image load

* feat: ai chat document

* perf: file block ui

* feat: read file node

* feat: file read response field

* feat: simple mode support read files

* feat: tool call

* feat: read file histories

* perf: select file

* perf: select file config

* i18n

* i18n

* fix: ts; feat: tool response preview result
2024-08-06 10:00:22 +08:00
papapatrick
10dcdb5491 I18n Translations (#2267)
* rebase

* i18n-1

* add error info i18n

* fix

* fix

* refactor: 删除error.json

* delete useI18n
2024-08-05 18:42:21 +08:00
heheer
025d405fe2 feat: allow adding tags when creating collections via api (#2268)
* feat: allow adding tags when creating collections via api

* fix
2024-08-05 18:33:58 +08:00
Archer
fe71efbbd2 Collection tag (#2266)
* feat: collection metadata filter (#2211)

* feat: add dataset collection tags (#2231)

* dataset page

* workflow page

* move

* fix

* add plus filter

* fix

* fix

* fix

* perf: collection tag code

* fix: collection tags (#2249)

* fix

* fix

* fix tags of dataset page

* fix tags of workflow page

* doc

* add comments

* fix: collection tags (#2264)

* fix: metadata filter

* feat: search filter

---------

Co-authored-by: heheer <1239331448@qq.com>
Co-authored-by: heheer <heheer@sealos.io>
2024-08-05 12:08:46 +08:00
Archer
56f6e69bc7 System inform (#2263)
* feat: Bind Notification Pipe (#2229)

* chore: account page add bind notification modal

* feat: timerlock schema and type

* feat(fe): bind notification method modal

* chore: fe adjust

* feat: clean useless code

* fix: cron lock

* chore: adjust the code

* chore: rename api

* chore: remove unused code

* chore: fe adjust

* perf: bind inform ux

* fix: time ts

* chore: notification (#2251)

* perf: send message code

* perf: sub schema index

* fix: timezone plugin

* fix: format

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
2024-08-05 00:29:14 +08:00
heheer
998e7833e8 fix: workflow plugin module default input value (#2257) 2024-08-03 18:16:50 +08:00
heheer
110bf9391f fix: get plugin input variables from history (#2255) 2024-08-03 12:31:31 +08:00
heheer
48f2c95bb9 fix: add delete all input guide lexicon button (#2241)
* fix: add delete all input guide lexicon button

* fix

* fix permisstion
2024-08-03 12:29:15 +08:00
Archer
9f37e56173 Chat perf test (#2252)
* perf: optimize chat init api (#2233)

* perf: optimize the chat/init api

* perf: 添加团队和分享api的优化

* perf: api写法优化

* perf: api写法优化

* perf: 完善细节

* perf: 添加auth字段

* perf: 优雅的写法🥳

* fix: Fix the bug in debugging Tag (#2250)

* fix: 修复调试tag不显示bug

* perf

* perf: 优化代码

* fix: 返回新对象

* fix: show tag error

---------

Co-authored-by: papapatrick <109422393+Patrickill@users.noreply.github.com>
2024-08-03 10:44:31 +08:00
lolocoo
af1cff6230 fix(appList): 删除应用后回到聊天选择最后一次对话的应用时提示无该应用bug (#2236) 2024-08-02 10:14:39 +08:00
Archer
3760726354 Update 488.md (#2234) 2024-08-01 12:24:38 +08:00
Archer
6ddf0b23fc Update 488.md (#2232) 2024-08-01 10:06:44 +08:00
Archer
f680bdf54d yml version (#2230) 2024-07-31 17:04:48 +08:00
1199 changed files with 74352 additions and 28697 deletions

View File

@@ -11,7 +11,7 @@ assignees: ''
[//]: # '方框内填 x 表示打钩'
- [ ] 我已确认目前没有类似 issue
- [ ] 我已完整查看过项目 README以及[项目文档](https://doc.fastgpt.in/docs/intro/)
- [ ] 我已完整查看过项目 README以及[项目文档](https://doc.tryfastgpt.ai/docs/intro/)
- [ ] 我使用了自己的 key并确认我的 key 是可正常使用的
- [ ] 我理解并愿意跟进此 issue协助测试和提供反馈
- [x] 我理解并认可上述内容,并理解项目维护者精力有限,**不遵循规则的 issue 可能会被无视或直接关闭**

View File

@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 飞书话题群
url: https://oss.laf.run/otnvvf-imgs/1719505774252.jpg
url: https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png
about: FastGPT 全是问题群

BIN
.github/imgs/image.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 159 KiB

View File

@@ -1,4 +1,4 @@
name: Deploy image by kubeconfig
name: Deploy doc image by kubeconfig
on:
workflow_dispatch:
push:

View File

@@ -1,4 +1,4 @@
name: Deploy image to vercel
name: Deploy doc image to vercel
on:
workflow_dispatch:

View File

@@ -90,3 +90,45 @@ jobs:
-t ${Docker_Hub_Tag} \
-t ${Docker_Hub_Latest} \
.
build-fastgpt-images-child-route:
runs-on: ubuntu-20.04
steps:
# Set tag
- name: Set image name and tag
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV
else
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV
fi
- name: Build and publish image for main branch or tag push event
env:
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
run: |
docker buildx build \
-f projects/app/Dockerfile \
--platform linux/amd64,linux/arm64 \
--build-arg base_url=fastai \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
--label "org.opencontainers.image.description=fastgpt image" \
--push \
--cache-from=type=local,src=/tmp/.buildx-cache \
--cache-to=type=local,dest=/tmp/.buildx-cache \
-t ${Git_Tag} \
-t ${Git_Latest} \
-t ${Ali_Tag} \
-t ${Ali_Latest} \
-t ${Docker_Hub_Tag} \
-t ${Docker_Hub_Latest} \
.

View File

@@ -50,5 +50,73 @@
"export default ContextProvider"
],
"description": "FastGPT usecontext template"
},
"Jest test template": {
"scope": "typescriptreact",
"prefix": "jesttest",
"body": [
"import '@/pages/api/__mocks__/base';",
"import { root } from '@/pages/api/__mocks__/db/init';",
"import { getTestRequest } from '@/test/utils';",
"import { AppErrEnum } from '@fastgpt/global/common/error/code/app';",
"import handler from './demo';",
"",
"// Import the schema",
"import { MongoOutLink } from '@fastgpt/service/support/outLink/schema';",
"",
"beforeAll(async () => {",
" // await MongoOutLink.create({",
" // shareId: 'aaa',",
" // appId: root.appId,",
" // tmbId: root.tmbId,",
" // teamId: root.teamId,",
" // type: 'share',",
" // name: 'aaa'",
" // })",
"});",
"",
"test('Should return a list of outLink', async () => {",
" // Mock request",
" const res = (await handler(",
" ...getTestRequest({",
" query: {",
" appId: root.appId,",
" type: 'share'",
" },",
" user: root",
" })",
" )) as any;",
"",
" expect(res.code).toBe(200);",
" expect(res.data.length).toBe(2);",
"});",
"",
"test('appId is required', async () => {",
" const res = (await handler(",
" ...getTestRequest({",
" query: {",
" type: 'share'",
" },",
" user: root",
" })",
" )) as any;",
" expect(res.code).toBe(500);",
" expect(res.error).toBe(AppErrEnum.unExist);",
"});",
"",
"test('if type is not provided, return nothing', async () => {",
" const res = (await handler(",
" ...getTestRequest({",
" query: {",
" appId: root.appId",
" },",
" user: root",
" })",
" )) as any;",
" expect(res.code).toBe(200);",
" expect(res.data.length).toBe(0);",
"});"
]
}
}

10
.vscode/settings.json vendored
View File

@@ -13,7 +13,7 @@
"js",
"ts"
],
"i18n-ally.keystyle": "nested",
"i18n-ally.keystyle": "flat",
"i18n-ally.sortKeys": true,
"i18n-ally.keepFulfilled": false,
"i18n-ally.sourceLanguage": "zh", // 根据此语言文件翻译其他语言文件的变量和内容
@@ -21,7 +21,13 @@
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.json",
"i18n-ally.extract.targetPickingStrategy": "most-similar-by-key",
"i18n-ally.translate.engines": ["google"],
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"markdown.copyFiles.destination": {
"/docSite/content/**/*": "${documentWorkspaceFolder}/docSite/assets/imgs/"
},
"markdown.copyFiles.overwriteBehavior": "nameIncrementally",
"markdown.copyFiles.transformPath": "const filename = uri.path.split('/').pop(); return `/imgs/${filename}`;"
}

View File

@@ -1,6 +1,6 @@
<div align="center">
<a href="https://fastgpt.in/"><img src="/.github/imgs/logo.svg" width="120" height="120" alt="fastgpt logo"></a>
<a href="https://tryfastgpt.ai/"><img src="/.github/imgs/logo.svg" width="120" height="120" alt="fastgpt logo"></a>
# FastGPT
@@ -15,13 +15,13 @@ FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开
</div>
<p align="center">
<a href="https://fastgpt.in/">
<a href="https://tryfastgpt.ai/">
<img height="21" src="https://img.shields.io/badge/在线使用-d4eaf7?style=flat-square&logo=spoj&logoColor=7d09f1" alt="cloud">
</a>
<a href="https://doc.fastgpt.in/docs/intro">
<a href="https://doc.tryfastgpt.ai/docs/intro">
<img height="21" src="https://img.shields.io/badge/相关文档-7d09f1?style=flat-square" alt="document">
</a>
<a href="https://doc.fastgpt.in/docs/development">
<a href="https://doc.tryfastgpt.ai/docs/development">
<img height="21" src="https://img.shields.io/badge/本地开发-%23d4eaf7?style=flat-square&logo=xcode&logoColor=7d09f1" alt="development">
</a>
<a href="/#-%E7%9B%B8%E5%85%B3%E9%A1%B9%E7%9B%AE">
@@ -36,7 +36,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
## 🛸 在线使用
- 🌍 海外版:[fastgpt.in](https://fastgpt.in/)
- 🌍 国际版:[tryfastgpt.ai](https://tryfastgpt.ai/)
| | |
| ---------------------------------- | ---------------------------------- |
@@ -50,22 +50,22 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
## 💡 RoadMap
`1` 应用编排能力
- [x] 提供简易模式,无需操作编排
- [x] 工作流编排
- [x] 对话工作流、插件工作流
- [x] 工具调用
- [x] 插件 - 工作流封装能力
- [x] Code sandbox
- [ ] 循环调用
- [x] 循环调用
- [x] 用户选择
- [x] 表单输入
`2` 知识库能力
- [x] 多库复用,混用
- [x] chunk 记录修改和删除
- [x] 源文件存储
- [x] 支持手动输入直接分段QA 拆分导入
- [x] 支持 txtmdhtmlpdfdocxpptxcsvxlsx (有需要更多可 PR file loader)
- [x] 支持 url 读取、CSV 批量导入
- [x] 混合检索 & 重排
- [ ] 标签过滤
- [ ] 自定义文件读取服务
- [ ] 自定义分块服务
`3` 应用调试能力
- [x] 知识库单点搜索测试
@@ -77,7 +77,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
`4` OpenAPI 接口
- [x] completions 接口 (chat 模式对齐 GPT 接口)
- [x] 知识库 CRUD
- [ ] 对话 CRUD
- [x] 对话 CRUD
`5` 运营能力
- [x] 免登录分享窗口
@@ -88,7 +88,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
`6` 其他
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
- [x] 模糊输入提示
- [ ] 模板市场
- [x] 模板市场
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
@@ -96,23 +96,21 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
## 👨‍💻 开发
项目技术栈NextJs + TS + ChakraUI + Mongo + Postgres (Vector 插件)
项目技术栈NextJs + TS + ChakraUI + MongoDB + PostgreSQL (PG Vector 插件)/Milvus
- **⚡ 快速部署**
> [Sealos](https://sealos.io) 服务器在国外,不需要额外处理网络问题,无需服务器、无需魔法、无需域名,支持高并发 & 动态伸缩。点击以下按钮即可一键部署 👇
> 使用 [Sealos](https://sealos.io) 服务,无需采购服务器、无需域名,支持高并发 & 动态伸缩,并且数据库应用采用 kubeblocks 的数据库,在 IO 性能方面,远超于简单的 Docker 容器部署。
[![](https://cdn.jsdelivr.net/gh/labring-actions/templates@main/Deploy-on-Sealos.svg)](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt)
[点击查看 Sealos 一键部署 FastGPT 教程](https://doc.tryfastgpt.ai/docs/development/sealos/)
由于需要部署数据库,部署完后需要等待 2~4 分钟才能正常访问。默认用了最低配置,首次访问时会有些慢。相关使用教程可查看:[Sealos 部署 FastGPT](https://doc.fastgpt.in/docs/development/sealos/)
* [快速开始本地开发](https://doc.fastgpt.in/docs/development/intro/)
* [部署 FastGPT](https://doc.fastgpt.in/docs/development/sealos)
* [系统配置文件说明](https://doc.fastgpt.in/docs/development/configuration/)
* [多模型配置](https://doc.fastgpt.in/docs/development/one-api/)
* [版本更新/升级介绍](https://doc.fastgpt.in/docs/development/upgrading)
* [OpenAPI API 文档](https://doc.fastgpt.in/docs/development/openapi/)
* [知识库结构详解](https://doc.fastgpt.in/docs/course/dataset_engine/)
* [快速开始本地开发](https://doc.tryfastgpt.ai/docs/development/intro/)
* [部署 FastGPT](https://doc.tryfastgpt.ai/docs/development/sealos)
* [系统配置文件说明](https://doc.tryfastgpt.ai/docs/development/configuration/)
* [多模型配置](https://doc.tryfastgpt.ai/docs/development/one-api/)
* [版本更新/升级介绍](https://doc.tryfastgpt.ai/docs/development/upgrading)
* [OpenAPI API 文档](https://doc.tryfastgpt.ai/docs/development/openapi/)
* [知识库结构详解](https://doc.tryfastgpt.ai/docs/course/dataset_engine/)
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
@@ -122,7 +120,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
扫码加入飞书话题群 (新开,逐渐弃用微信群)
![](https://oss.laf.run/otnvvf-imgs/1719505774252.jpg)
![](https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png)
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
@@ -151,7 +149,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
## 🌿 第三方生态
- [OnWeChat 个人微信/企微机器人](https://doc.fastgpt.in/docs/use-cases/onwechat/)
- [OnWeChat 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/onwechat/)
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
@@ -214,4 +212,4 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
1. 允许作为后台服务直接商用,但不允许提供 SaaS 服务。
2. 未经商业授权,任何形式的商用服务均需保留相关版权信息。
3. 完整请查看 [FastGPT Open Source License](./LICENSE)
4. 联系方式:yujinlong@sealos.io[点击查看商业版定价策略](https://doc.fastgpt.in/docs/commercial)
4. 联系方式:Dennis@sealos.io[点击查看商业版定价策略](https://doc.tryfastgpt.ai/docs/commercial)

View File

@@ -1,9 +1,11 @@
<div align="center">
<a href="https://fastgpt.in/"><img src="/.github/imgs/logo.svg" width="120" height="120" alt="fastgpt logo"></a>
<a href="https://tryfastgpt.ai/"><img src="/.github/imgs/logo.svg" width="120" height="120" alt="fastgpt logo"></a>
# FastGPT
![Qoute](./.github/imgs/image.png)
<p align="center">
<a href="./README_en.md">English</a> |
<a href="./README.md">简体中文</a> |
@@ -12,132 +14,75 @@
FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
[![GitHub Repo stars](https://img.shields.io/github/stars/labring/FastGPT?style=flat-square&labelColor=d4eaf7&color=7d09f1)](https://github.com/labring/FastGPT/stargazers)
[![GitHub pull request](https://img.shields.io/badge/PRs-welcome-fffff?style=flat-square&labelColor=d4eaf7&color=7d09f1)](https://github.com/labring/FastGPT/pulls)
[![GitHub last commit](https://img.shields.io/github/last-commit/labring/FastGPT?style=flat-square&labelColor=d4eaf7&color=7d09f1)](https://github.com/labring/FastGPT/pulls)
[![License](https://img.shields.io/badge/License-Apache--2.0-ffffff?style=flat-square&labelColor=d4eaf7&color=7d09f1)](https://github.com/labring/FastGPT/blob/main/LICENSE)
[![Documentation](https://img.shields.io/badge/Documentation-7d09f1?style=flat-square)](https://doc.tryfastgpt.ai/docs/intro)
[![Local Development](https://img.shields.io/badge/Local_Development-%23d4eaf7?style=flat-square&logo=xcode&logoColor=7d09f1)](https://doc.tryfastgpt.ai/docs/intro)
[![Explore our platform](https://img.shields.io/badge/Explore_our_platform-d4eaf7?style=flat-square&logo=spoj&logoColor=7d09f1)](https://tryfastgpt.ai/)
[![discord](https://theme.zdassets.com/theme_assets/678183/cc59daa07820943e943c2fc283b9079d7003ff76.svg)](https://discord.gg/mp68xkZn2Q)&nbsp;&nbsp;&nbsp;&nbsp;
[![Wechat](https://upload.wikimedia.org/wikipedia/en/thumb/a/af/WeChat_logo.svg/100px-WeChat_logo.svg.png?20231125073656)](https://oss.laf.run/otnvvf-imgs/feishu3.png)
</div>
<p align="center">
<a href="https://fastgpt.in/">
<img height="21" src="https://img.shields.io/badge/Try it Online-d4eaf7?style=flat-square&logo=spoj&logoColor=7d09f1" alt="cloud">
</a>
<a href="https://doc.fastgpt.in/docs/intro">
<img height="21" src="https://img.shields.io/badge/Documents-7d09f1?style=flat-square" alt="document">
</a>
<a href="https://doc.fastgpt.in/docs/development">
<img height="21" src="https://img.shields.io/badge/Local Development-%23d4eaf7?style=flat-square&logo=xcode&logoColor=7d09f1" alt="development">
</a>
<a href="https://github.com/labring/FastGPT/blob/main/LICENSE">
<img height="21" src="https://img.shields.io/badge/License-Apache--2.0-ffffff?style=flat-square&labelColor=d4eaf7&color=7d09f1" alt="license">
</a>
</p>
<div align="center">
[![discord](https://theme.zdassets.com/theme_assets/678183/cc59daa07820943e943c2fc283b9079d7003ff76.svg)](https://discord.gg/mp68xkZn2Q)
</div>
## 🎥 Comprehensive Feature Demonstration
https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409bd33f6d4
## 🛸 Use Cloud Services
## 🛸 Online Use
Cloud: [fastgpt.in](https://fastgpt.in/)
Website: [tryfastgpt.ai](https://tryfastgpt.ai/)
| | |
| ---------------------------------- | ---------------------------------- |
| Conversational AI Setup | Workflow Automation |
| ![Demo](./.github/imgs/intro1.png) | ![Demo](./.github/imgs/intro2.png) |
| Knowledge Base Setup | Integration Process |
| ![Demo](./.github/imgs/intro3.png) | ![Demo](./.github/imgs/intro4.png) |
<a href="#readme">
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 💡 Features
`1` Application Orchestration Features
- [x] Offers a straightforward mode, eliminating the need for complex orchestration
- [x] Provides clear next-step instructions in dialogues
- [x] Facilitates workflow orchestration
- [x] Tracks references in source files
- [x] Encapsulates modules for enhanced reuse at multiple levels
- [x] Combines search and reordering functions
- [ ] Includes a tool module
- [ ] Integrates [Laf](https://github.com/labring/laf) for online HTTP module creation
- [ ] Plugin encapsulation capabilities
`2` Knowledge Base Features
- [x] Allows for the mixed use of multiple databases
- [x] Keeps track of modifications and deletions in data chunks
- [x] Enables specific vector models for each knowledge base
- [x] Stores original source files
- [x] Supports direct input and segment-based QA import
- [x] Compatible with a variety of file formats: pdf, docx, txt, html, md, csv
- [x] Facilitates URL reading and bulk CSV importing
- [ ] Supports PPT and Excel file import
- [ ] Features a file reader
- [ ] Offers diverse data preprocessing options
`3` Application Debugging Features
- [x] Enables targeted search testing within the knowledge base
- [x] Allows feedback, editing, and deletion during conversations
- [x] Presents the full context of interactions
- [x] Displays all intermediate values within modules
- [ ] Advanced DeBug mode for orchestration
`4` OpenAPI Interface
- [x] The completions interface (aligned with GPT's chat mode interface)
- [x] CRUD operations for the knowledge base
- [ ] CRUD operations for conversations
`5` Operational Features
- [x] Share without requiring login
- [x] Easy embedding with Iframe
- [x] Customizable chat window embedding with features like default open, drag-and-drop
- [x] Centralizes conversation records for review and annotation
| **Features** | **Details** |
|--------------------------------------------|---------------------------------------------------|
| **Application Orchestration Features** | ✅ Offers a straightforward mode, eliminating the need for complex orchestration <br> ✅ Provides clear next-step instructions in dialogues <br> ✅ Facilitates workflow orchestration <br> ✅ Tracks references in source files <br> ✅ Encapsulates modules for enhanced reuse at multiple levels <br> ✅ Combines search and reordering functions <br> 🔜 Includes a tool module <br> 🔜 Integrates [Laf](https://github.com/labring/laf) for online HTTP module creation <br> 🔜 Plugin encapsulation capabilities |
| **Knowledge Base Features** | ✅ Allows for the mixed use of multiple databases <br> ✅ Keeps track of modifications and deletions in data chunks <br> ✅ Enables specific vector models for each knowledge base <br> ✅ Stores original source files <br> ✅ Supports direct input and segment-based QA import <br> ✅ Compatible with a variety of file formats: pdf, docx, txt, html, md, csv <br> ✅ Facilitates URL reading and bulk CSV importing <br> 🔜 Supports PPT and Excel file import <br> 🔜 Features a file reader <br> 🔜 Offers diverse data preprocessing options |
| **Application Debugging Features** | ✅ Enables targeted search testing within the knowledge base <br> ✅ Allows feedback, editing, and deletion during conversations <br> ✅ Presents the full context of interactions <br> ✅ Displays all intermediate values within modules <br> 🔜 Advanced Debug mode for orchestration |
| **OpenAPI Interface** | ✅ The completions interface (aligned with GPT's chat mode interface) <br> ✅ CRUD operations for the knowledge base <br> 🔜 CRUD operations for conversation |
| **Operational Features** | ✅ Share without requiring login <br> ✅ Easy embedding with Iframe <br> ✅ Customizable chat window embedding with features like default open, drag-and-drop <br> ✅ Centralizes conversation records for review and annotation |
<a href="#readme">
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 👨‍💻 Development
Project tech stack: NextJs + TS + ChakraUI + Mongo + Postgres (Vector plugin)
Project tech stack: NextJs + TS + ChakraUI + MongoDB + PostgreSQL (PG Vector plug-in)/Milvus
- **⚡ Deployment**
- **⚡ Fast Deployment**
> When using [Sealos](https://sealos.io) services, there is no need to purchase servers or domain names. It supports high concurrency and dynamic scaling, and the database application uses the kubeblocks database, which far exceeds the simple Docker container deployment in terms of IO performance.
<div align="center">
[![](https://cdn.jsdelivr.net/gh/labring-actions/templates@main/Deploy-on-Sealos.svg)](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt)
</div>
Give it a 2-4 minute wait after deployment as it sets up the database. Initially, it might be a tad slow since we're using the basic settings.
Give it a 2-4 minute wait after deployment as it sets up the database. Initially, it might be a too slow since we're using the basic settings.
- [Getting Started with Local Development](https://doc.fastgpt.in/docs/development)
- [Deploying FastGPT](https://doc.fastgpt.in/docs/installation)
- [Guide on System Configs](https://doc.fastgpt.in/docs/installation/reference)
- [Configuring Multiple Models](https://doc.fastgpt.in/docs/installation/reference/models)
- [Version Updates & Upgrades](https://doc.fastgpt.in/docs/installation/upgrading)
[sealos one click deployment tutorial](https://doc.tryfastgpt.ai/docs/development/sealos/)
- [Getting Started with Local Development](https://doc.tryfastgpt.ai/docs/development)
- [Deploying FastGPT](https://doc.tryfastgpt.ai/docs/installation)
- [Guide on System Configs](https://doc.tryfastgpt.ai/docs/installation/reference)
- [Configuring Multiple Models](https://doc.tryfastgpt.ai/docs/installation/reference/models)
- [Version Updates & Upgrades](https://doc.tryfastgpt.ai/docs/installation/upgrading)
## 🏘️ Community & support
+ 🌐 Visit the [FastGPT website](https://fastgpt.in/) for full documentation and useful links.
+ 💬 Join our [Discord server](https://discord.gg/mp68xkZn2Q) is to chat with FastGPT developers and other FastGPT users. This is a good place to learn about FastGPT, ask questions, and share your experiences.
+ 🐞 Create [GitHub Issues](https://github.com/labring/FastGPT/issues/new/choose) for bug reports and feature requests.
<a href="#readme">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 👀 Others
- [FastGPT FAQ](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh)
- [Docker Deployment Tutorial Video](https://www.bilibili.com/video/BV1jo4y147fT/)
- [Official Account Integration Video Tutorial](https://www.bilibili.com/video/BV1xh4y1t7fy/)
- [FastGPT Knowledge Base Demo](https://www.bilibili.com/video/BV1Wo4y1p7i1/)
<a href="#readme">
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
@@ -148,7 +93,7 @@ Project tech stack: NextJs + TS + ChakraUI + Mongo + Postgres (Vector plugin)
- [One API: Multi-model management, supports Azure, Wenxin Yiyuan, etc.](https://github.com/songquanpeng/one-api)
- [TuShan: Build a backend management system in 5 minutes](https://github.com/msgbyte/tushan)
<a href="#readme">
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
@@ -156,10 +101,69 @@ Project tech stack: NextJs + TS + ChakraUI + Mongo + Postgres (Vector plugin)
- [luolinAI: Enterprise WeChat bot, ready to use](https://github.com/luolin-ai/FastGPT-Enterprise-WeChatbot)
<a href="#readme">
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 🏘️ Community & Support
+ 🌐 Visit the [FastGPT website](https://tryfastgpt.ai/) for full documentation and useful links.
+ 💬 Join our [Discord server](https://discord.gg/mp68xkZn2Q) is to chat with FastGPT developers and other FastGPT users. This is a good place to learn about FastGPT, ask questions, and share your experiences.
+ 🐞 Create [GitHub Issues](https://github.com/labring/FastGPT/issues/new/choose) for bug reports and feature requests.
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 👀 Others
- [FastGPT FAQ](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh)
- [Docker Deployment Tutorial Video](https://www.bilibili.com/video/BV1jo4y147fT/)
- [Official Account Integration Video Tutorial](https://www.bilibili.com/video/BV1xh4y1t7fy/)
- [FastGPT Knowledge Base Demo](https://www.bilibili.com/video/BV1Wo4y1p7i1/)
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 🌱 Contributors
We welcome all forms of contributions. If you are interested in contributing code, you can check out our GitHub [Issues](https://github.com/labring/FastGPT/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) to show us your ideas.
<a href="https://github.com/labring/FastGPT/graphs/contributors" target="_blank">
<table>
<tr>
<th colspan="2">
<br><img src="https://contrib.rocks/image?repo=labring/FastGPT"><br><br>
</th>
</tr>
<tr>
<td>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=active&period=past_28_days&owner_id=102226726&repo_ids=605673387&image_size=2x3&color_scheme=dark">
<img alt="Active participants of labring - past 28 days" src="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=active&period=past_28_days&owner_id=102226726&repo_ids=605673387&image_size=2x3&color_scheme=light">
</picture>
</td>
<td rowspan="2">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-org-participants-growth/thumbnail.png?activity=new&period=past_28_days&owner_id=102226726&repo_ids=605673387&image_size=4x7&color_scheme=dark">
<img alt="New trends of labring" src="https://next.ossinsight.io/widgets/official/compose-org-participants-growth/thumbnail.png?activity=new&period=past_28_days&owner_id=102226726&repo_ids=605673387&image_size=4x7&color_scheme=light">
</picture>
</td>
</tr>
<tr>
<td>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=new&period=past_28_days&owner_id=102226726&repo_ids=605673387&image_size=2x3&color_scheme=dark">
<img alt="New participants of labring - past 28 days" src="https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=new&period=past_28_days&owner_id=102226726&repo_ids=605673387&image_size=2x3&color_scheme=light">
</picture>
</td>
</tr>
</table>
</a>
## 🌟 Star History
<a href="https://github.com/labring/FastGPT/stargazers" target="_blank" style="display: block" align="center">
@@ -169,3 +173,20 @@ Project tech stack: NextJs + TS + ChakraUI + Mongo + Postgres (Vector plugin)
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=labring/FastGPT&type=Date" />
</picture>
</a>
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>
## 📄 Usage Agreement
This repository complies with the [FastGPT Open Source License](./LICENSE) open source agreement.
1. Direct commercial use as a backend service is allowed, but provision of SaaS services is not allowed.
2. Without commercial authorization, any form of commercial service must retain relevant copyright information.
3. For full details, please see [FastGPT Open Source License](./LICENSE)
4. Contact: Dennis@sealos.io , [click to view commercial version pricing strategy](https://doc.tryfastgpt.ai/docs/commercial)
<a href="#FastGPT">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
</a>

View File

@@ -1,6 +1,6 @@
<div align="center">
<a href="https://fastgpt.in/"><img src="/.github/imgs/logo.svg" width="120" height="120" alt="fastgpt logo"></a>
<a href="https://tryfastgpt.ai/"><img src="/.github/imgs/logo.svg" width="120" height="120" alt="fastgpt logo"></a>
# FastGPT
@@ -15,13 +15,13 @@ FastGPT は、LLM 上 に 構築 された 知識 ベースの Q&A システム
</div>
<p align="center">
<a href="https://fastgpt.in/">
<a href="https://tryfastgpt.ai/">
<img height="21" src="https://img.shields.io/badge/在线使用-d4eaf7?style=flat-square&logo=spoj&logoColor=7d09f1" alt="cloud">
</a>
<a href="https://doc.fastgpt.in/docs/intro">
<a href="https://doc.tryfastgpt.ai/docs/intro">
<img height="21" src="https://img.shields.io/badge/相关文档-7d09f1?style=flat-square" alt="document">
</a>
<a href="https://doc.fastgpt.in/docs/development">
<a href="https://doc.tryfastgpt.ai/docs/development">
<img height="21" src="https://img.shields.io/badge/本地开发-%23d4eaf7?style=flat-square&logo=xcode&logoColor=7d09f1" alt="development">
</a>
<a href="/#-%E7%9B%B8%E5%85%B3%E9%A1%B9%E7%9B%AE">
@@ -36,7 +36,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
## 🛸 クラウドサービスの 利用
[fastgpt.in](https://fastgpt.in/)
[tryfastgpt.ai](https://tryfastgpt.ai/)
| | |
| ---------------------------------- | ---------------------------------- |
@@ -98,11 +98,11 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
デプロイ 後、データベースをセットアップするので、24分待 ってください。基本設定 を 使 っているので、最初 は 少 し 遅 いかもしれません。
- [ローカル 開発入門](https://doc.fastgpt.in/docs/development)
- [FastGPT のデプロイ](https://doc.fastgpt.in/docs/installation)
- [システム 設定 ガイド](https://doc.fastgpt.in/docs/installation/reference)
- [複数 モデルの 設定](https://doc.fastgpt.in/docs/installation/reference/models)
- [バージョン 更新 とアップグレード](https://doc.fastgpt.in/docs/installation/upgrading)
- [ローカル 開発入門](https://doc.tryfastgpt.ai/docs/development)
- [FastGPT のデプロイ](https://doc.tryfastgpt.ai/docs/installation)
- [システム 設定 ガイド](https://doc.tryfastgpt.ai/docs/installation/reference)
- [複数 モデルの 設定](https://doc.tryfastgpt.ai/docs/installation/reference/models)
- [バージョン 更新 とアップグレード](https://doc.tryfastgpt.ai/docs/installation/upgrading)
<!-- ## :point_right: ロードマップ
- [FastGPT ロードマップ](https://kjqvjse66l.feishu.cn/docx/RVUxdqE2WolDYyxEKATcM0XXnte) -->

4
dev.md
View File

@@ -29,6 +29,10 @@ Note: If the Node version is >= 20, you need to pass the `--no-node-snapshot` pa
NODE_OPTIONS=--no-node-snapshot pnpm i
```
### Jest
https://fael3z0zfze.feishu.cn/docx/ZOI1dABpxoGhS7xzhkXcKPxZnDL
## I18N
### Install i18n-ally Plugin

View File

@@ -0,0 +1,5 @@
<svg t="1728884315234" class="icon" viewBox="0 0 1224 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4847" width="28" height="28" fill="currentColor">
<path d="M1224.146926 401.768509a50.444385 50.444385 0 0 0-23.813954-38.631991c-6.095363-3.741292-61.752335-36.782364-141.475481-43.949671a317.253146 317.253146 0 0 0-135.884563 16.982943L746.964061 25.579507A50.444385 50.444385 0 0 0 703.077446 0h-418.268027A50.444385 50.444385 0 0 0 248.027055 84.97777c3.236848 3.447033 296.360763 315.739814 426.969683 459.653442-59.734559 55.762064-103.558119 83.800735-127.666331 96.832201l-200.894764-140.823909a50.045034 50.045034 0 0 0-6.97814-4.098606L79.416697 314.205464A50.444385 50.444385 0 0 0 0.744475 364.124387c0.210185 1.177036 20.619142 118.607361 42.036988 237.635091C86.815207 847.297523 91.775572 859.656397 95.054457 867.874628c5.065457 12.611096 14.334613 24.549601 44.895503 44.538188a595.916337 595.916337 0 0 0 69.361029 38.337733c49.519571 23.603769 128.212812 54.437899 221.59798 67.25918a623.009175 623.009175 0 0 0 85.061845 5.948234c131.491697 0 290.055215-44.138837 418.373119-211.404011 73.564728-96.054517 118.250046-163.944252 154.086578-218.592335 44.033745-67.070014 70.622139-107.551633 118.838564-150.177139a50.444385 50.444385 0 0 0 16.877851-42.015969zM673.693591 100.88877L834.443032 384.638437a413.097477 413.097477 0 0 0-63.055481 59.356226c-8.743693 10.04684-17.256183 19.568218-25.579507 28.711263C656.248242 373.961042 497.033151 203.332909 401.188819 100.88877zM305.491617 882.125167c-59.86067-22.594881-102.065806-47.85911-118.523287-59.692523-10.299062-45.610132-39.935138-209.638457-65.829922-355.780044l391.238243 274.270325a48.132351 48.132351 0 0 0 6.725918 3.951477l189.166445 132.689752a398.300458 398.300458 0 0 1-155.410744 44.138837c-97.336645 7.713787-188.262649-17.277202-247.366653-39.577824z m698.654734-343.442189c-34.932737 53.197808-78.398982 119.385045-149.819824 212.496972a503.371908 503.371908 0 0 1-58.641598 64.33761l-158.185184-110.830518c35.31107-23.813953 81.152405-60.070855 135.905581-114.803013a48.342536 48.342536 0 0 0 14.944149-15.154334c18.790533-19.379051 38.568936-40.859952 59.272153-64.694924 57.086229-65.745849 124.009113-96.243683 198.540692-90.673782a247.639894 247.639894 0 0 1 38.589955 6.011289c-28.290893 33.62959-51.936698 69.63427-80.605924 113.3107z" p-id="4848"></path>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

@@ -11,7 +11,7 @@ FastGPT 项目在 Apache License 2.0 许可下开源,同时包含以下附加
+ FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可:
+ 多租户 SaaS 服务:除非获得 FastGPT 的明确书面授权,否则不得使用 fastgpt.in 的源码来运营与 fastgpt.in 服务类似的多租户 SaaS 服务。
+ 多租户 SaaS 服务:除非获得 FastGPT 的明确书面授权,否则不得使用 tryfastgpt.ai 的源码来运营与 tryfastgpt.ai 服务类似的多租户 SaaS 服务。
+ LOGO 及版权信息:在使用 FastGPT 的过程中,不得移除或修改 FastGPT 控制台内的 LOGO 或版权信息。
请通过电子邮件 yujinlong@sealos.io 联系我们咨询许可事宜。

View File

@@ -1,7 +1,7 @@
---
weight: 1100
title: '商业版介绍'
description: 'FastGPT 商业版介绍'
title: '收费说明'
description: 'FastGPT 收费说明'
icon: 'shopping_cart'
draft: false
images: []

View File

@@ -29,8 +29,8 @@ FastGPT 商业版是基于 FastGPT 开源版的增强版本,增加了一些独
| web站点同步 | ❌ | ✅ | ✅ |
| 管理后台 | ❌ | ✅ | 不需要 |
| 增强训练模式 | ❌ | ✅ | ✅ |
| 第三方应用快速接入(飞书、公众号) | ❌ | ✅ | ✅ |
| 图片知识库 | ❌ | 设计中 | 设计中 |
| 自动规划召回 | ❌ | 设计中 | 设计中 |
| 对话日志运营分析 | ❌ | 设计中 | 设计中 |
| 完整商业授权 | ❌ | ✅ | ✅ |
{{< /table >}}

View File

@@ -0,0 +1,12 @@
---
title: '线上版定价'
description: 'FastGPT 线上版定价'
icon: 'currency_yen'
draft: false
toc: true
weight: 1002
type: redirect
target: https://cloud.tryfastgpt.ai/price
---
线上版价格请查看:[https://cloud.tryfastgpt.ai/price](https://cloud.tryfastgpt.ai/price)

View File

@@ -11,6 +11,6 @@ FastGPT 是一个由用户和贡献者参与推动的开源项目,如果您对
+ 📱 扫码加入社区微信交流群👇
<img width="400px" src="https://oss.laf.run/htr4n1-images/fastgpt-qr-code.jpg" class="medium-zoom-image" />
<img width="400px" src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png" class="medium-zoom-image" />
+ 🐞 请将任何 FastGPT 的 Bug、问题和需求提交到 [GitHub Issue](https://github.com/labring/fastgpt/issues/new/choose)。

View File

@@ -0,0 +1,331 @@
---
title: '知识库基础原理介绍'
description: '本节详细介绍RAG模型的核心机制、应用场景及其在生成任务中的优势与局限性。'
icon: 'language'
draft: false
toc: true
weight: 106
---
[RAG文档](https://huggingface.co/docs/transformers/model_doc/rag)
# 1. 引言
随着自然语言处理NLP技术的迅猛发展生成式语言模型如GPT、BART等在多种文本生成任务中表现卓越尤其在语言生成和上下文理解方面。然而纯生成模型在处理事实类任务时存在一些固有的局限性。例如由于这些模型依赖于固定的预训练数据它们在回答需要最新或实时信息的问题时可能会出现“编造”信息的现象导致生成结果不准确或缺乏事实依据。此外生成模型在面对长尾问题和复杂推理任务时常因缺乏特定领域的外部知识支持而表现不佳难以提供足够的深度和准确性。
与此同时检索模型Retriever能够通过在海量文档中快速找到相关信息解决事实查询的问题。然而传统检索模型如BM25在面对模糊查询或跨域问题时往往只能返回孤立的结果无法生成连贯的自然语言回答。由于缺乏上下文推理能力检索模型生成的答案通常不够连贯和完整。
为了解决这两类模型的不足检索增强生成模型Retrieval-Augmented GenerationRAG应运而生。RAG通过结合生成模型和检索模型的优势实时从外部知识库中获取相关信息并将其融入生成任务中确保生成的文本既具备上下文连贯性又包含准确的知识。这种混合架构在智能问答、信息检索与推理、以及领域特定的内容生成等场景中表现尤为出色。
## 1.1 RAG的定义
RAG是一种将信息检索与生成模型相结合的混合架构。首先检索器从外部知识库或文档集中获取与用户查询相关的内容片段然后生成器基于这些检索到的内容生成自然语言输出确保生成的内容既信息丰富又具备高度的相关性和准确性。
# 2. RAG模型的核心机制
RAG 模型由两个主要模块构成检索器Retriever与生成器Generator。这两个模块相互配合确保生成的文本既包含外部的相关知识又具备自然流畅的语言表达。
## 2.1 检索器Retriever
检索器的主要任务是从一个外部知识库或文档集中获取与输入查询最相关的内容。在RAG中常用的技术包括
- 向量检索如BERT向量等它通过将文档和查询转化为向量空间中的表示并使用相似度计算来进行匹配。向量检索的优势在于能够更好地捕捉语义相似性而不仅仅是依赖于词汇匹配。
- 传统检索算法如BM25主要基于词频和逆文档频率TF-IDF的加权搜索模型来对文档进行排序和检索。BM25适用于处理较为简单的匹配任务尤其是当查询和文档中的关键词有直接匹配时。
RAG中检索器的作用是为生成器提供一个上下文背景使生成器能够基于这些检索到的文档片段生成更为相关的答案。
## 2.2 生成器Generator
生成器负责生成最终的自然语言输出。在RAG系统中常用的生成器包括
- BARTBART是一种序列到序列的生成模型专注于文本生成任务可以通过不同层次的噪声处理来提升生成的质量 。
- GPT系列GPT是一个典型的预训练语言模型擅长生成流畅自然的文本。它通过大规模数据训练能够生成相对准确的回答尤其在任务-生成任务中表现尤为突出 。
生成器在接收来自检索器的文档片段后,会利用这些片段作为上下文,并结合输入的查询,生成相关且自然的文本回答。这确保了模型的生成结果不仅仅基于已有的知识,还能够结合外部最新的信息。
## 2.3 RAG的工作流程
RAG模型的工作流程可以总结为以下几个步骤
1. 输入查询:用户输入问题,系统将其转化为向量表示。
2. 文档检索检索器从知识库中提取与查询最相关的文档片段通常使用向量检索技术或BM25等传统技术进行。
3. 生成答案:生成器接收检索器提供的片段,并基于这些片段生成自然语言答案。生成器不仅基于原始的用户查询,还会利用检索到的片段提供更加丰富、上下文相关的答案。
4. 输出结果:生成的答案反馈给用户,这个过程确保了用户能够获得基于最新和相关信息的准确回答。
# 3. RAG模型的工作原理
## 3.1 检索阶段
在RAG模型中用户的查询首先被转化为向量表示然后在知识库中执行向量检索。通常检索器采用诸如BERT等预训练模型生成查询和文档片段的向量表示并通过相似度计算如余弦相似度匹配最相关的文档片段。RAG的检索器不仅仅依赖简单的关键词匹配而是采用语义级别的向量表示从而在面对复杂问题或模糊查询时能够更加准确地找到相关知识。这一步骤对于最终生成的回答至关重要因为检索的效率和质量直接决定了生成器可利用的上下文信息 。
## 3.2 生成阶段
生成阶段是RAG模型的核心部分生成器负责基于检索到的内容生成连贯且自然的文本回答。RAG中的生成器如BART或GPT等模型结合用户输入的查询和检索到的文档片段生成更加精准且丰富的答案。与传统生成模型相比RAG的生成器不仅能够生成语言流畅的回答还可以根据外部知识库中的实际信息提供更具事实依据的内容从而提高了生成的准确性 。
## 3.3 多轮交互与反馈机制
RAG模型在对话系统中能够有效支持多轮交互。每一轮的查询和生成结果会作为下一轮的输入系统通过分析和学习用户的反馈逐步优化后续查询的上下文。通过这种循环反馈机制RAG能够更好地调整其检索和生成策略使得在多轮对话中生成的答案越来越符合用户的期望。此外多轮交互还增强了RAG在复杂对话场景中的适应性使其能够处理跨多轮的知识整合和复杂推理 。
# 4. RAG的优势与局限
## 4.1 优势
- 信息完整性RAG 模型结合了检索与生成技术使得生成的文本不仅语言自然流畅还能够准确利用外部知识库提供的实时信息。这种方法能够显著提升生成任务的准确性特别是在知识密集型场景下如医疗问答或法律意见生成。通过从知识库中检索相关文档RAG 模型避免了生成模型“编造”信息的风险,确保输出更具真实性 。
- 知识推理能力RAG 能够利用大规模的外部知识库进行高效检索并结合这些真实数据进行推理生成基于事实的答案。相比传统生成模型RAG 能处理更为复杂的任务特别是涉及跨领域或跨文档的推理任务。例如法律领域的复杂判例推理或金融领域的分析报告生成都可以通过RAG的推理能力得到优化 。
- 领域适应性强RAG 具有良好的跨领域适应性能够根据不同领域的知识库进行特定领域内的高效检索和生成。例如在医疗、法律、金融等需要实时更新和高度准确性的领域RAG 模型的表现优于仅依赖预训练的生成模型 。
## 4.2 局限
RAG检索增强生成模型通过结合检索器和生成器实现了在多种任务中知识密集型内容生成的突破性进展。然而尽管其具有较强的应用潜力和跨领域适应能力但在实际应用中仍然面临着一些关键局限限制了其在大规模系统中的部署和优化。以下是RAG模型的几个主要局限性
#### 4.2.1 检索器的依赖性与质量问题
RAG模型的性能很大程度上取决于检索器返回的文档质量。由于生成器主要依赖检索器提供的上下文信息如果检索到的文档片段不相关、不准确生成的文本可能出现偏差甚至产生误导性的结果。尤其在多模糊查询或跨领域检索的情况下检索器可能无法找到合适的片段这将直接影响生成内容的连贯性和准确性。
- 挑战当知识库庞大且内容多样时如何提高检索器在复杂问题下的精确度是一大挑战。当前的方法如BM25等在特定任务上有局限尤其是在面对语义模糊的查询时传统的关键词匹配方式可能无法提供语义上相关的内容。
- 解决途径引入混合检索技术如结合稀疏检索BM25与密集检索如向量检索。例如[Faiss](https://fael3z0zfze.feishu.cn/wiki/LULawsUufitGvWkDjx3cKJqHnle?from=from_copylink)的底层实现允许通过BERT等模型生成密集向量表示显著提升语义级别的匹配效果。通过这种方式检索器可以捕捉深层次的语义相似性减少无关文档对生成器的负面影响。
#### 4.2.2 生成器的计算复杂度与性能瓶颈
RAG模型将检索和生成模块结合尽管生成结果更加准确但也大大增加了模型的计算复杂度。尤其在处理大规模数据集或长文本时生成器需要处理来自多个文档片段的信息导致生成时间明显增加推理速度下降。对于实时问答系统或其他需要快速响应的应用场景这种高计算复杂度是一个主要瓶颈。
- 挑战当知识库规模扩大时检索过程中的计算开销以及生成器在多片段上的整合能力都会显著影响系统的效率。同时生成器也面临着资源消耗的问题尤其是在多轮对话或复杂生成任务中GPU和内存的消耗会成倍增加。
- 解决途径:使用模型压缩技术和知识蒸馏来减少生成器的复杂度和推理时间。此外,分布式计算与模型并行化技术的引入,如[DeepSpeed](https://www.deepspeed.ai/)和模型压缩工具,可以有效应对生成任务的高计算复杂度,提升大规模应用场景中的推理效率。
#### 4.2.3 知识库的更新与维护
RAG模型通常依赖于一个预先建立的外部知识库该知识库可能包含文档、论文、法律条款等各类信息。然而知识库内容的时效性和准确性直接影响到RAG生成结果的可信度。随着时间推移知识库中的内容可能过时导致生成的回答不能反映最新的信息。这对于需要实时信息的场景如医疗、金融尤其明显。
- 挑战:知识库需要频繁更新,但手动更新知识库既耗时又容易出错。如何在不影响系统性能的情况下实现知识库的持续自动更新是当前的一大挑战。
- 解决途径利用自动化爬虫和信息提取系统可以实现对知识库的自动化更新例如Scrapy等爬虫框架可以自动抓取网页数据并更新知识库。结合[动态索引技术](https://arxiv.org/pdf/2102.03315),可以帮助检索器实时更新索引,确保知识库反映最新信息。同时,结合增量学习技术,生成器可以逐步吸收新增的信息,避免生成过时答案。此外,动态索引技术也可以帮助检索器实时更新索引,确保知识库检索到的文档反映最新的内容。
#### 4.2.4 生成内容的可控性与透明度
RAG模型结合了检索与生成模块在生成内容的可控性和透明度上存在一定问题。特别是在复杂任务或多义性较强的用户输入情况下生成器可能会基于不准确的文档片段生成错误的推理导致生成的答案偏离实际问题。此外由于RAG模型的“黑箱”特性用户难以理解生成器如何利用检索到的文档信息这在高敏感领域如法律或医疗中尤为突出可能导致用户对生成内容产生不信任感。
- 挑战:模型透明度不足使得用户难以验证生成答案的来源和可信度。对于需要高可解释性的任务(如医疗问诊、法律咨询等),无法追溯生成答案的知识来源会导致用户不信任模型的决策。
- 解决途径为提高透明度可以引入可解释性AIXAI技术如LIME或SHAP[链接](https://github.com/marcotcr/lime)),为每个生成答案提供详细的溯源信息,展示所引用的知识片段。这种方法能够帮助用户理解模型的推理过程,从而增强对模型输出的信任。此外,针对生成内容的控制,可以通过加入规则约束或用户反馈机制,逐步优化生成器的输出,确保生成内容更加可信。
# 5. RAG整体改进方向
RAG模型的整体性能依赖于知识库的准确性和检索的效率因此在数据采集、内容分块、精准检索和回答生成等环节进行优化是提升模型效果的关键。通过加强数据来源、改进内容管理、优化检索策略及提升回答生成的准确性RAG模型能够更加适应复杂且动态的实际应用需求。
## 5.1 数据采集与知识库构建
RAG模型的核心依赖在于知识库的数据质量和广度知识库在某种程度上充当着“外部记忆”的角色。因此高质量的知识库不仅应包含广泛领域的内容更要确保数据来源的权威性、可靠性以及时效性。知识库的数据源应涵盖多种可信的渠道例如科学文献数据库如PubMed、IEEE Xplore、权威新闻媒体、行业标准和报告等这样才能提供足够的背景信息支持RAG在不同任务中的应用。此外为了确保RAG模型能够提供最新的回答知识库需要具备自动化更新的能力以避免数据内容老旧导致回答失准或缺乏现实参考。
- 挑战:
- 尽管数据采集是构建知识库的基础,但在实际操作中仍存在以下几方面的不足:
- 数据采集来源单一或覆盖不全
1. RAG模型依赖多领域数据的支持然而某些知识库过度依赖单一或有限的数据源通常集中在某些领域导致在多任务需求下覆盖不足。例如依赖医学领域数据而缺乏法律和金融数据会使RAG模型在跨领域问答中表现不佳。这种局限性削弱了RAG模型在处理不同主题或多样化查询时的准确性使得系统在应对复杂或跨领域任务时能力欠缺。
- 数据质量参差不齐
1. 数据源的质量差异直接影响知识库的可靠性。一些数据可能来源于非权威或低质量渠道存在偏见、片面或不准确的内容。这些数据若未经筛选录入知识库会导致RAG模型生成偏差或不准确的回答。例如在医学领域中如果引入未经验证的健康信息可能导致模型给出误导性回答产生负面影响。数据质量不一致的知识库会大大降低模型输出的可信度和适用性。
- 缺乏定期更新机制
1. 许多知识库缺乏自动化和频繁的更新机制特别是在信息变动频繁的领域如法律、金融和科技。若知识库长期未更新则RAG模型无法提供最新信息生成的回答可能过时或不具备实时参考价值。对于用户而言特别是在需要实时信息的场景下滞后的知识库会显著影响RAG模型的可信度和用户体验。
- 数据处理耗时且易出错
1. 数据的采集、清洗、分类和结构化处理是一项繁琐而复杂的任务尤其是当数据量巨大且涉及多种格式时。通常大量数据需要人工参与清洗和结构化而自动化处理流程也存在缺陷可能会产生错误或遗漏关键信息。低效和易出错的数据处理流程会导致知识库内容不准确、不完整进而影响RAG模型生成的答案的准确性和连贯性。
- 数据敏感性和隐私问题
1. 一些特定领域的数据(如医疗、法律、金融)包含敏感信息,未经适当的隐私保护直接引入知识库可能带来隐私泄露的风险。此外,某些敏感数据需要严格的授权和安全存储,以确保在知识库使用中避免违规或隐私泄漏。若未能妥善处理数据隐私问题,不仅会影响系统的合规性,还可能对用户造成严重后果。
- 改进:
- 针对以上不足,可以从以下几个方面进行改进,以提高数据采集和知识库构建的有效性:
- 扩大数据源覆盖范围,增加数据的多样性
1. 具体实施将知识库的数据源扩展至多个重要领域确保包含医疗、法律、金融等关键领域的专业数据库如PubMed、LexisNexis和金融数据库。使用具有开放许可的开源数据库和经过认证的数据确保来源多样化且权威性强。
2. 目的与效果通过跨领域数据覆盖知识库的广度和深度得以增强确保RAG模型能够在多任务场景下提供可靠回答。借助多领域合作机构的数据支持在应对多样化需求时将更具优势。
- 构建数据质量审查与过滤机制
1. 具体实施:采用自动化数据质量检测算法,如文本相似度检查、情感偏差检测等工具,结合人工审查过滤不符合标准的数据。为数据打分并构建“数据可信度评分”,基于来源可信度、内容完整性等指标筛选数据。
2. 目的与效果减少低质量、偏见数据的干扰确保知识库内容的可靠性。此方法保障了RAG模型输出的权威性特别在回答复杂或专业问题时用户能够获得更加精准且中立的答案。
- 实现知识库的自动化更新
1. 具体实施:引入自动化数据更新系统,如网络爬虫,定期爬取可信站点、行业数据库的最新数据,并利用变化检测算法筛选出与已有知识库重复或已失效的数据。更新机制可以结合智能筛选算法,仅采纳与用户查询高相关性或时效性强的数据。
2. 目的与效果:知识库保持及时更新,确保模型在快速变化的领域(如金融、政策、科技)中提供最新信息。用户体验将因此大幅提升,特别是在需要动态或最新信息的领域,输出的内容将更具时效性。
- 采用高效的数据清洗与分类流程
1. 具体实施使用自然语言处理技术如BERT等模型进行数据分类、实体识别和文本去噪结合去重算法清理重复内容。采用自动化的数据标注和分类算法将不同数据类型分领域存储。
2. 目的与效果数据清洗和分领域管理可以大幅提高数据处理的准确性减少低质量数据的干扰。此改进确保RAG模型的回答生成更流畅、上下文更连贯提升用户对生成内容的理解和信赖。
- 强化数据安全与隐私保护措施
1. 具体实施:针对医疗、法律等敏感数据,采用去标识化处理技术(如数据脱敏、匿名化等),并结合差分隐私保护。建立数据权限管理和加密存储机制,对敏感信息进行严格管控。
2. 目的与效果:在保护用户隐私的前提下,确保使用的数据合规、安全,适用于涉及个人或敏感数据的应用场景。此措施进一步保证了系统的法律合规性,并有效防止隐私泄露风险。
- 优化数据格式与结构的标准化
1. 具体实施建立统一的数据格式与标准编码格式例如使用JSON、XML或知识图谱形式组织结构化数据以便于检索系统在查询时高效利用。同时使用知识图谱等结构化工具将复杂数据间的关系进行系统化存储。
2. 目的与效果提高数据检索效率确保模型在生成回答时能够高效使用数据的关键信息。标准化的数据结构支持高效的跨领域检索并提高了RAG模型的内容准确性和知识关系的透明度。
- 用户反馈机制
1. 具体实施:通过用户反馈系统,记录用户对回答的满意度、反馈意见及改进建议。使用机器学习算法从反馈中识别知识库中的盲区与信息误差,反馈至数据管理流程中进行更新和优化。
2. 目的与效果利用用户反馈作为数据质量的调整依据帮助知识库持续优化内容。此方法不仅提升了RAG模型的实际效用还使知识库更贴合用户需求确保输出内容始终符合用户期望。
## 5.2 数据分块与内容管理
RAG模型的数据分块与内容管理是优化检索与生成流程的关键。合理的分块策略能够帮助模型高效定位目标信息并在回答生成时提供清晰的上下文支持。通常情况下将数据按段落、章节或主题进行分块不仅有助于检索效率的提升还能避免冗余数据对生成内容造成干扰。尤其在复杂、长文本中适当的分块策略可保证模型生成的答案具备连贯性、精确性避免出现内容跳跃或上下文断裂的问题。
- 挑战:
- 在实际操作中,数据分块与内容管理环节存在以下问题:
- 分块不合理导致的信息断裂
1. 部分文本过度切割或分块策略不合理,可能导致信息链条被打断,使得模型在回答生成时缺乏必要的上下文支持。这会使生成内容显得零散,不具备连贯性,影响用户对答案的理解。例如,将法律文本或技术文档随意切割成小段落会导致重要的上下文关系丢失,降低模型的回答质量。
- 冗余数据导致生成内容重复或信息过载
1. 数据集中往往包含重复信息,若不去重或优化整合,冗余数据可能导致生成内容的重复或信息过载。这不仅影响用户体验,还会浪费计算资源。例如,在新闻数据或社交媒体内容中,热点事件的描述可能重复出现,模型在生成回答时可能反复引用相同信息。
- 分块粒度选择不当影响检索精度
1. 如果分块粒度过细,模型可能因缺乏足够的上下文而生成不准确的回答;若分块过大,检索时将难以定位具体信息,导致回答内容冗长且含有无关信息。选择适当的分块粒度对生成答案的准确性和相关性至关重要,特别是在问答任务中需要精确定位答案的情况下,粗放的分块策略会明显影响用户的阅读体验和回答的可读性。
- 难以实现基于主题或内容逻辑的分块
1. 某些复杂文本难以直接按主题或逻辑结构进行分块,尤其是内容密集或领域专业性较强的数据。基于关键字或简单的规则切割往往难以识别不同主题和信息层次,导致模型在回答生成时信息杂乱。对内容逻辑或主题的错误判断,尤其是在医学、金融等场景下,会大大影响生成答案的准确度和专业性。
- 改进:
- 为提高数据分块和内容管理的有效性,可以从以下几方面进行优化:
- 引入NLP技术进行自动化分块和上下文分析
1. 具体实施借助自然语言处理NLP技术通过句法分析、语义分割等方式对文本进行逻辑切割以确保分块的合理性。可以基于BERT等预训练模型实现主题识别和上下文分析确保每个片段均具备完整的信息链避免信息断裂。
2. 目的与效果:确保文本切割基于逻辑或语义关系,避免信息链条被打断,生成答案时能够更具连贯性,尤其适用于长文本和复杂结构的内容,使模型在回答时上下文更加完整、连贯。
- 去重与信息整合,优化内容简洁性
1. 具体实施利用相似度算法如TF-IDF、余弦相似度识别冗余内容并结合聚类算法自动合并重复信息。针对内容频繁重复的情况可设置内容标记或索引避免生成时多次引用相同片段。
2. 目的与效果:通过去重和信息整合,使数据更具简洁性,避免生成答案中出现重复信息。减少冗余信息的干扰,使用户获得简明扼要的回答,增强阅读体验,同时提升生成过程的计算效率。
- 根据任务需求动态调整分块粒度
1. 具体实施:根据模型任务的不同,设置动态分块策略。例如,在问答任务中对关键信息较短的内容可采用小粒度分块,而在长文本或背景性内容中采用较大粒度。分块策略可基于查询需求或内容复杂度自动调整。
2. 目的与效果:分块粒度的动态调整确保模型在检索和生成时既能准确定位关键内容,又能为回答提供足够的上下文支持,提升生成内容的精准性和相关性,确保用户获取的信息既准确又不冗长。
- 引入基于主题的分块方法以提升上下文完整性
1. 具体实施使用主题模型如LDA或嵌入式文本聚类技术对文本内容按主题进行自动分类与分块。基于相同主题内容的聚合分块有助于模型识别不同内容层次尤其适用于复杂的学术文章或多章节的长篇报告。
2. 目的与效果:基于主题的分块确保同一主题的内容保持在一个片段内,提升模型在回答生成时的上下文连贯性。适用于主题复杂、层次清晰的内容场景,提高回答的专业性和条理性,使用户更容易理解生成内容的逻辑关系。
- 实时评估分块策略与内容呈现效果的反馈机制
1. 具体实施:通过用户反馈机制和生成质量评估系统实时监测生成内容的连贯性和准确性。对用户反馈中涉及分块效果差的部分进行重新分块,通过用户使用数据优化分块策略。
2. 目的与效果:用户反馈帮助识别不合理的分块和内容呈现问题,实现分块策略的动态优化,持续提升生成内容的质量和用户满意度。
## 5.3 检索优化
在RAG模型中检索模块决定了生成答案的相关性和准确性。有效的检索策略可确保模型获取到最适合的上下文片段使生成的回答更加精准且贴合查询需求。常用的混合检索策略如BM25和DPR结合能够在关键词匹配和语义检索方面实现优势互补BM25适合高效地处理关键字匹配任务而DPR在理解深层语义上表现更为优异。因此合理选用检索策略有助于在不同任务场景下达到计算资源和检索精度的平衡以高效提供相关上下文供生成器使用。
- 挑战:
- 检索优化过程中,仍面临以下不足之处:
- 检索策略单一导致的回答偏差
1. 当仅依赖BM25或DPR等单一技术时模型可能难以平衡关键词匹配与语义理解。BM25在处理具象关键字时表现良好但在面对复杂、含义丰富的语义查询时效果欠佳相反DPR虽然具备深度语义匹配能力但对高频关键词匹配的敏感度较弱。检索策略单一将导致模型难以适应复杂的用户查询回答中出现片面性或不够精准的情况。
- 检索效率与资源消耗的矛盾
1. 检索模块需要在短时间内处理大量查询而语义检索如DPR需要进行大量的计算和存储操作计算资源消耗高影响系统响应速度。特别是对于需要实时响应的应用场景DPR的计算复杂度往往难以满足实际需求因此在实时性和资源利用率上亟需优化。
- 检索结果的冗余性导致内容重复
1. 当检索策略未对结果进行去重或排序优化时RAG模型可能从知识库中检索出相似度高但内容冗余的文档片段。这会导致生成的回答中包含重复信息影响阅读体验同时增加无效信息的比例使用户难以迅速获取核心答案。
- 不同任务需求下检索策略的适配性差
1. RAG模型应用场景丰富但不同任务对检索精度、速度和上下文长度的需求不尽相同。固定检索策略难以灵活应对多样化的任务需求导致在应对不同任务时模型检索效果受限。例如面向精确性较高的医疗问答场景时检索策略应偏向语义准确性而在热点新闻场景中则应偏重检索速度。
- 改进:
- 针对上述不足,可以从以下几个方面优化检索模块:
- 结合BM25与DPR的混合检索策略
1. 具体实施采用BM25进行关键词初筛快速排除无关信息然后使用DPR进行深度语义匹配筛选。这样可以有效提升检索精度平衡关键词匹配和语义理解。
2. 目的与效果:通过多层筛选过程,确保检索结果在语义理解和关键词匹配方面互补,提升生成内容的准确性,特别适用于多意图查询或复杂的长文本检索。
- 优化检索效率,控制计算资源消耗
1. 具体实施利用缓存机制存储近期高频查询结果避免对相似查询的重复计算。同时可基于分布式计算结构将DPR的语义计算任务分散至多节点并行处理。
2. 目的与效果:缓存与分布式计算结合可显著减少检索计算压力,使系统能够在有限资源下提高响应速度,适用于高并发、实时性要求高的应用场景。
- 引入去重和排序优化算法
1. 具体实施:在检索结果中应用余弦相似度去重算法,筛除冗余内容,并基于用户偏好或时间戳对检索结果排序,以确保输出内容的丰富性和新鲜度。
2. 目的与效果:通过去重和优化排序,确保生成内容更加简洁、直接,减少重复信息的干扰,提高用户获取信息的效率和体验。
- 动态调整检索策略适应多任务需求
1. 具体实施:设置不同检索策略模板,根据任务类型自动调整检索权重、片段长度和策略组合。例如在医疗场景中偏向语义检索,而在金融新闻场景中更重视快速关键词匹配。
2. 目的与效果动态调整检索策略使RAG模型更加灵活能够适应不同任务需求确保检索的精准性和生成答案的上下文适配性显著提升多场景下的用户体验。
- 借助Haystack等检索优化框架
1. 具体实施在RAG模型中集成Haystack框架以实现更高效的检索效果并利用框架中的插件生态系统来增强检索模块的可扩展性和可调节性。
2. 目的与效果Haystack提供了检索和生成的整合接口有助于快速优化检索模块并适应复杂多样的用户需求在多任务环境中提供更稳定的性能表现。
## 5.4 回答生成与优化
在RAG模型中生成器负责基于检索模块提供的上下文为用户查询生成自然语言答案。生成内容的准确性和逻辑性直接决定了用户的体验因此优化生成器的表现至关重要。通过引入知识图谱等结构化信息生成器能够更准确地理解和关联上下文从而生成逻辑连贯、准确的回答。此外生成器的生成逻辑可结合用户反馈持续优化使回答风格和内容更加符合用户需求。
- 挑战:
- 在回答生成过程中RAG模型仍面临以下不足
- 上下文不充分导致的逻辑不连贯
1. 当生成器在上下文缺失或信息不完整的情况下生成回答时,生成内容往往不够连贯,特别是在处理复杂、跨领域任务时。这种缺乏上下文支持的问题,容易导致生成器误解或忽略关键信息,最终生成内容的逻辑性和完整性欠佳。如在医学场景中,若生成器缺少对病例或症状的全面理解,可能导致回答不准确或不符合逻辑,影响专业性和用户信任度。
- 专业领域回答的准确性欠佳
1. 在医学、法律等高专业领域中,生成器的回答需要高度的准确性。然而,生成器可能因缺乏特定知识而生成不符合领域要求的回答,出现内容偏差或理解错误,尤其在涉及专业术语和复杂概念时更为明显。如在法律咨询中,生成器可能未能正确引用相关法条或判例,导致生成的答案不够精确,甚至可能产生误导。
- 难以有效整合多轮用户反馈
1. 生成器缺乏有效机制来利用多轮用户反馈进行自我优化。用户反馈可能涉及回答内容的准确性、逻辑性以及风格适配等方面,但生成器在连续对话中缺乏充分的调节机制,难以持续调整生成策略和回答风格。如在客服场景中,生成器可能连续生成不符合用户需求的回答,降低了用户满意度。
- 生成内容的可控性和一致性不足
1. 在特定领域回答生成中,生成器的输出往往不具备足够的可控性和一致性。由于缺乏领域特定的生成规则和约束,生成内容的专业性和风格一致性欠佳,难以满足高要求的应用场景。如在金融报告生成中,生成内容需要确保一致的风格和术语使用,否则会影响输出的专业性和可信度。
- 改进:
- 针对以上不足,可以从以下方面优化回答生成模块:
- 引入知识图谱与结构化数据,增强上下文理解
1. 具体实施:结合知识图谱或知识库,将医学、法律等专业领域的信息整合到生成过程中。生成器在生成回答时,可以从知识图谱中提取关键信息和关联知识点,确保回答具备连贯的逻辑链条。
2. 目的与效果:知识图谱的引入提升了生成内容的连贯性和准确性,尤其在高专业性领域中,通过丰富的上下文理解,使生成器能够产生符合逻辑的回答。
- 设计专业领域特定的生成规则和约束
1. 具体实施:在生成模型中加入领域特定的生成规则和用语约束,特别针对医学、法律等领域的常见问答场景,设定回答模板、术语库等,以提高生成内容的准确性和一致性。
2. 目的与效果:生成内容更具领域特征,输出风格和内容的专业性增强,有效降低了生成器在专业领域中的回答偏差,满足用户对专业性和可信度的要求。
- 优化用户反馈机制,实现动态生成逻辑调整
1. 具体实施:利用机器学习算法对用户反馈进行分析,从反馈中提取生成错误或用户需求的调整信息,动态调节生成器的生成逻辑和策略。同时,在多轮对话中逐步适应用户的需求和风格偏好。
2. 目的与效果:用户反馈的高效利用能够帮助生成器优化生成内容,提高连续对话中的响应质量,提升用户体验,并使回答更贴合用户需求。
- 引入生成器与检索器的协同优化机制
1. 具体实施:通过协同优化机制,在生成器生成答案之前,允许生成器请求检索器补充缺失的上下文信息。生成器可基于回答需求自动向检索器发起上下文补充请求,从而获取完整的上下文。
2. 目的与效果:协同优化机制保障了生成器在回答时拥有足够的上下文支持,避免信息断层或缺失,提升回答的完整性和准确性。
- 实施生成内容的一致性检测和语义校正
1. 具体实施:通过一致性检测算法对生成内容进行术语、风格的统一管理,并结合语义校正模型检测生成内容是否符合用户需求的逻辑结构。在复杂回答生成中,使用语义校正对不符合逻辑的生成内容进行自动优化。
2. 目的与效果:生成内容具备高度一致性和逻辑性,特别是在多轮对话和专业领域生成中,保障了内容的稳定性和专业水准,提高了生成答案的可信度和用户满意度。
## 5.5 RAG流程
![](/imgs/RAG1.png)
1. 数据加载与查询输入:
1. 用户通过界面或API提交自然语言查询系统接收查询作为输入。
2. 输入被传递至向量化器利用向量化技术如BERT或Sentence Transformer将自然语言查询转换为向量表示。
2. 文档检索:
1. 向量化后的查询会传递给检索器,检索器通过在知识库中查找最相关的文档片段。
2. 检索可以基于稀疏检索技术如BM25或密集检索技术如DPR来提高匹配效率和精度。
3. 生成器处理与自然语言生成:
1. 检索到的文档片段作为生成器的输入生成器如GPT、BART或T5基于查询和文档内容生成自然语言回答。
2. 生成器结合了外部检索结果和预训练模型的语言知识,使回答更加精准、自然。
4. 结果输出:
1. 系统生成的答案通过API或界面返回给用户确保答案连贯且知识准确。
5. 反馈与优化:
1. 用户可以对生成的答案进行反馈,系统根据反馈优化检索与生成过程。
2. 通过微调模型参数或调整检索权重,系统逐步改进其性能,确保未来查询时更高的准确性与效率。
# 6. RAG相关案例整合
[各种分类领域下的RAG](https://github.com/hymie122/RAG-Survey)
# 7. RAG模型的应用
RAG模型已在多个领域得到广泛应用主要包括
## 7.1 智能问答系统中的应用
- RAG通过实时检索外部知识库生成包含准确且详细的答案避免传统生成模型可能产生的错误信息。例如在医疗问答系统中RAG能够结合最新的医学文献生成包含最新治疗方案的准确答案避免生成模型提供过时或错误的建议。这种方法帮助医疗专家快速获得最新的研究成果和诊疗建议提升医疗决策的质量。
- [医疗问答系统案例](https://www.apexon.com/blog/empowering-discovery-the-role-of-rag-architecture-generative-ai-in-healthcare-life-sciences/)
- ![](/imgs/RAG2.png)
- 用户通过Web应用程序发起查询
1. 用户在一个Web应用上输入查询请求这个请求进入后端系统启动了整个数据处理流程。
- 使用Azure AD进行身份验证
1. 系统通过Azure Active Directory (Azure AD) 对用户进行身份验证,确保只有经过授权的用户才能访问系统和数据。
- 用户权限检查:
1. 系统根据用户的组权限由Azure AD管理过滤用户能够访问的内容。这个步骤保证了用户只能看到他们有权限查看的信息。
- Azure AI搜索服务
1. 过滤后的用户查询被传递给Azure AI搜索服务该服务会在已索引的数据库或文档中查找与查询相关的内容。这个搜索引擎通过语义搜索技术检索最相关的信息。
- 文档智能处理:
1. 系统使用OCR光学字符识别和文档提取等技术处理输入的文档将非结构化数据转换为结构化、可搜索的数据便于Azure AI进行检索。
- 文档来源:
1. 这些文档来自预先存储的输入文档集合,这些文档在被用户查询之前已经通过文档智能处理进行了准备和索引。
- Azure Open AI生成响应
1. 在检索到相关信息后数据会被传递到Azure Open AI该模块利用自然语言生成NLG技术根据用户的查询和检索结果生成连贯的回答。
- 响应返回用户:
1. 最终生成的回答通过Web应用程序返回给用户完成整个查询到响应的流程。
- 整个流程展示了Azure AI技术的集成通过文档检索、智能处理以及自然语言生成来处理复杂的查询并确保了数据的安全和合规性。
## 7.2 信息检索与文本生成
- 文本生成RAG不仅可以检索相关文档还能根据这些文档生成总结、报告或文档摘要从而增强生成内容的连贯性和准确性。例如法律领域中RAG可以整合相关法条和判例生成详细的法律意见书确保内容的全面性和严谨性。这在法律咨询和文件生成过程中尤为重要可以帮助律师和法律从业者提高工作效率。
- [法律领域检索增强生成案例](https://www.apexon.com/blog/empowering-discovery-the-role-of-rag-architecture-generative-ai-in-healthcare-life-sciences/)
- 内容总结:
- 背景: 传统的大语言模型 (LLMs) 在生成任务中表现优异但在处理法律领域中的复杂任务时存在局限。法律文档具有独特的结构和术语标准的检索评估基准往往无法充分捕捉这些领域特有的复杂性。为了弥补这一不足LegalBench-RAG 旨在提供一个评估法律文档检索效果的专用基准。
- LegalBench-RAG 的结构:
1. ![](/imgs/RAG3.png)
2. 工作流程:
3. 用户输入问题Q: ?A: ?):用户通过界面输入查询问题,提出需要答案的具体问题。
4. 嵌入与检索模块Embed + Retrieve该模块接收到用户的查询后会对问题进行嵌入将其转化为向量并在外部知识库或文档中执行相似度检索。通过检索算法系统找到与查询相关的文档片段或信息。
5. 生成答案A基于检索到的最相关信息生成模型如GPT或类似的语言模型根据检索的结果生成连贯的自然语言答案。
6. 对比和返回结果:生成的答案会与之前的相关问题答案进行对比,并最终将生成的答案返回给用户。
7. 该基准基于 LegalBench 的数据集,构建了 6858 个查询-答案对,并追溯到其原始法律文档的确切位置。
8. LegalBench-RAG 侧重于精确地检索法律文本中的小段落,而非宽泛的、上下文不相关的片段。
9. 数据集涵盖了合同、隐私政策等不同类型的法律文档,确保涵盖多个法律应用场景。
- 意义: LegalBench-RAG 是第一个专门针对法律检索系统的公开可用的基准。它为研究人员和公司提供了一个标准化的框架,用于比较不同的检索算法的效果,特别是在需要高精度的法律任务中,例如判决引用、条款解释等。
- 关键挑战:
1. RAG 系统的生成部分依赖检索到的信息,错误的检索结果可能导致错误的生成输出。
2. 法律文档的长度和术语复杂性增加了模型检索和生成的难度。
- 质量控制: 数据集的构建过程确保了高质量的人工注释和文本精确性特别是在映射注释类别和文档ID到具体文本片段时进行了多次人工校验。
## 7.3 其它应用场景
RAG还可以应用于多模态生成场景如图像、音频和3D内容生成。例如跨模态应用如ReMoDiffuse和Make-An-Audio利用RAG技术实现不同数据形式的生成。此外在企业决策支持中RAG能够快速检索外部资源如行业报告、市场数据生成高质量的前瞻性报告从而提升企业战略决策的能力。
## 8 总结
本文档系统阐述了检索增强生成RAG模型的核心机制、优势与应用场景。通过结合生成模型与检索模型RAG解决了传统生成模型在面对事实性任务时的“编造”问题和检索模型难以生成连贯自然语言输出的不足。RAG模型能够实时从外部知识库获取信息使生成内容既包含准确的知识又具备流畅的语言表达适用于医疗、法律、智能问答系统等多个知识密集型领域。
在应用实践中RAG模型虽然有着信息完整性、推理能力和跨领域适应性等显著优势但也面临着数据质量、计算资源消耗和知识库更新等挑战。为进一步提升RAG的性能提出了针对数据采集、内容分块、检索策略优化以及回答生成的全面改进措施如引入知识图谱、优化用户反馈机制、实施高效去重算法等以增强模型的适用性和效率。
RAG在智能问答、信息检索与文本生成等领域展现了出色的应用潜力并在不断发展的技术支持下进一步拓展至多模态生成和企业决策支持等场景。通过引入混合检索技术、知识图谱以及动态反馈机制RAG能够更加灵活地应对复杂的用户需求生成具有事实支撑和逻辑连贯性的回答。未来RAG将通过增强模型透明性与可控性进一步提升在专业领域中的可信度和实用性为智能信息检索与内容生成提供更广泛的应用空间。

View File

@@ -60,6 +60,8 @@ Tips: 可以通过点击上下文按键查看完整的上下文组成,便于
### 引用模板和提示词设计
简易模式已移除该功能,仅在工作流中可配置,可点击工作流中`AI对话节点`内,知识库引用旁边的`setting icon`进行配置。随着模型的增强,这部分功能将逐步弱化。
引用模板和引用提示词通常是成对出现,引用提示词依赖引用模板。
FastGPT 知识库采用 QA 对(不一定都是问答格式,仅代表两个变量)的格式存储,在转义成字符串时候会根据**引用模板**来进行格式化。知识库包含多个可用变量: q, a, sourceId数据的ID, index(第n个数据), source(数据的集合名、文件名)score(距离得分0-1) 可以通过 {{q}} {{a}} {{sourceId}} {{index}} {{source}} {{score}} 按需引入。下面一个模板例子:

View File

@@ -4,7 +4,7 @@ description: "FastGPT 对话问题引导"
icon: "code"
draft: false
toc: true
weight: 350
weight: 108
---
![](/imgs/questionGuide.png)

View File

@@ -0,0 +1,50 @@
---
title: "知识库集合标签"
description: "FastGPT 知识库集合标签使用说明"
icon: "developer_guide"
draft: false
toc: true
weight: 109
---
知识库集合标签是 FastGPT 商业版特有功能。它允许你对知识库中的数据集合添加标签进行分类,更高效地管理知识库数据。
而进一步可以在问答中,搜索知识库时添加集合过滤,实现更精确的搜索。
| | | |
| --------------------- | --------------------- | --------------------- |
| ![](/imgs/collection-tags-1.png) | ![](/imgs/collection-tags-2.png) | ![](/imgs/collection-tags-3.png) |
## 标签基础操作说明
在知识库详情页面,可以对标签进行管理,可执行的操作有
- 创建标签
- 修改标签名
- 删除标签
- 将一个标签赋给多个数据集合
- 给一个数据集合添加多个标签
也可以利用标签对数据集合进行筛选
## 知识库搜索-集合过滤说明
利用标签可以在知识库搜索时,通过填写「集合过滤」这一栏来实现更精确的搜索,具体的填写示例如下
```json
{
"tags": {
"$and": ["标签 1","标签 2"],
"$or": ["有 $and 标签时and 生效or 不生效"]
},
"createTime": {
"$gte": "YYYY-MM-DD HH:mm 格式即可,集合的创建时间大于该时间",
"$lte": "YYYY-MM-DD HH:mm 格式即可,集合的创建时间小于该时间,可和 $gte 共同使用"
}
}
```
在填写时有两个注意的点,
- 标签值可以为 `string` 类型的标签名,也可以为 `null`,而 `null` 代表着未设置标签的数据集合
- 标签过滤有 `$and``$or` 两种条件类型,在同时设置了 `$and``$or` 的情况下,只有 `$and` 会生效

View File

@@ -42,7 +42,7 @@ FastGPT 采用了 RAG 中的 Embedding 方案构建知识库,要使用好 Fast
FastGPT 采用了`PostgresSQL``PG Vector`插件作为向量检索器,索引为`HNSW`。且`PostgresSQL`仅用于向量检索(该引擎可以替换成其它数据库),`MongoDB`用于其他数据的存取。
`MongoDB``dataset.datas`表中,会存储向量原数据的信息,同时有一个`indexes`字段会记录其对应的向量ID这是一个数组也就是说一组向量可以对应多组数据
`MongoDB``dataset.datas`表中,会存储向量原数据的信息,同时有一个`indexes`字段会记录其对应的向量ID这是一个数组也就是说一组数据可以对应多个向量
`PostgresSQL`的表中,设置一个`vector`字段用于存储向量。在检索时会先召回向量再根据向量的ID`MongoDB`中寻找原数据内容,如果对应了同一组原数据,则进行合并,向量得分取最高得分。

View File

@@ -0,0 +1,97 @@
---
title: "接入飞书机器人教程"
description: "FastGPT 接入飞书机器人教程"
icon: "chat"
draft: false
toc: true
weight: 111
---
从 4.8.10 版本起FastGPT 商业版支持直接接入飞书机器人,无需额外的 API。
## 1. 申请飞书应用
开一个免费的测试企业更方便进行调试。
1. 在[飞书开放平台](https://open.feishu.cn/app)的开发者后台申请企业自建应用。
![图片](/imgs/feishu-bot-1.png)
添加一个**机器人**应用。
## 2. 在 FastGPT 新建发布渠道
在fastgpt中选择想要接入的应用在 发布渠道 页面,新建一个接入飞书机器人的发布渠道,填写好基础信息。
![图片](/imgs/feishu-bot-2.png)
## 3. 获取应用的 App ID, App Secret 两个凭证
在飞书开放平台开发者后台,刚刚创建的企业自建应用中,找到 App ID 和 App Secret填入 FastGPT 新建发布渠道的对话框里面。
![图片](/imgs/feishu-bot-3.png)
填入两个参数到 FastGPT 配置弹窗中。
![图片](/imgs/feishu-bot-4.png)
(可选)在飞书开放平台开发者后台,点击事件与回调 -> 加密策略 获取 Encrypt Key并填入飞书机器人接入的对话框里面
![图片](/imgs/feishu-bot-5.png)
Encrypt Key 用于加密飞书服务器与 FastGPT 之间通信。
建议如果使用 Https 协议,则不需要 Encrypt Key。如果使用 Http 协议通信,则建议使用 Encrypt Key
Verification Token 默认生成的这个 Token 用于校验来源。但我们使用飞书官方推荐的另一种更为安全的校验方式,因此可以忽略这个配置项。
## 4. 配置回调地址
新建好发布渠道后,点击**请求地址**,复制对应的请求地址。
在飞书控制台,点击左侧的 `事件与回调` ,点击`配置订阅方式`旁边的编辑 icon粘贴刚刚复制的请求地址到输入框中。
| | | |
| --- | --- | --- |
| ![图片](/imgs/feishu-bot-10.jpg) | ![图片](/imgs/feishu-bot-11.jpg) | ![图片](/imgs/feishu-bot-6.png) |
## 5. 配置机器人回调事件和权限
* 添加 `接收消息` 事件
`事件与回调`页面,点击`添加事件`
搜索`接收消息`,或者直接搜索 `im.message.receive_v1` ,找到`接收消息 v2.0`的时间,勾选上并点击`确认添加`
添加事件后,增加两个权限:点击对应权限,会有弹窗提示添加权限,添加上图两个权限。
| | |
| --- | --- |
| ![图片](/imgs/feishu-bot-7.png) | ![图片](/imgs/feishu-bot-8.png) |
不推荐启用上图中的两个“历史版本”,而是使用新版本的权限。
- 若开启 “读取用户发给机器人的单聊消息”, 则单聊发送给机器人的消息将被送到 FastGPT
- 若开启 “接收群聊中@机器人消息事件”, 则群聊中@机器人的消息将被送到 FastGPT
- 若开启(不推荐开启)“获取群组中所有消息”,则群聊中所有消息都将被送到 FastGPT
## 6. 配置回复消息权限
在飞书控制台,点击左侧的 `权限管理` ,搜索框中输入`发消息`,找到`以应用的身份发消息`的权限,点击开通权限。
![](/imgs/feishu-bot-13.jpg)
## 7. 发布机器人
点击飞书控制台左侧的`版本管理与发布`,即可发布机器人。
![](/imgs/feishu-bot-12.jpg)
然后就可以在工作台里找到你的机器人啦。接下来就是把机器人拉进群组,或者单独与它对话。
![图片](/imgs/feishu-bot-9.png)
## FAQ
### 发送了消息,没响应
1. 检查飞书机器人回调地址、权限等是否正确。
2. 查看 FastGPT 对话日志,是否有对应的提问记录
3. 如果有记录,飞书没回应,则是没给机器人开权限。
4. 如果没记录,则可能是应用运行报错了,可以先试试最简单的机器人。(飞书机器人无法输入全局变量、文件、图片内容)

View File

@@ -0,0 +1,132 @@
---
title: '文件输入功能介绍'
description: 'FastGPT 文件输入功能介绍'
icon: 'description'
draft: false
toc: true
weight: 110
---
从 4.8.9 版本起FastGPT 支持在`简易模式``工作流`中,配置用户上传文件、图片功能。下面先简单介绍下如何使用文件输入功能,最后是介绍下文件解析的工作原理。
## 简易模式中使用
简易模式打开文件上传后,会使用工具调用模式,也就是由模型自行决策,是否需要读取文件内容。
可以找到左侧文件上传的配置项,点击其右侧的`开启`/`关闭`按键,即可打开配置弹窗。
![打开文件上传](/imgs/fileinpu-1.png)
随后,你的调试对话框中,就会出现一个文件选择的 icon可以点击文件选择 icon选择你需要上传的文件。
由于采用的是工具调用模式,所以在提问时候,可能需要加上适当的引导,让模型知道,你需要读取`文档`
![打开文件上传](/imgs/fileinpu-2.png)
## 工作流中使用
工作流中,可以在系统配置中,找到`文件输入`配置项,点击其右侧的`开启`/`关闭`按键,即可打开配置弹窗。
![打开文件上传](/imgs/fileinpu-4.jpg)
在工作流中,使用文件的方式很多,最简单的就是类似下图中,直接通过工具调用接入文档解析,实现和简易模式一样的效果。
![打开文件上传](/imgs/fileinpu-3.jpg)
也可以更简单点,强制每轮对话都携带上文档内容进行回答,这样就不需要调用两次 AI 才能读取文档内容了。
![打开文件上传](/imgs/fileinpu-5.jpg)
当然,你也可以在工作流中,对文档进行内容提取、内容分析等,然后将分析的结果传递给 HTTP 或者其他模块,从而实现文件处理的 SOP。不过目前版本`插件`中并未支持文件处理,所以在构建 SOP 的话可能还是有一些麻烦。
## 文档解析工作原理
不同于图片识别LLM 模型目前没有支持直接解析文档的能力,所有的文档“理解”都是通过文档转文字后拼接 prompt 实现。这里通过几个 FAQ 来解释文档解析的工作原理,理解文档解析的原理,可以更好的在工作流中使用文档解析功能。
### 上传的文件如何存储在数据库中
FastGPT 的对话记录存储结构中role=user 的消息value 值会按以下结构存储:
```ts
type UserChatItemValueItemType = {
type: 'text' | 'file'
text?: {
content: string;
};
file?: {
type: 'img' | 'doc'
name?: string;
url: string;
};
};
```
也就是说,上传的图片和文档,都会以 URL 的形式存储在库中,并不会存储`解析后的文档内容`
### 图片如何处理
文档解析节点不会处理图片,图片链接会被过滤,图片识别请直接使用支持图片识别的 LLM 模型。
### 文档解析节点如何工作
文档解析依赖文档解析节点,这个节点会接收一个`array<string>`类型的输入,对应的是文件输入的 URL输出的是一个`string`,对应的是文档解析后的内容。
![打开文件上传](/imgs/fileinpu-6.jpg)
* 在文档解析节点中,只会解析`文档`类型的 URL它是通过文件 URL 解析出来的`文名件后缀`去判断的。如果你同时选择了文档和图片,图片会被忽略。
* 文档解析节点,除了解析本轮工作流接收的文件外,还会把历史记录中的文档 URL 进行解析。最终会解析至多 n 个文档n 取决于你配置文件上传时,允许的最大文件数量。
{{% alert icon="🤖" context="success" %}}
举例:
配置了最多允许 5 个文件上传
1. 第一轮对话,上传 3 个文档和 1 个图片:文档解析节点,返回 3 个文档内容。
2. 第二轮对话,不上传任何文件:文档解析节点,返回 3 个文档内容。
3. 第三轮对话,上传 2 个文档:文档解析节点,返回 5 个文档内容。
4. 第四轮对话,上传 1 个文档:文档解析节点,返回 5 个文档内容,第一轮对话中的第三个文档会被过滤掉。
{{% /alert %}}
* 多个文档内容如何拼接的
按下列的模板,对多个文件进行拼接,即文件名+文件内容的形式组成一个字符串,不同文档之间通过分隔符:`\n******\n` 进行分割。
```
File: ${filename}
<Content>
${content}
</Content>
```
### 工具调用如何使用文档解析
在工具调用中,文档解析节点的调用提示词为:`解析对话中所有上传的文档,并返回对应文档内容`
作为工具被执行后,文档解析节点会返回解析后的文档内容作为工具响应。
### AI对话中如何使用文档解析
在 AI 对话节点中,新增了一个文档引用的输入,可以直接引用文档解析节点的输出,从而实现文档内容的引用。
它接收一个`string`类型的输入,除了可以引用文档解析结果外,还可以实现自定义内容引用,最终会进行提示词拼接,放置在 role=system 的消息中。提示词模板如下:
```
将 <Quote></Quote> 中的内容作为本次对话的参考:
<Quote>
{{quote}}
</Quote>
```
quote 为引用的内容。
![打开文件上传](/imgs/fileinpu-7.jpg)
## 文件输入后续更新
* 插件支持配置文件输入。
* 子应用和插件调用,支持传递文件输入。
* 文档解析,结构化解析结果。
* 更多的文件类型输入以及解析器。

View File

@@ -1,133 +0,0 @@
---
title: " 打造高质量 AI 知识库(过期)"
description: " 利用 FastGPT 打造高质量 AI 知识库"
icon: "school"
draft: false
toc: true
weight: 300
---
## 前言
自从去年 12 月 ChatGPT 发布后,带动了新的一轮应用交互革命。尤其是 GPT-3.5 接口全面放开后LLM 应用雨后春笋般快速涌现,但因为 GPT 的可控性、随机性和合规性等问题,很多应用场景都没法落地。
3 月时候,在 Twitter 上刷到一个老哥使用 GPT 训练自己的博客记录,并且成本非常低(比起 FT。他给出了一个完整的流程图
![向量搜索 GPT 流程图](/imgs/1.png)
看到这个推文后,我灵机一动,应用场景就十分清晰了。直接上手开干,在经过不到 1 个月时间FastGPT 在原来多助手管理基础上,加入了向量搜索。于是便有了最早的一期视频:
{{< bilibili BV1Wo4y1p7i1 >}}
3 个月过去了FastGPT 延续着早期的思路去完善和扩展,目前在向量搜索 + LLM 线性问答方面的功能基本上完成了。不过我们始终没有出一期关于如何构建知识库的教程,趁着 V4 在开发中,我们计划介绍一期《如何在 FastGPT 上构建高质量知识库》,以便大家更好的使用。
## FastGPT 知识库完整逻辑
在正式构建知识库前,我们先来了解下 FastGPT 是如何进行知识库检索的。首先了解几个基本概念:
1. 向量:将人类直观的语言(文字、图片、视频等)转成计算机可识别的语言(数组)。
2. 向量相似度:两个向量之间可以进行计算,得到一个相似度,即代表:两个语言相似的程度。
3. 语言大模型的一些特点:上下文理解、总结和推理。
结合上述 3 个概念,便有了 “向量搜索 + 大模型 = 知识库问答” 的公式。下图是 FastGPT V3 中知识库问答功能的完整逻辑:
![向量搜索 GPT 流程图](/imgs/2.png)
与大部分其他知识库问答产品不一样的是, FastGPT 采用了 QA 问答对进行存储,而不是仅进行 chunk文本分块处理。目的是为了减少向量化内容的长度让向量能更好的表达文本的含义从而提高搜索精准度。
此外 FastGPT 还提供了搜索测试和对话测试两种途径对数据进行调整,从而方便用户调整自己的数据。根据上述流程和方式,我们以构建一个 FastGPT 常见问题机器人为例,展示如何构建一个高质量的 AI 知识库。
## 构建知识库应用
首先,先创建一个 FastGPT 常见问题知识库
![创建知识库应用](/imgs/3.png)
### 通过 QA 拆分,获取基础知识
我们先直接把 FastGPT Git 上一些已有文档,进行 QA 拆分,从而获取一些 FastGPT 基础的知识。下面是 README 例子。
![QA 拆分示意图](/imgs/4.png)
![](/imgs/5.png)
### 修正 QA
通过 README 我们一共得到了 11 组数据,整体的质量还是不错的,图片和链接都提取出来了。不过最后一个知识点出现了一些截断,我们需要手动的修正一下。
此外,我们观察到第一列第三个知识点。这个知识点是介绍了 FastGPT 一些资源链接,但是 QA 拆分将答案放置在了 A 中,但通常来说用户的提问并不会直接问“有哪些链接”,通常会问:“部署教程”,“问题文档”之类的。因此,我们需要将这个知识点进行简单的一个处理,如下图:
![手动修改知识库数据](/imgs/6.png)
我们先来创建一个应用,看看效果如何。 首先需要去创建一个应用,并且在知识库中关联相关的知识库。另外还需要在配置页的提示词中,告诉 GPT“知识库的范围”。
![](/imgs/7.png)
![README QA 拆分后效果](/imgs/8.png)
整体的效果还是不错的,链接和对应的图片都可以顺利的展示。
### 录入社区常见问题
接着,我们再把 FastGPT 常见问题的文档导入,由于平时整理不当,我们只能手动的录入对应的问答。
![手动录入知识库结果](/imgs/9.png)
导入结果如上图。可以看到,我们均采用的是问答对的格式,而不是粗略的直接导入。目的就是为了模拟用户问题,进一步的提高向量搜索的匹配效果。可以为同一个问题设置多种问法,效果更佳。
FastGPT 还提供了 openapi 功能,你可以在本地对特殊格式的文件进行处理后,再上传到 FastGPT具体可以参考[FastGPT Api Docs](https://doc.fastgpt.in/docs/development/openapi)
## 知识库微调和参数调整
FastGPT 提供了搜索测试和对话测试两种途径对知识库进行微调,我们先来使用搜索测试对知识库进行调整。我们建议你提前收集一些用户问题进行测试,根据预期效果进行跳转。可以先进行搜索测试调整,判断知识点是否合理。
### 搜索测试
![搜索测试作用](/imgs/10.png)
你可能会遇到下面这种情况,由于“知识库”这个关键词导致一些无关内容的相似度也被搜索进去,此时就需要给第四条记录也增加一个“知识库”关键词,从而去提高它的相似度。
![搜索测试结果](/imgs/11.png)
![优化后的搜索测试结果](/imgs/12.png)
### 提示词设置
提示词的作用是引导模型对话的方向。在设置提示词时,遵守 2 个原则:
1. 告诉 Gpt 回答什么方面内容。
2. 给知识库一个基本描述,从而让 Gpt 更好的判断用户的问题是否属于知识库范围。
![提示词设置](/imgs/13.png)
### 更好的限定模型聊天范围
首先,你可以通过调整知识库搜索时的相似度和最大搜索数量,实现从知识库层面限制聊天范围。通常我们可以设置相似度为 0.82,并设置空搜索回复内容。这意味着,如果用户的问题无法在知识库中匹配时,会直接回复预设的内容。
![搜索参数设置](/imgs/14.png)
![空搜索控制效果](/imgs/15.png)
由于 openai 向量模型并不是针对中文,所以当问题中有一些知识库内容的关键词时,相似度
会较高,此时无法从知识库层面进行限定。需要通过限定词进行调整,例如:
> 我的问题如果不是关于 FastGPT 的,请直接回复:“我不确定”。你仅需要回答知识库中的内容,不在其中的内容,不需要回答。
效果如下:
![限定词效果](/imgs/16.png)
当然gpt35 在一定情况下依然是不可控的。
### 通过对话调整知识库
与搜索测试类似,你可以直接在对话页里,点击“引用”,来随时修改知识库内容。
![查看答案引用](/imgs/17.png)
## 总结
1. 向量搜索是一种可以比较文本相似度的技术。
2. 大模型具有总结和推理能力,可以从给定的文本中回答问题。
3. 最有效的知识库构建方式是 QA 和手动构建。
4. Q 的长度不宜过长。
5. 需要调整提示词,来引导模型回答知识库内容。
6. 可以通过调整搜索相似度、最大搜索数量和限定词来控制模型回复的范围。

View File

@@ -0,0 +1,106 @@
---
title: '接入微信公众号教程'
description: 'FastGPT 接入微信公众号教程'
icon: 'description'
draft: false
toc: true
weight: 113
---
从 4.8.10 版本起FastGPT 商业版支持直接接入微信公众号,无需额外的 API。
**注意⚠️: 目前只支持通过验证的公众号(服务号和订阅号都可以)**
## 1. 在 FastGPT 新建发布渠道
在 FastGPT 中选择想要接入的应用,在 *发布渠道* 页面,新建一个接入微信公众号的发布渠道,填写好基础信息。
![图片](/imgs/offiaccount-1.png)
## 2. 登录微信公众平台,获取 AppID 、 Secret和Token
### 1. https://mp.weixin.qq.com 登录微信公众平台,选择您的公众号。
**只支持通过验证的公众号,未通过验证的公众号暂不支持。**
开发者可以从这个链接申请微信公众号的测试号进行测试,测试号可以正常使用,但不能配置 AES Key
![图片](/imgs/offiaccount-2.png)
### 2. 把3个参数填入 FastGPT 配置弹窗中。
![图片](/imgs/offiaccount-3.png)
## 3. 在 IP 白名单中加入 FastGPT 的 IP
![图片](/imgs/offiaccount-4.png)
私有部署的用户可自行查阅自己的 IP 地址。
海外版用户cloud.tryfastgpt.ai)可以填写下面的 IP 白名单:
```
34.87.20.17
35.247.161.35
34.87.51.146
34.87.110.152
35.247.163.68
34.126.163.205
34.87.20.189
34.87.102.86
35.240.227.100
35.198.192.104
34.143.149.171
34.87.152.33
34.124.237.188
35.197.149.75
34.87.44.74
34.124.189.116
34.87.79.202
34.87.173.252
34.143.240.160
34.87.180.104
34.142.157.52
```
国内版用户fastgpt.cn)可以填写下面的 IP 白名单:
```
47.97.59.172
121.43.108.48
121.41.75.88
121.41.178.7
121.40.65.187
121.196.235.183
120.55.195.90
120.55.193.112
120.26.229.115
112.124.41.79
101.37.205.32
47.98.190.173
```
## 4. 获取AES Key选择加密方式
![图片](/imgs/offiaccount-5.png)
![图片](/imgs/offiaccount-6.png)
1. 随机生成AESKey填入 FastGPT 配置弹窗中。
2. 选择加密方式为安全模式。
## 5. 获取 URL
1. 在FastGPT确认创建获取URL。
![图片](/imgs/offiaccount-7.png)
2. 填入微信公众平台的 URL 处,然后提交保存
![图片](/imgs/offiaccount-8.png)
## 6. 启用服务器配置(如已自动启用,请忽略)
![图片](/imgs/offiaccount-9.png)
## 7. 开始使用
现在用户向公众号发消息,消息则会被转发到 FastGPT通过公众号返回对话结果。

View File

@@ -1,13 +1,15 @@
---
title: "对接第三方 GPT 应用"
description: "通过与 OpenAI 兼容的 API 对接第三方应用"
title: "通过 API 访问应用"
description: "通过 API 访问 FastGPT 应用"
icon: "model_training"
draft: false
toc: true
weight: 505
weight: 112
---
## 获取 API 秘钥
在 FastGPT 中,你可以为每一个应用创建多个 API 密钥,用于访问应用的 API 接口。每个密钥仅能访问一个应用。完整的接口可以[查看应用对话接口](/docs/development/openapi/chat)。
## 获取 API 密钥
依次选择应用 -> 「API访问」然后点击「API 密钥」来创建密钥。
@@ -15,7 +17,7 @@ weight: 505
密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。
{{% /alert %}}
![](/imgs/fastgpt-api.jpg)
![](/imgs/fastgpt-api1.jpg)
{{% alert icon="🍅" context="success" %}}
Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key 被滥用。
@@ -26,7 +28,7 @@ Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key
```bash
OPENAI_API_BASE_URL: https://api.fastgpt.in/api (改成自己部署的域名)
OPENAI_API_KEY = 上一步获取到的
OPENAI_API_KEY = 上一步获取到的
```
**[ChatGPT Next Web](https://github.com/Yidadaa/ChatGPT-Next-Web) 示例:**

View File

@@ -18,7 +18,7 @@ Web 站点同步利用爬虫的技术,可以通过一个入口网站,自动
Tips: 国内的媒体站点基本不可用公众号、csdn、知乎等。可以通过终端发送`curl`请求检测是否为静态站点,例如:
```bash
curl https://doc.fastgpt.in/docs/intro/
curl https://doc.tryfastgpt.ai/docs/intro/
```
## 如何使用

View File

@@ -13,9 +13,7 @@ weight: 708
这个配置文件中包含了系统参数和各个模型配置:
## 4.6.8+ 版本新配置文件
llm模型全部合并
## 4.6.8+ 版本新配置文件示例
```json
{
@@ -29,16 +27,16 @@ llm模型全部合并
},
"llmModels": [
{
"model": "gpt-3.5-turbo", // 模型名(对应OneAPI中渠道的模型名)
"name": "gpt-3.5-turbo", // 别名
"model": "gpt-4o-mini", // 模型名(对应OneAPI中渠道的模型名)
"name": "gpt-4o-mini", // 模型别名
"avatar": "/imgs/model/openai.svg", // 模型的logo
"maxContext": 16000, // 最大上下文
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 13000, // 最大引用内容
"maxContext": 125000, // 最大上下文
"maxResponse": 16000, // 最大回复
"quoteMaxToken": 120000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0, // n积分/1k token商业版
"charsPointsPrice": 0, // n积分/1k token商业版
"censor": false, // 是否开启敏感校验(商业版)
"vision": false, // 是否支持图片输入
"vision": true, // 是否支持图片输入
"datasetProcess": true, // 是否设置为知识库处理模型QA务必保证至少有一个为true否则知识库会报错
"usedInClassify": true, // 是否用于问题分类务必保证至少有一个为true
"usedInExtractFields": true, // 是否用于内容提取务必保证至少有一个为true
@@ -49,20 +47,20 @@ llm模型全部合并
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
"customExtractPrompt": "", // 自定义内容提取提示词
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig":{} // 请求API时挟带一些默认配置比如 GLM4 的 top_p
"defaultConfig": {} // 请求API时挟带一些默认配置比如 GLM4 的 top_p
},
{
"model": "gpt-4-0125-preview",
"name": "gpt-4-turbo",
"model": "gpt-4o",
"name": "gpt-4o",
"avatar": "/imgs/model/openai.svg",
"maxContext": 125000,
"maxResponse": 4000,
"quoteMaxToken": 100000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": false,
"vision": true,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
@@ -72,30 +70,61 @@ llm模型全部合并
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig":{}
"defaultConfig": {}
},
{
"model": "gpt-4-vision-preview",
"name": "gpt-4-vision",
"model": "o1-mini",
"name": "o1-mini",
"avatar": "/imgs/model/openai.svg",
"maxContext": 128000,
"maxContext": 125000,
"maxResponse": 4000,
"quoteMaxToken": 100000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": true,
"datasetProcess": false,
"usedInClassify": false,
"usedInExtractFields": false,
"usedInToolCall": false,
"usedInQueryExtension": false,
"toolChoice": true,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"usedInQueryExtension": true,
"toolChoice": false,
"functionCall": false,
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig":{}
"defaultConfig": {
"temperature": 1,
"max_tokens": null,
"stream": false
}
},
{
"model": "o1-preview",
"name": "o1-preview",
"avatar": "/imgs/model/openai.svg",
"maxContext": 125000,
"maxResponse": 4000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"usedInQueryExtension": true,
"toolChoice": false,
"functionCall": false,
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig": {
"temperature": 1,
"max_tokens": null,
"stream": false
}
}
],
"vectorModels": [
@@ -107,9 +136,30 @@ llm模型全部合并
"defaultToken": 700, // 默认文本分割时候的 token
"maxToken": 3000, // 最大 token
"weight": 100, // 优先训练权重
"defaultConfig":{}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024来返回1024维度的向量。目前必须小于1536维度
"defaultConfig": {}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024来返回1024维度的向量。目前必须小于1536维度
"dbConfig": {}, // 存储时的额外参数(非对称向量模型时候需要用到)
"queryConfig": {} // 参训时的额外参数
},
{
"model": "text-embedding-3-large",
"name": "text-embedding-3-large",
"avatar": "/imgs/model/openai.svg",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 3000,
"weight": 100,
"defaultConfig": {
"dimensions": 1024
}
},
{
"model": "text-embedding-3-small",
"name": "text-embedding-3-small",
"avatar": "/imgs/model/openai.svg",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 3000,
"weight": 100
}
],
"reRankModels": [],
@@ -138,19 +188,22 @@ llm模型全部合并
## 关于模型 logo
统一放置在项目的`public/imgs/model/xxx`目录中目前内置了以下几种如果有需要可以PR增加。默认头像为 Hugging face 的 logo~
统一放置在项目的`public/imgs/model/xxx`目录中目前内置了以下几种如果有需要可以PR增加。默认logo为 Hugging face 的 logo~
- /imgs/model/baichuan.svg - 百川
- /imgs/model/chatglm.svg - 智谱
- /imgs/model/calude.svg - calude
- /imgs/model/baichuan.svg - 百川智能
- /imgs/model/chatglm.svg - 智谱清言
- /imgs/model/claude.svg - claude
- /imgs/model/deepseek.svg - deepseek
- /imgs/model/doubao.svg - 火山豆包
- /imgs/model/ernie.svg - 文心一言
- /imgs/model/gemini.svg - gemini
- /imgs/model/huggingface.svg - Hugging face【默认logo】
- /imgs/model/minimax.svg - minimax
- /imgs/model/moonshot.svg - 月之暗面
- /imgs/model/openai.svg - OpenAI GPT
- /imgs/model/qwen.svg - 通义千问
- /imgs/model/sparkDesk.svg - 讯飞星火
- /imgs/model/yi.svg - 零一万物
- /imgs/model/gemini.svg - gemini
- /imgs/model/deepseek.svg - deepseek
- /imgs/model/minimax.svg - minimax
-
## 特殊模型
@@ -177,6 +230,27 @@ llm模型全部合并
}
```
### ReRank 接入(硅基流动)
有免费的 `bge-reranker-v2-m3` 模型可以使用。
1. 注册硅基流动账号: https://siliconflow.cn/
2. 进入控制台,获取 API key: https://cloud.siliconflow.cn/account/ak
3. 修改 FastGPT 配置文件
```json
{
"reRankModels": [
{
"model": "BAAI/bge-reranker-v2-m3", // 这里的model需要对应 siliconflow 的模型名
"name": "BAAI/bge-reranker-v2-m3",
"requestUrl": "https://api.siliconflow.cn/v1/rerank",
"requestAuth": "siliconflow 上申请的 key"
}
]
}
```
### ReRank 接入Cohere
这个重排模型对中文不是很好,不如 bge 的好用。
@@ -189,7 +263,7 @@ llm模型全部合并
"reRankModels": [
{
"model": "rerank-multilingual-v2.0", // 这里的model需要对应 cohere 的模型名
"name": "检索重排", // 随意
"name": "rerank-multilingual-v2.0",
"requestUrl": "https://api.cohere.ai/v1/rerank",
"requestAuth": "Coherer上申请的key"
}

View File

@@ -14,9 +14,9 @@ weight: 920
{{< table "table-hover table-striped-columns" >}}
| 模型名 | 内存 | 显存 | 硬盘空间 | 启动命令 |
|------|---------|---------|----------|--------------------------|
| bge-rerank-base | >=4GB | >=4GB | >=8GB | python app.py |
| bge-rerank-large | >=8GB | >=8GB | >=8GB | python app.py |
| bge-rerank-v2-m3 | >=8GB | >=8GB | >=8GB | python app.py |
| bge-reranker-base | >=4GB | >=4GB | >=8GB | python app.py |
| bge-reranker-large | >=8GB | >=8GB | >=8GB | python app.py |
| bge-reranker-v2-m3 | >=8GB | >=8GB | >=8GB | python app.py |
{{< /table >}}
## 源码部署
@@ -33,7 +33,7 @@ weight: 920
1. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-base](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-base)
2. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-large](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-large)
3. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-rerank-v2-m3](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-rerank-v2-m3)
3. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-v2-m3](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-v2-m3)
### 3. 安装依赖
@@ -47,7 +47,7 @@ pip install -r requirements.txt
1. [https://huggingface.co/BAAI/bge-reranker-base](https://huggingface.co/BAAI/bge-reranker-base)
2. [https://huggingface.co/BAAI/bge-reranker-large](https://huggingface.co/BAAI/bge-reranker-large)
3. [https://huggingface.co/BAAI/bge-rerank-v2-m3](https://huggingface.co/BAAI/bge-rerank-v2-m3)
3. [https://huggingface.co/BAAI/bge-reranker-v2-m3](https://huggingface.co/BAAI/bge-reranker-v2-m3)
在对应代码目录下 clone 模型。目录结构:
@@ -119,3 +119,19 @@ services:
## 接入 FastGPT
参考 [ReRank模型接入](/docs/development/configuration/#rerank-接入)host 变量为部署的域名。
## QA
### Docker 运行提示 `Bus error (core dumped)`
尝试增加 `docker-compose.yml` 配置项 `shm_size` ,以增加容器中的共享内存目录大小。
```
...
services:
reranker:
...
container_name: reranker
shm_size: '2gb'
...
```

View File

@@ -124,53 +124,36 @@ curl --location --request POST 'https://<oneapi_url>/v1/chat/completions' \
## 将本地模型接入 FastGPT
修改 FastGPT 的 `config.json` 配置文件,其中 chatModels对话模型用于聊天对话cqModels问题分类模型用来对问题进行分类extractModels内容提取模型则用来进行工具选择。我们分别在 chatModels、cqModels 和 extractModels 中加入 qwen-chat 模型:
修改 FastGPT 的 `config.json` 配置文件的 llmModels 部分加入 qwen-chat 模型:
```json
{
"chatModels": [
...
{
"model": "qwen-chat",
"name": "Qwen",
"maxContext": 2048,
"maxResponse": 2048,
"quoteMaxToken": 2000,
"maxTemperature": 1,
"vision": false,
"defaultSystemChatPrompt": ""
}
...
...
"llmModels": [
{
"model": "qwen-chat", // 模型名(对应OneAPI中渠道的模型名)
"name": "Qwen", // 模型别名
"avatar": "/imgs/model/Qwen.svg", // 模型的logo
"maxContext": 125000, // 最大上下文
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 120000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0, // n积分/1k token商业版
"censor": false, // 是否开启敏感校验(商业版)
"vision": true, // 是否支持图片输入
"datasetProcess": true, // 是否设置为知识库处理模型QA务必保证至少有一个为true否则知识库会报错
"usedInClassify": true, // 是否用于问题分类务必保证至少有一个为true
"usedInExtractFields": true, // 是否用于内容提取务必保证至少有一个为true
"usedInToolCall": true, // 是否用于工具调用务必保证至少有一个为true
"usedInQueryExtension": true, // 是否用于问题优化务必保证至少有一个为true
"toolChoice": true, // 是否支持工具选择分类内容提取工具调用会用到。目前只有gpt支持
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice如果为false则使用 functionCall如果仍为 false则使用提示词模式
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
"customExtractPrompt": "", // 自定义内容提取提示词
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig": {} // 请求API时挟带一些默认配置比如 GLM4 的 top_p
}
],
"cqModels": [
...
{
"model": "qwen-chat",
"name": "Qwen",
"maxContext": 2048,
"maxResponse": 2048,
"inputPrice": 0,
"outputPrice": 0,
"toolChoice": true,
"functionPrompt": ""
}
...
],
"extractModels": [
...
{
"model": "qwen-chat",
"name": "Qwen",
"maxContext": 2048,
"maxResponse": 2048,
"inputPrice": 0,
"outputPrice": 0,
"toolChoice": true,
"functionPrompt": ""
}
...
]
}
...
```
然后重启 FastGPT 就可以在应用配置中选择 Qwen 模型进行对话:

View File

@@ -35,6 +35,8 @@ weight: 707
### Milvus版本
暂不推荐,部分系统存在精度丢失,等待修复。
对于千万级以上向量性能更优秀。
[点击查看 Milvus 官方推荐配置](https://milvus.io/docs/prerequisite-docker.md)
@@ -49,6 +51,8 @@ weight: 707
### zilliz cloud版本
暂不推荐,部分系统存在精度丢失,等待修复。
亿级以上向量首选。
由于向量库使用了 Cloud无需占用本地资源无需太关注。
@@ -110,7 +114,7 @@ brew install orbstack
非 Linux 环境或无法访问外网环境,可手动创建一个目录,并下载配置文件和对应版本的`docker-compose.yml`在这个文件夹中依据下载的配置文件运行docker若作为本地开发使用推荐`docker-compose-pgvector`版本,并且自行拉取并运行`sandbox``fastgpt`并在docker配置文件中注释掉`sandbox``fastgpt`的部分
- [config.json](https://github.com/labring/FastGPT/blob/main/projects/app/data/config.json)
- [config.json](https://raw.githubusercontent.com/labring/FastGPT/refs/heads/main/projects/app/data/config.json)
- [docker-compose.yml](https://github.com/labring/FastGPT/blob/main/files/docker) (注意,不同向量库版本的文件不一样)
{{% alert icon="🤖" context="success" %}}

View File

@@ -121,4 +121,148 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
1. 模型服务不可用
2. 模型接口参数异常温度、max token等可能不适配
3. ....
3. ....
## 四、常见模型问题
### 报错 - 模型响应为空
该错误是由于 stream 模式下oneapi 直接结束了流请求,并且未返回任何内容导致。
4.8.10 版本新增了错误日志,报错时,会在日志中打印出实际发送的 Body 参数,可以复制该参数后,通过 curl 向 oneapi 发起请求测试。
由于 oneapi 在 stream 模式下,无法正确捕获错误,可以设置成 `stream=false` 后进行测试。
### 如何测试模型是否支持工具调用
需要模型提供商和 oneapi 同时支持工具调用才可使用,测试方法如下:
1. 通过 `curl``oneapi` 发起第一轮 stream 模式的 tool 测试。
```bash
curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
--header 'Authorization: Bearer sk-xxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o-mini",
"temperature": 0.01,
"max_tokens": 8000,
"stream": true,
"messages": [
{
"role": "user",
"content": "几点了"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "hCVbIY",
"description": "获取用户当前时区的时间。",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
}
],
"tool_choice": "auto"
}'
```
2. 检查响应参数
如果能正常调用工具,会返回对应 `tool_calls` 参数。
```json
{
"id": "chatcmpl-A7kwo1rZ3OHYSeIFgfWYxu8X2koN3",
"object": "chat.completion.chunk",
"created": 1726412126,
"model": "gpt-4o-mini-2024-07-18",
"system_fingerprint": "fp_483d39d857",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"index": 0,
"id": "call_0n24eiFk8OUyIyrdEbLdirU7",
"type": "function",
"function": {
"name": "mEYIcFl84rYC",
"arguments": ""
}
}
],
"refusal": null
},
"logprobs": null,
"finish_reason": null
}
],
"usage": null
}
```
3. 通过 `curl``oneapi` 发起第二轮 stream 模式的 tool 测试。
第二轮请求是把工具结果发送给模型。发起后会得到模型回答的结果。
```bash
curl --location --request POST 'https://oneapi.xxxx/v1/chat/completions' \
--header 'Authorization: Bearer sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o-mini",
"temperature": 0.01,
"max_tokens": 8000,
"stream": true,
"messages": [
{
"role": "user",
"content": "几点了"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "kDia9S19c4RO",
"type": "function",
"function": {
"name": "hCVbIY",
"arguments": "{}"
}
}
]
},
{
"tool_call_id": "kDia9S19c4RO",
"role": "tool",
"name": "hCVbIY",
"content": "{\n \"time\": \"2024-09-14 22:59:21 Sunday\"\n}"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "hCVbIY",
"description": "获取用户当前时区的时间。",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
}
],
"tool_choice": "auto"
}'
```

View File

@@ -7,11 +7,11 @@ toc: true
weight: 705
---
本文档介绍了如何设置开发环境以构建和测试 [FastGPT](https://fastgpt.in),。
本文档介绍了如何设置开发环境以构建和测试 [FastGPT](https://tryfastgpt.ai),。
## 前置依赖项
您需要在计算机上安装和配置以下依赖项才能构建 [FastGPT](https://fastgpt.in)
您需要在计算机上安装和配置以下依赖项才能构建 [FastGPT](https://tryfastgpt.ai)
- [Git](http://git-scm.com/)
- [Docker](https://www.docker.com/)(构建镜像)
@@ -150,7 +150,7 @@ FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI
遇到困难了吗?有任何问题吗? 加入微信群与开发者和用户保持沟通。
<img width="400px" src="https://oss.laf.run/htr4n1-images/fastgpt-qr-code.jpg" class="medium-zoom-image" />
<img width="400px" src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png" class="medium-zoom-image" />
## 代码结构说明

View File

@@ -172,7 +172,7 @@ docker exec -it mongo mongorestore -u "username" -p "password" --authenticationD
5.重启容器 【C环境】
```
docker compose restart
docker logs -f mongo **强烈建议先检查mongo运行情况在去做登动作如果mongo报错访问web也会报错”
docker logs -f mongo **强烈建议先检查mongo运行情况在去做登动作如果mongo报错访问web也会报错”
```
如果mongo启动正常显示的是类似这样的而不是 “mongo is restarting”后者就是错误
@@ -182,5 +182,5 @@ docker logs -f mongo **强烈建议先检查mongo运行情况在去做登陆
<img width="508" alt="iShot_2024-05-09_19 23 13" src="https://github.com/labring/FastGPT/assets/103937568/2e2afc9f-484c-4b63-93ee-1c14aef03de0">
6. 启动fastgpt容器服务后新fastgpt web能看到原来的数据库内容完整显示说明已经导入系统了。
6. 启动fastgpt容器服务后新fastgpt web能看到原来的数据库内容完整显示说明已经导入系统了。
<img width="1728" alt="iShot_2024-05-09_19 23 51" src="https://github.com/labring/FastGPT/assets/103937568/846b6157-6b6a-4468-a1d9-c44d681ebf7c">

View File

@@ -135,7 +135,7 @@ CHAT_API_KEY=sk-xxxxxx
"charsPointsPrice": 0,
"censor": false,
"vision": false, // 是否支持图片输入
"datasetProcess": false, // 是否设置为知识库处理模型
"datasetProcess": true, // 是否设置为知识库处理模型
"usedInClassify": true, // 是否用于问题分类
"usedInExtractFields": true, // 是否用于字段提取
"usedInToolCall": true, // 是否用于工具调用

View File

@@ -7,29 +7,31 @@ toc: true
weight: 852
---
{{% alert icon="🤖 " context="success" %}}
该接口的 API Key 需使用`应用特定的 key`,否则会报错。
# 发起对话
有些包调用时,`BaseUrl`需要添加`v1`路径有些不需要如果出现404情况可补充`v1`重试。
{{% alert icon="🤖 " context="success" %}}
* 该接口的 API Key 需使用`应用特定的 key`,否则会报错。
* 有些包调用时,`BaseUrl`需要添加`v1`路径有些不需要如果出现404情况可补充`v1`重试。
{{% /alert %}}
## 发起对话(简易应用和工作流)
## 请求简易应用和工作流
对话接口兼容`GPT`的接口!如果你的项目使用的是标准的`GPT`官方接口,可以直接通过修改`BaseUrl``Authorization`来访问 FastGpt 应用,不过需要注意下面几个规则:
{{% alert icon="🤖 " context="success" %}}
* 传入的`model``temperature`等参数字段均无效,这些字段由编排决定。
* 传入的`model``temperature`等参数字段均无效,这些字段由编排决定,不会根据 API 参数改变
* 不会返回实际消耗`Token`值,如果需要,可以设置`detail=true`,并手动计算 `responseData` 里的`tokens`值。
{{% /alert %}}
### 请求
{{< tabs tabTotal="2" >}}
{{< tab tabName="请求示例" >}}
{{< tabs tabTotal="3" >}}
{{< tab tabName="基础请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
--header 'Authorization: Bearer fastgpt-xxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
@@ -42,8 +44,49 @@ curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions'
},
"messages": [
{
"content": "导演是谁",
"role": "user"
"role": "user",
"content": "导演是谁"
}
]
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="图片/文件请求示例" >}}
{{< markdownify >}}
*`messages`有部分区别,其他参数一致。
* 目前不支持上次文件,需上传到自己的对象存储中,获取对应的文件链接。
```bash
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
--header 'Authorization: Bearer fastgpt-xxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"chatId": "abcd",
"stream": false,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "导演是谁"
},
{
"type": "image_url",
"image_url": {
"url": "图片链接"
}
},
{
"type": "file_url",
"name": "文件名",
"url": "文档链接,支持 txt md html word pdf ppt csv excel"
}
]
}
]
}'
@@ -269,7 +312,6 @@ event取值
{{< /tabs >}}
## 请求插件
插件的接口与对话接口一致,仅请求参数略有区别,有以下规定:
@@ -332,7 +374,7 @@ curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
},
{
"nodeId": "pluginOutput",
"moduleName": "自定义插件输出",
"moduleName": "插件输出",
"moduleType": "pluginOutput",
"totalPoints": 0,
"pluginOutput": {
@@ -430,7 +472,7 @@ event: answer
data: [DONE]
event: flowResponses
data: [{"nodeId":"fdDgXQ6SYn8v","moduleName":"AI 对话","moduleType":"chatNode","totalPoints":0.033,"model":"FastAI-3.5","tokens":33,"query":"你好","maxToken":2000,"historyPreview":[{"obj":"Human","value":"你好"},{"obj":"AI","value":"你好!有什么可以帮助你的吗?"}],"contextTotalLen":2,"runningTime":1.42},{"nodeId":"pluginOutput","moduleName":"自定义插件输出","moduleType":"pluginOutput","totalPoints":0,"pluginOutput":{"result":"你好!有什么可以帮助你的吗?"},"runningTime":0}]
data: [{"nodeId":"fdDgXQ6SYn8v","moduleName":"AI 对话","moduleType":"chatNode","totalPoints":0.033,"model":"FastAI-3.5","tokens":33,"query":"你好","maxToken":2000,"historyPreview":[{"obj":"Human","value":"你好"},{"obj":"AI","value":"你好!有什么可以帮助你的吗?"}],"contextTotalLen":2,"runningTime":1.42},{"nodeId":"pluginOutput","moduleName":"插件输出","moduleType":"pluginOutput","totalPoints":0,"pluginOutput":{"result":"你好!有什么可以帮助你的吗?"},"runningTime":0}]
```
{{< /markdownify >}}
@@ -455,8 +497,730 @@ event取值
{{< /tab >}}
{{< /tabs >}}
## 使用案例
- [接入 NextWeb/ChatGPT web 等应用](/docs/use-cases/openapi)
- [接入 onwechat](/docs/use-cases/onwechat)
- [接入 飞书](/docs/use-cases/feishu)
# 对话 CRUD
{{% alert icon="🤖 " context="success" %}}
* 以下接口可使用任意`API Key`调用。
* 4.8.12 以上版本才能使用
{{% /alert %}}
**重要字段**
* chatId - 指一个应用下,某一个对话窗口的 ID
* dataId - 指一个对话窗口下,某一个对话记录的 ID
## 历史记录
### 获取某个应用历史记录
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/chat/getHistories' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"offset": 0,
"pageSize": 20,
"source: "api"
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- offset - 偏移量,即从第几条数据开始取
- pageSize - 记录数量
- source - 对话源
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": {
"list": [
{
"chatId": "usdAP1GbzSGu",
"updateTime": "2024-10-13T03:29:05.779Z",
"appId": "66e29b870b24ce35330c0f08",
"customTitle": "",
"title": "你好",
"top": false
},
{
"chatId": "lC0uTAsyNBlZ",
"updateTime": "2024-10-13T03:22:19.950Z",
"appId": "66e29b870b24ce35330c0f08",
"customTitle": "",
"title": "测试",
"top": false
}
],
"total": 2
}
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 修改某个对话的标题
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistory' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"chatId": "chatId",
"customTitle": "自定义标题"
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
- customTitle - 自定义对话名
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 置顶 / 取消置顶
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistory' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"chatId": "chatId",
"top": true
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用Id
- chatId - 历史记录 Id
- top - 是否置顶ture 置顶false 取消置顶
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 删除某个历史记录
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request DELETE 'http://localhost:3000/api/core/chat/delHistory?chatId={{chatId}}&appId={{appId}}' \
--header 'Authorization: Bearer {{apikey}}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 清空所有历史记录
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request DELETE 'http://localhost:3000/api/core/chat/clearHistories?appId={{appId}}' \
--header 'Authorization: Bearer {{apikey}}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
## 对话记录
指的是某个 chatId 下的对话记录操作。
### 获取单个对话初始化信息
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request GET 'http://localhost:3000/api/core/chat/init?appId={{appId}}&chatId={{chatId}}' \
--header 'Authorization: Bearer {{apikey}}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": {
"chatId": "sPVOuEohjo3w",
"appId": "66e29b870b24ce35330c0f08",
"variables": {
},
"app": {
"chatConfig": {
"questionGuide": true,
"ttsConfig": {
"type": "web"
},
"whisperConfig": {
"open": false,
"autoSend": false,
"autoTTSResponse": false
},
"chatInputGuide": {
"open": false,
"textList": [
],
"customUrl": ""
},
"instruction": "",
"variables": [
],
"fileSelectConfig": {
"canSelectFile": true,
"canSelectImg": true,
"maxFiles": 10
},
"_id": "66f1139aaab9ddaf1b5c596d",
"welcomeText": ""
},
"chatModels": [
"GPT-4o-mini"
],
"name": "测试",
"avatar": "/imgs/app/avatar/workflow.svg",
"intro": "",
"type": "advanced",
"pluginInputs": [
]
}
}
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 获取对话记录列表
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/chat/getPaginationRecords' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"chatId": "chatId",
"offset": 0,
"pageSize": 10,
"loadCustomFeedbacks": true
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
- offset - 偏移量
- pageSize - 记录数量
- loadCustomFeedbacks - 是否读取自定义反馈(可选)
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": {
"list": [
{
"_id": "670b84e6796057dda04b0fd2",
"dataId": "jzqdV4Ap1u004rhd2WW8yGLn",
"obj": "Human",
"value": [
{
"type": "text",
"text": {
"content": "你好"
}
}
],
"customFeedbacks": [
]
},
{
"_id": "670b84e6796057dda04b0fd3",
"dataId": "x9KQWcK9MApGdDQH7z7bocw1",
"obj": "AI",
"value": [
{
"type": "text",
"text": {
"content": "你好!有什么我可以帮助你的吗?"
}
}
],
"customFeedbacks": [
],
"llmModuleAccount": 1,
"totalQuoteList": [
],
"totalRunningTime": 2.42,
"historyPreviewLength": 2
}
],
"total": 2
}
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 获取单个对话记录运行详情
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request GET 'http://localhost:3000/api/core/chat/getResData?appId={{appId}}&chatId={{chatId}}&dataId={{dataId}}' \
--header 'Authorization: Bearer {{apikey}}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 对话 Id
- dataId - 对话记录 Id
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": [
{
"id": "mVlxkz8NfyfU",
"nodeId": "448745",
"moduleName": "common:core.module.template.work_start",
"moduleType": "workflowStart",
"runningTime": 0
},
{
"id": "b3FndAdHSobY",
"nodeId": "z04w8JXSYjl3",
"moduleName": "AI 对话",
"moduleType": "chatNode",
"runningTime": 1.22,
"totalPoints": 0.02475,
"model": "GPT-4o-mini",
"tokens": 75,
"query": "测试",
"maxToken": 2000,
"historyPreview": [
{
"obj": "Human",
"value": "你好"
},
{
"obj": "AI",
"value": "你好!有什么我可以帮助你的吗?"
},
{
"obj": "Human",
"value": "测试"
},
{
"obj": "AI",
"value": "测试成功!请问你有什么具体的问题或者需要讨论的话题吗?"
}
],
"contextTotalLen": 4
}
]
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 删除对话记录
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request DELETE 'http://localhost:3000/api/core/chat/item/delete?contentId={{contentId}}&chatId={{chatId}}&appId={{appId}}' \
--header 'Authorization: Bearer {{apikey}}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
- contentId - 对话记录 Id
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 点赞 / 取消点赞
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/updateUserFeedback' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"chatId": "chatId",
"dataId": "dataId",
"userGoodFeedback": "yes"
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
- dataId - 对话记录 Id
- userGoodFeedback - 用户点赞时的信息(可选),取消点赞时不填此参数即可
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
### 点踩 / 取消点踩
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/updateUserFeedback' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "appId",
"chatId": "chatId",
"dataId": "dataId",
"userBadFeedback": "yes"
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- appId - 应用 Id
- chatId - 历史记录 Id
- dataId - 对话记录 Id
- userBadFeedback - 用户点踩时的信息(可选),取消点踩时不填此参数即可
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": null
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}
## 猜你想问
{{< tabs tabTotal="3" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
```bash
curl --location --request POST 'http://localhost:3000/api/core/ai/agent/createQuestionGuide' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"messages":[
{
"role": "user",
"content": "你好"
},
{
"role": "assistant",
"content": "你好!有什么我可以帮助你的吗?"
}
]
}'
```
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="参数说明" >}}
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- messages - 对话消息,提供给 AI 的消息记录
{{% /alert %}}
{{< /markdownify >}}
{{< /tab >}}
{{< tab tabName="响应示例" >}}
{{< markdownify >}}
```json
{
"code": 200,
"statusText": "",
"message": "",
"data": [
"你对AI有什么看法",
"想了解AI的应用吗",
"你希望AI能做什么"
]
}
```
{{< /markdownify >}}
{{< /tab >}}
{{< /tabs >}}

View File

@@ -22,7 +22,7 @@ weight: 853
**新例子**
```bash
curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/createTrainingUsage' \
curl --location --request POST 'http://localhost:3000/api/support/wallet/usage/createTrainingUsage' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
@@ -34,7 +34,7 @@ curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/
**x例子**
```bash
curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/bill/createTrainingBill' \
curl --location --request POST 'http://localhost:3000/api/support/wallet/bill/createTrainingBill' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
@@ -312,6 +312,8 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/delete?
| chunkSize | 预估块大小 | |
| chunkSplitter | 自定义最高优先分割符号 | |
| qaPrompt | qa拆分提示词 | |
| tags | 集合标签(字符串数组) | |
| createTime | 文件创建时间Date / String | |
**出参**
@@ -466,7 +468,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"link":"https://doc.fastgpt.in/docs/course/quick-start/",
"link":"https://doc.tryfastgpt.ai/docs/course/quick-start/",
"datasetId":"6593e137231a2be9c5603ba7",
"parentId": null,
@@ -531,6 +533,8 @@ data 为集合的 ID。
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
使用代码上传时,请注意中文 filename 需要进行 encode 处理,否则容易乱码。
```bash
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/create/localFile' \
--header 'Authorization: Bearer {{authorization}}' \
@@ -602,9 +606,11 @@ curl --location --request POST 'http://localhost:3000/api/proApi/core/dataset/co
--data-raw '{
"externalFileUrl":"https://image.xxxxx.com/fastgpt-dev/%E6%91%82.pdf",
"externalFileId":"1111",
"filename":"自定义文件名",
"createTime": "2024-05-01T00:00:00.000Z",
"filename":"自定义文件名.pdf",
"datasetId":"6642d105a5e9d2b00255b27b",
"parentId": null,
"tags": ["tag1","tag2"],
"trainingType": "chunk",
"chunkSize":512,
@@ -623,7 +629,8 @@ curl --location --request POST 'http://localhost:3000/api/proApi/core/dataset/co
| --- | --- | --- |
| externalFileUrl | 文件访问链接(可以是临时链接) | ✅ |
| externalFileId | 外部文件ID | |
| filename | 自定义文件名 | |
| filename | 自定义文件名,需要带后缀 | |
| createTime | 文件创建时间Date ISO 字符串都 ok | |
{{< /markdownify >}}
@@ -708,7 +715,21 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
"updateTime": "2099-01-01T00:00:00.000Z",
"dataAmount": 3,
"trainingAmount": 0,
"canWrite": true
"externalFileId": "1111",
"tags": [
"11",
"测试的"
],
"forbid": false,
"trainingType": "chunk",
"permission": {
"value": 4294967295,
"isOwner": true,
"hasManagePer": true,
"hasWritePer": true,
"hasReadPer": true
}
},
{
"_id": "65abd0ad9d1448617cba6031",
@@ -716,11 +737,23 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
"tmbId": "65422be6aa44b7da77729ec9",
"type": "link",
"name": "快速上手 | FastGPT",
"rawLink": "https://doc.fastgpt.in/docs/course/quick-start/",
"rawLink": "https://doc.tryfastgpt.ai/docs/course/quick-start/",
"updateTime": "2024-01-20T13:54:53.031Z",
"dataAmount": 3,
"trainingAmount": 0,
"canWrite": true
"externalFileId": "222",
"tags": [
"测试的"
],
"forbid": false,
"trainingType": "chunk",
"permission": {
"value": 4294967295,
"isOwner": true,
"hasManagePer": true,
"hasWritePer": true,
"hasReadPer": true
}
}
],
"total": 93
@@ -811,14 +844,36 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/collection
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
**通过集合 ID 修改集合信息**
```bash
curl --location --request PUT 'http://localhost:3000/api/core/dataset/collection/update' \
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":"65abcfab9d1448617cba5f0d",
"parentId":null,
"name":"测2222试"
"parentId": null,
"name": "测2222试",
"tags": ["tag1", "tag2"],
"forbid": false,
"createTime": "2024-01-01T00:00:00.000Z"
}'
```
**通过外部文件 ID 修改集合信息** 只需要把 id 换成 datasetId 和 externalFileId。
```bash
curl --location --request PUT 'http://localhost:3000/api/core/dataset/collection/update' \
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"datasetId":"6593e137231a2be9c5603ba7",
"externalFileId":"1111",
"parentId": null,
"name": "测2222试",
"tags": ["tag1", "tag2"],
"forbid": false,
"createTime": "2024-01-01T00:00:00.000Z"
}'
```
@@ -832,6 +887,9 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/collection
- id: 集合的ID
- parentId: 修改父级ID可选
- name: 修改集合名称(可选)
- tags: 修改集合标签(可选)
- forbid: 修改集合禁用状态(可选)
- createTime: 修改集合创建时间(可选)
{{% /alert %}}
{{< /markdownify >}}
@@ -1035,6 +1093,22 @@ A2:
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
**4.8.11+**
```bash
curl --location --request POST 'http://localhost:3000/api/core/dataset/data/v2/list' \
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"offset": 0,
"pageSize": 10,
"collectionId":"65abd4ac9d1448617cba6171",
"searchText":""
}'
```
**4.6.7+**
```bash
curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list' \
--header 'Authorization: Bearer {{authorization}}' \
@@ -1054,10 +1128,13 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- pageNum: 偏移量(选填)
- pageNum: 页码(选填)
- pageSize: 每页数量最大30选填
- collectionId: 集合的ID必填
- searchText: 模糊搜索词(选填)
{{% /alert %}}
{{< /markdownify >}}
@@ -1173,7 +1250,7 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":"65abd4b29d1448617cba61db",
"dataId":"65abd4b29d1448617cba61db",
"q":"测试111",
"a":"sss",
"indexes":[
@@ -1196,7 +1273,7 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
{{< markdownify >}}
{{% alert icon=" " context="success" %}}
- id: 数据的id
- dataId: 数据的id
- q: 主要数据(选填)
- a: 辅助数据(选填)
- indexes: 自定义索引(选填),类型参考`为集合批量添加添加数据`。如果创建时候有自定义索引,

View File

@@ -53,9 +53,9 @@ weight: 860
在分享链接的地址中,增加一个额外的参数: authToken。例如
原始的链接:`https://share.fastgpt.in/chat/share?shareId=648aaf5ae121349a16d62192`
原始的链接:`https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192`
完整链接: `https://share.fastgpt.in/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
完整链接: `https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
这个`authToken`通常是你系统生成的用户唯一凭证Token之类的。FastGPT 会在鉴权接口的`body`中携带 token={{authToken}} 的参数。
@@ -227,7 +227,7 @@ curl --location --request POST '{{host}}/shareAuth/finish' \
"historyPreview": [
{
"obj": "Human",
"value": "使用 <Data></Data> 标记中的内容作为你的知识:\n\n<Data>\n导演是谁\n电影《铃芽之旅》的导演是新海诚。\n------\n电影《铃芽之旅》的编剧是谁22\n新海诚是本片的编剧。\n------\n电影《铃芽之旅》的女主角是谁\n电影的女主角是铃芽。\n------\n电影《铃芽之旅》的制作团队中有哪位著名人士2\n川村元气是本片的制作团队成员之一。\n------\n你是谁\n我是电影《铃芽之旅》助手\n------\n电影《铃芽之旅》男主角是谁\n电影《铃芽之旅》男主角是宗像草太由松村北斗配音。\n------\n电影《铃芽之旅》的作者新海诚写了一本小说叫什么名字\n小说名字叫《铃芽之旅》。\n------\n电影《铃芽之旅》的女主角是谁\n电影《铃芽之旅》的女主角是岩户铃芽由原菜乃华配音。\n------\n电影《铃芽之旅》的故事背景是什么\n日本\n------\n谁担任电影《铃芽之旅》中岩户环的配音\n深津绘里担任电影《铃芽之旅》中岩户环的配音。\n</Data>\n\n回答要求\n- 如果你不清楚答案,你需要澄清。\n- 避免提及你是从 <Data></Data> 获取的知识。\n- 保持答案与 <Data></Data> 中描述的一致。\n- 使用 Markdown 语法优化回答格式。\n- 使用与问题相同的语言回答。\n\n问题:\"\"\"导演是谁\"\"\""
"value": "使用 <Data></Data> 标记中的内容作为本次对话的参考:\n\n<Data>\n导演是谁\n电影《铃芽之旅》的导演是新海诚。\n------\n电影《铃芽之旅》的编剧是谁22\n新海诚是本片的编剧。\n------\n电影《铃芽之旅》的女主角是谁\n电影的女主角是铃芽。\n------\n电影《铃芽之旅》的制作团队中有哪位著名人士2\n川村元气是本片的制作团队成员之一。\n------\n你是谁\n我是电影《铃芽之旅》助手\n------\n电影《铃芽之旅》男主角是谁\n电影《铃芽之旅》男主角是宗像草太由松村北斗配音。\n------\n电影《铃芽之旅》的作者新海诚写了一本小说叫什么名字\n小说名字叫《铃芽之旅》。\n------\n电影《铃芽之旅》的女主角是谁\n电影《铃芽之旅》的女主角是岩户铃芽由原菜乃华配音。\n------\n电影《铃芽之旅》的故事背景是什么\n日本\n------\n谁担任电影《铃芽之旅》中岩户环的配音\n深津绘里担任电影《铃芽之旅》中岩户环的配音。\n</Data>\n\n回答要求\n- 如果你不清楚答案,你需要澄清。\n- 避免提及你是从 <Data></Data> 获取的知识。\n- 保持答案与 <Data></Data> 中描述的一致。\n- 使用 Markdown 语法优化回答格式。\n- 使用与问题相同的语言回答。\n\n问题:\"\"\"导演是谁\"\"\""
},
{
"obj": "AI",
@@ -387,9 +387,9 @@ export default async function (ctx: FunctionContext) {
### 3. 修改分享链接参数
源分享链接:`https://share.fastgpt.in/chat/share?shareId=64be36376a438af0311e599c`
源分享链接:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c`
修改后:`https://share.fastgpt.in/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
修改后:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
### 4. 测试效果

View File

@@ -19,15 +19,36 @@ FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、A
## 一键部署
Sealos 的服务器在国外,不需要额外处理网络问题,无需服务器、无需魔法、无需域名,支持高并发 & 动态伸缩。点击以下按钮即可一键部署 👇
使用 Sealos 服务,无需采购服务器、无需域名,支持高并发 & 动态伸缩,并且数据库应用采用 kubeblocks 的数据库,在 IO 性能方面,远超于简单的 Docker 容器部署。可以根据需求,再下面两个区域选择部署。
### 新加坡区
新加披区的服务器在国外,可以直接访问 OpenAI但国内用户需要梯子才可以正常访问新加坡区。国际区价格稍贵点击下面按键即可部署👇
<a href="https://template.cloud.sealos.io/deploy?templateName=fastgpt" rel="external" target="_blank"><img src="https://cdn.jsdelivr.net/gh/labring-actions/templates@main/Deploy-on-Sealos.svg" alt="Deploy on Sealos"/></a>
### 北京区
北京区服务提供商为火山云,国内用户可以稳定访问,但无法访问 OpenAI 等境外服务,价格约为新加坡区的 1/4。点击下面按键即可部署👇
<a href="https://bja.sealos.run/?openapp=system-template%3FtemplateName%3Dfastgpt" rel="external" target="_blank"><img src="https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg" alt="Deploy on Sealos"/></a>
### 开始部署
由于需要部署数据库,部署完后需要等待 2~4 分钟才能正常访问。默认用了最低配置,首次访问时会有些慢。
根据提示,输入`root_password`,和 `openai`/`oneapi` 的地址和密钥。
![](/imgs/sealos1.png)
点击 Sealos 提供的外网地址即可打开 FastGPT 的可视化界面
点击部署后,会跳转到应用管理页面。可以点击`fastgpt`主应用右侧的详情按键(名字为 fastgpt-xxxx 如下图所示
![](/imgs/sealos-deploy1.jpg)
点击详情后,会跳转到 fastgpt 的部署管理页面,点击外网访问地址中的链接,即可打开 fastgpt 服务。
如需绑定自定义域名、修改部署参数,可以点击右上角变更,根据 sealos 的指引完成。
![](/imgs/sealos2.png)
@@ -53,6 +74,10 @@ Sealos 的服务器在国外,不需要额外处理网络问题,无需服务
点击变更或重启会自动拉取镜像更新,请确保镜像`tag`正确。建议不要使用`latest`,改成固定版本号。
## 收费
Sealos 采用按量计费的方式,也就是申请了多少 cpu、内存、磁盘就按该申请量进行计费。具体的计费标准可以打开`sealos`控制面板中的`费用中心`进行查看。
## Sealos 使用
### 简介
@@ -64,7 +89,7 @@ FastGPT 商业版共包含了2个应用fastgpt, fastgpt-plus和2个数据
点击右侧的详情,可以查看对应应用的详细信息。
### 如何更新/升级 FastGPT
[升级脚本文档](https://doc.fastgpt.in/docs/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
[升级脚本文档](https://doc.tryfastgpt.ai/docs/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
例如目前是4.5 版本要升级到4.5.1就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
@@ -99,7 +124,7 @@ FastGPT 商业版共包含了2个应用fastgpt, fastgpt-plus和2个数据
![](/imgs/onsealos5.png)
[配置文件参考](https://doc.fastgpt.in/docs/development/configuration/)
[配置文件参考](https://doc.tryfastgpt.ai/docs/development/configuration/)
### 修改站点名称以及 favicon
修改应用的环境变量,增加

View File

@@ -7,6 +7,15 @@ toc: true
weight: 827
---
## 修改商业版环境变量
增加 oneapi 地址和令牌。
```
OPENAI_BASE_URL=http://oneapi:3000/v1
CHAT_API_KEY=sk-fastgpt
```
## 初始化脚本
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`{{host}} 替换成自己域名

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