feat(backend): deliver Phase 3 document and voice integration
Add authenticated upload, review, retry and knowledge-selection HTTP flows with bounded JSON processing and frozen OCR policy. Preserve Gemini/OpenAI provider selection and fenced lifecycle semantics; retain FAQ preambles and uncertain vision candidates, and expose opt-in uncalibrated voice transport diagnostics. Include frontend integration examples, aligned contracts and deterministic regressions. Validation: 1767 provider-free tests passed; all 404 PostgreSQL scenarios have passing evidence across the documented runs.
This commit is contained in:
@@ -183,9 +183,24 @@ class SearchToolRunner:
|
||||
self._lock.wait_for(lambda: self._admitted == 0)
|
||||
|
||||
|
||||
def prepare_search_tools():
|
||||
"""Resolve the optional framework before voice admission/tool deadlines."""
|
||||
try:
|
||||
from langchain_core.tools import StructuredTool
|
||||
except ModuleNotFoundError as exc:
|
||||
# Document-only API installations keep the existing optional boundary.
|
||||
if exc.name != 'langchain_core':
|
||||
raise
|
||||
return None
|
||||
# Importing StructuredTool resolves its callback/configuration dependencies.
|
||||
return StructuredTool
|
||||
|
||||
|
||||
def create_search_tool(service, context, runner):
|
||||
"""Build only on explicit opt-in; core imports do not require LangChain."""
|
||||
from langchain_core.tools import StructuredTool
|
||||
StructuredTool = prepare_search_tools()
|
||||
if StructuredTool is None:
|
||||
raise ModuleNotFoundError('Install the existing search/voice extra for LangChain tools')
|
||||
|
||||
trusted = context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user