Skip to content
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

Open
wants to merge 4 commits into
base: 12.0
Choose a base branch
from

Conversation

cir9no
Copy link
Contributor

@cir9no cir9no commented Jul 7, 2024

No description provided.

requirements.txt Show resolved Hide resolved

EMBEDDING_API_TYPE = 'sea-embedding'

# seafile config database
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RepoData 需要传的参数你不是已经去掉了吗,这些功能需要测试一下,看看是否正常

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)
Copy link
Contributor

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 中


FILE_SERVER = ''

APP_NAME = 'semantic-search'
Copy link
Contributor

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()
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要放到test文件夹下?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个放到script 文件夹在

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db.py seafevents 中有不需要加了

Copy link
Contributor

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')
Copy link
Contributor

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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要写成这样呢?

@cir9no cir9no force-pushed the 12.0-feat-integrate-seafile-ai-search branch from 9caa367 to ab7e0ea Compare July 17, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants