mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-10 20:35:17 +02:00
fix: Baidu search UI rendering and clean debug code
- Fix: Add BAIDU_SEARCH_API to direct render sources - Fix: Remove API key exposure in debug logs - Resolves 404 error when clicking Baidu search results
This commit is contained in:
parent
beaf8f89a6
commit
a479fea588
2 changed files with 4 additions and 5 deletions
|
|
@ -607,8 +607,6 @@ class ConnectorService:
|
|||
"type": "BAIDU_SEARCH_API",
|
||||
"sources": [],
|
||||
}, []
|
||||
|
||||
print(f"DEBUG: Using Baidu API Key: {api_key[:20]}... (length: {len(api_key)})")
|
||||
|
||||
# Optional configuration parameters
|
||||
model = config.get("BAIDU_MODEL", "ernie-3.5-8k")
|
||||
|
|
@ -708,8 +706,6 @@ class ConnectorService:
|
|||
# Extract references (search results) from the response
|
||||
baidu_references = data.get("references", [])
|
||||
|
||||
print(f"DEBUG: Baidu API returned {len(baidu_references)} references")
|
||||
|
||||
if "code" in data or "message" in data:
|
||||
print(f"WARNING: Baidu API returned error - Code: {data.get('code')}, Message: {data.get('message')}")
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ export function SourceDetailSheet({
|
|||
|
||||
// Check if this is a source type that should render directly from node
|
||||
const isDirectRenderSource =
|
||||
sourceType === "TAVILY_API" || sourceType === "LINKUP_API" || sourceType === "SEARXNG_API";
|
||||
sourceType === "TAVILY_API" ||
|
||||
sourceType === "LINKUP_API" ||
|
||||
sourceType === "SEARXNG_API" ||
|
||||
sourceType === "BAIDU_SEARCH_API";
|
||||
|
||||
useEffect(() => {
|
||||
if (open && chunkId && !isDirectRenderSource) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue