mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 14:17:08 +00:00
refactor: rename the application package to docsgpt
The backend import package is now docsgpt, the name it will carry on PyPI; application was far too generic to install into anyone's site-packages. git mv plus a mechanical rewrite of every import, dotted string and path reference: 734 Python files, the compose files, Dockerfile, workflows, docs, setup scripts, devcontainer, k8s manifests, vscode config, pytest and coverage config, .gitignore. Behaviour is unchanged. Kept for one release: - A top-level application package whose meta-path finder resolves application.x.y to the already-imported docsgpt.x.y object, so old imports and entry points (celery -A application.app.celery, uvicorn application.asgi:asgi_app) keep working with a FutureWarning. - Celery registers every application.* task name as an alias of its docsgpt.* task on start-up, so messages queued by the previous release still run. The redbeat key prefix moves to redbeat:docsgpt:v2: so schedule entries the previous release wrote are left unread instead of firing twice. The backend image builds from the repository root (docker build -f docsgpt/Dockerfile .) so it can ship the alias package; a root .dockerignore allow-lists docsgpt/ and application/ and keeps caches, local data, .env files, the sample index files and the Dockerfile out. Compose and the image workflows point at the new context.
This commit is contained in:
1 parent
3e7f1f91b4
commit
574f96341e
984 files changed
+9847
-9682
No files matched your search
@@ -2,13 +2,13 @@
|
||||
Tests for model validation and base_url functionality
|
||||
"""
|
||||
import pytest
|
||||
from application.core.model_settings import (
|
||||
from docsgpt.core.model_settings import (
|
||||
AvailableModel,
|
||||
ModelCapabilities,
|
||||
ModelProvider,
|
||||
ModelRegistry,
|
||||
)
|
||||
from application.core.model_utils import (
|
||||
from docsgpt.core.model_utils import (
|
||||
get_base_url_for_model,
|
||||
validate_model_id,
|
||||
)
|
||||
@@ -98,7 +98,7 @@ def test_get_base_url_for_model():
|
||||
@pytest.mark.unit
|
||||
def test_model_validation_error_message():
|
||||
"""Test that validation provides helpful error messages"""
|
||||
from application.api.answer.services.stream_processor import StreamProcessor
|
||||
from docsgpt.api.answer.services.stream_processor import StreamProcessor
|
||||
|
||||
# Create processor with invalid model_id
|
||||
data = {"model_id": "invalid-model-xyz"}
|
||||
@@ -122,7 +122,7 @@ def test_capabilities_reasoning_effort_defaults_none():
|
||||
@pytest.mark.unit
|
||||
def test_yaml_reasoning_effort_and_upstream_model_id(tmp_path):
|
||||
"""Two distinct ids can share one upstream model, each with its own effort."""
|
||||
from application.core.model_yaml import load_model_yamls
|
||||
from docsgpt.core.model_yaml import load_model_yamls
|
||||
|
||||
(tmp_path / "openai.yaml").write_text(
|
||||
"provider: openai\n"
|
||||
@@ -153,7 +153,7 @@ def test_yaml_reasoning_effort_and_upstream_model_id(tmp_path):
|
||||
@pytest.mark.unit
|
||||
def test_yaml_invalid_reasoning_effort_rejected(tmp_path):
|
||||
"""A bad reasoning_effort value aborts the YAML load."""
|
||||
from application.core.model_yaml import ModelYAMLError, load_model_yamls
|
||||
from docsgpt.core.model_yaml import ModelYAMLError, load_model_yamls
|
||||
|
||||
(tmp_path / "openai.yaml").write_text(
|
||||
"provider: openai\n"
|
||||
@@ -170,7 +170,7 @@ def test_yaml_invalid_reasoning_effort_rejected(tmp_path):
|
||||
@pytest.mark.unit
|
||||
def test_yaml_reasoning_effort_accepts_full_enum(tmp_path):
|
||||
"""Every value OpenAI documents across the GPT-5 series must parse."""
|
||||
from application.core.model_yaml import (
|
||||
from docsgpt.core.model_yaml import (
|
||||
VALID_REASONING_EFFORTS,
|
||||
load_model_yamls,
|
||||
)
|
||||
@@ -199,7 +199,7 @@ def test_yaml_reasoning_effort_accepts_full_enum(tmp_path):
|
||||
@pytest.mark.unit
|
||||
def test_openai_apply_reasoning_effort():
|
||||
"""OpenAILLM injects reasoning_effort from capabilities; caller wins."""
|
||||
from application.llm.openai import OpenAILLM
|
||||
from docsgpt.llm.openai import OpenAILLM
|
||||
|
||||
llm = OpenAILLM.__new__(OpenAILLM)
|
||||
|
||||
|
||||
Reference in new issue
Block a user