-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: integrate-seafile-ai-search #337
base: 12.0
Are you sure you want to change the base?
Conversation
semantic_search/config.py
Outdated
|
||
EMBEDDING_API_TYPE = 'sea-embedding' | ||
|
||
# seafile config database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个配置还有用吗
config.DB_NAME, config.DB_UNIX_SOCKET) | ||
seasearch_api = SeaSearchAPI(config.SEASEARCH_SERVER, config.SEASEARCH_TOKEN) | ||
repo_status_filename_index = RepoStatusIndex(seasearch_api, REPO_STATUS_FILENAME_INDEX_NAME) | ||
repo_data = RepoData(config.MYSQL_HOST, config.MYSQL_PORT, config.MYSQL_USER, config.MYSQL_PASSWORD, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RepoData 需要传的参数你不是已经去掉了吗,这些功能需要测试一下,看看是否正常
semantic_search/semantic_search.py
Outdated
self.repo_filename_index = RepoFileNameIndex(self.seasearch_api, self.repo_data) | ||
index_task_manager.init(self) | ||
self.index_task_manager = index_task_manager | ||
self._repo_filename_index_updater = RepoFilenameIndexUpdater(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_repo_filename_index_updater这个应该是个后台任务, index_task_manager 应该和其他的一样,放到SeafEventServer 中
semantic_search/config.py
Outdated
|
||
FILE_SERVER = '' | ||
|
||
APP_NAME = 'semantic-search' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FILE_SERVER 还有APP_NAME 这个有用到吗?其他的也检查一下,没用的都删掉
logger = logging.getLogger(__name__) | ||
import os | ||
|
||
current_directory = os.getcwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个有用吗?
app/app.py
Outdated
@@ -25,7 +26,10 @@ def __init__(self, config, ccnet_config, seafile_config, | |||
self._seafevent_server = SeafEventServer(self, config) | |||
|
|||
if self._bg_tasks_enabled: | |||
self._index_updater = IndexUpdater(config) | |||
if ENABLE_SEAFILE_AI: | |||
self._index_updater = sem_app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该拆出来,这个里面只能放后台程序
@@ -0,0 +1,143 @@ | |||
# portalocker.py - Cross-platform (posix/nt) API for flock-style file locking. | |||
# Requires python 1.5.2 or better. | |||
'''Cross-platform (posix/nt) API for flock-style file locking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么要放到test文件夹下?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个放到script 文件夹在
semantic_search/db.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db.py seafevents 中有不需要加了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类似这样的,不要加sem这个前缀
import os | ||
import logging | ||
|
||
logger = logging.getLogger('seafile_ai') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有seafile-ai
from seafevents.semantic_search.utils.constants import REPO_STATUS_FILE_INDEX_NAME | ||
|
||
MAX_ERRORS_ALLOWED = 1000 | ||
logger = logging.getLogger('seafevents.semantic_search') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么要写成这样呢?
9caa367
to
ab7e0ea
Compare
No description provided.