Refactor text chunking implementation and update configuration
- Moved SentenceTextChunker and SentenceTextChunkerConfig to the utils module for better organization. - Updated pytest.ini to include the current directory in the Python path. - Added a new utils module with shared utility helpers. - Adjusted import paths in the test files to reflect the new location of text chunking classes.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
[pytest]
|
[pytest]
|
||||||
|
pythonpath = .
|
||||||
markers =
|
markers =
|
||||||
integration: marks tests that need access to external services
|
integration: marks tests that need access to external services
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from fastgpt_client.exceptions import (
|
|||||||
)
|
)
|
||||||
from ..core.fastgpt_client import get_fastgpt_client
|
from ..core.fastgpt_client import get_fastgpt_client
|
||||||
from ..core.config import Config
|
from ..core.config import Config
|
||||||
from ..voice.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
|
from ..utils.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|||||||
1
src/utils/__init__.py
Normal file
1
src/utils/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""Shared utility helpers."""
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from src.voice.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
|
from src.utils.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
|
||||||
|
|
||||||
|
|
||||||
def test_chinese_sentence_chunks_wait_for_lookahead():
|
def test_chinese_sentence_chunks_wait_for_lookahead():
|
||||||
|
|||||||
Reference in New Issue
Block a user