bilisum 1.20.0 → 1.20.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/runtime/VERSION +1 -1
  3. package/runtime/apps/service/pyproject.toml +1 -1
  4. package/runtime/apps/service/src/video_sum_service/integrations.py +4 -2
  5. package/runtime/apps/service/src/video_sum_service/knowledge/local_llm.py +9 -2
  6. package/runtime/apps/service/src/video_sum_service/repository.py +800 -24
  7. package/runtime/apps/service/src/video_sum_service/routers/system.py +27 -8
  8. package/runtime/apps/service/src/video_sum_service/routers/videos.py +238 -0
  9. package/runtime/apps/service/src/video_sum_service/runtime_support.py +117 -8
  10. package/runtime/apps/service/src/video_sum_service/schemas.py +83 -0
  11. package/runtime/apps/service/src/video_sum_service/settings_manager.py +30 -13
  12. package/runtime/apps/service/src/video_sum_service/video_assets.py +119 -10
  13. package/runtime/apps/service/src/video_sum_service/worker.py +101 -68
  14. package/runtime/apps/web/static/assets/bilibili-collection-playground-cover.jpg +0 -0
  15. package/runtime/apps/web/static/assets/index-C7oXjkaa.js +357 -0
  16. package/runtime/apps/web/static/assets/index-yuQWwUSR.css +1 -0
  17. package/runtime/apps/web/static/collection-badge-playground.html +126 -0
  18. package/runtime/apps/web/static/collection-border-playground.html +173 -0
  19. package/runtime/apps/web/static/index.html +2 -2
  20. package/runtime/apps/web/static/js/main.js +2 -0
  21. package/runtime/apps/web/static/js/views/settings.js +6 -0
  22. package/runtime/packages/core/pyproject.toml +1 -1
  23. package/runtime/packages/core/src/video_sum_core/models/tasks.py +78 -0
  24. package/runtime/packages/core/src/video_sum_core/pipeline/real.py +462 -43
  25. package/runtime/packages/infra/pyproject.toml +1 -1
  26. package/runtime/packages/infra/src/video_sum_infra/config.py +40 -1
  27. package/runtime/packages/infra/src/video_sum_infra/runtime.py +43 -1
  28. package/runtime/apps/web/static/assets/index-KvLZ2oI3.css +0 -1
  29. package/runtime/apps/web/static/assets/index-opES5zaV.js +0 -357
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bilisum",
3
- "version": "1.20.0",
3
+ "version": "1.20.1-alpha.2",
4
4
  "description": "BiliSum CLI: control the installed BiliSum app, or run standalone with its own runtime.",
5
5
  "bin": {
6
6
  "bilisum": "bin/bilisum.js"
package/runtime/VERSION CHANGED
@@ -1 +1 @@
1
- 1.20.0
1
+ 1.20.1-alpha.2
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "video-sum-service"
7
- version = "1.20.0"
7
+ version = "1.20.1-alpha.2"
8
8
  description = "Local backend service for the video summarizer."
9
9
  requires-python = ">=3.12"
10
10
  dependencies = [
@@ -3,6 +3,7 @@ import binascii
3
3
  import importlib.resources
4
4
  import io
5
5
  import json
6
+ import logging
6
7
  import os
7
8
  from pathlib import Path
8
9
  import struct
@@ -28,6 +29,8 @@ from video_sum_infra.runtime import service_log_path
28
29
  from video_sum_service.context import COVER_CACHE_DIR, settings_manager
29
30
  from video_sum_service.settings_manager import SettingsUpdatePayload, is_blank_or_masked_secret
30
31
 
32
+ logger = logging.getLogger(__name__)
33
+
31
34
  MAX_LOG_CHARS = 20_000
32
35
  MAX_LOG_LINE_CHARS = 1_000
33
36
 
@@ -134,7 +137,7 @@ def cache_cover_image(source_url: str, canonical_id: str, referer_url: str | Non
134
137
 
135
138
  # 视频封面 URL 白名单
136
139
  ALLOWED_COVER_DOMAINS = [
137
- "bilibili.com", "hdslb.com", "bilivideo.com", # B站
140
+ "bilibili.com", "hdslb.com", "bilivideo.com", "biliimg.com", # B站
138
141
  "ytimg.com", "ggpht.com", "googleusercontent.com", # YouTube
139
142
  "twimg.com", # Twitter
140
143
  ]
@@ -330,7 +333,6 @@ def probe_llm_connection(payload: SettingsUpdatePayload | None = None) -> dict[s
330
333
  ],
331
334
  "temperature": 0,
332
335
  "max_tokens": 256,
333
- "response_format": {"type": "json_object"},
334
336
  }
335
337
  else:
336
338
  request_payload = {
@@ -97,6 +97,12 @@ def chat_knowledge_llm(
97
97
  require_json: bool = False,
98
98
  _allow_empty_retry: bool = True,
99
99
  ) -> tuple[str, dict[str, object] | None]:
100
+ """调用知识库 LLM。
101
+
102
+ 注意:`require_json` 不再设置 `response_format: json_object` ——
103
+ 许多本地 LLM 后端(Ollama、llama.cpp、vLLM)会因该参数返回 400。
104
+ 输出格式靠 system prompt 指示模型只输出合法 JSON。
105
+ """
100
106
  base_url, model, api_key, provider = ensure_knowledge_llm_settings(settings)
101
107
  use_anthropic = is_anthropic_llm(provider, base_url)
102
108
  request_model = model if use_anthropic else normalize_openai_compatible_model_name(model)
@@ -117,8 +123,9 @@ def chat_knowledge_llm(
117
123
  "temperature": temperature,
118
124
  "max_tokens": max_tokens,
119
125
  }
120
- if require_json:
121
- payload["response_format"] = {"type": "json_object"}
126
+ # 说明:有意不传 response_format(json_object)
127
+ # 本地 LLM 后端(Ollama/llama.cpp/vLLM 等)不支持该参数,会返回 400
128
+ # 输出格式靠 system prompt 中"只输出合法 JSON"约束
122
129
  if not use_anthropic and _should_disable_deepseek_thinking(base_url, request_model):
123
130
  payload["thinking"] = {"type": "disabled"}
124
131
  request_url = anthropic_messages_url(base_url) if use_anthropic else openai_chat_completions_url(base_url)