Merge branch 'ingestion-flow' into langflow-ingestion-modes

This commit is contained in:
Edwin Jose 2025-09-08 19:32:41 -04:00 committed by GitHub
commit 1c5e61abdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 72 additions and 54 deletions

View file

@ -42,7 +42,7 @@ dev:
docker-compose up -d
@echo "✅ Services started!"
@echo " Backend: http://localhost:8000"
@echo " Frontend: http://localhost:3000"
@echo " Frontend: http://localhost:3000"
@echo " Langflow: http://localhost:7860"
@echo " OpenSearch: http://localhost:9200"
@echo " Dashboards: http://localhost:5601"
@ -93,7 +93,7 @@ clean: stop
backend:
@echo "🐍 Starting backend locally..."
@if [ ! -f .env ]; then echo "⚠️ .env file not found. Copy .env.example to .env first"; exit 1; fi
cd src && uv run python main.py
uv run python src/main.py
frontend:
@echo "⚛️ Starting frontend locally..."
@ -187,7 +187,7 @@ db-reset:
curl -X DELETE "http://localhost:9200/knowledge_filters" -u admin:$$(grep OPENSEARCH_PASSWORD .env | cut -d= -f2) || true
@echo "Indices reset. Restart backend to recreate."
# Flow management
# Flow management
flow-upload:
@echo "📁 Uploading flow to Langflow..."
@if [ -z "$(FLOW_FILE)" ]; then echo "Usage: make flow-upload FLOW_FILE=path/to/flow.json"; exit 1; fi

File diff suppressed because one or more lines are too long

View file

@ -82,15 +82,13 @@ class LangflowFileService:
# Pass files via tweaks to File component (File-PSU37 from the flow)
if file_paths:
tweaks["File-PSU37"] = {"path": file_paths}
tweaks["File-PSU37"] = {"file_path": file_paths}
# Pass JWT token via tweaks using the x-langflow-global-var- pattern
if jwt_token:
# Using the global variable pattern that Langflow expects for OpenSearch components
tweaks["OpenSearchHybrid-Ve6bS"] = {"jwt_token": jwt_token}
logger.debug(
"[LF] Added JWT token to tweaks for OpenSearch components"
)
logger.debug("[LF] Added JWT token to tweaks for OpenSearch components")
else:
logger.warning("[LF] No JWT token provided")
if tweaks:

View file

@ -1,4 +1,4 @@
from typing import Any, Dict, Optional
from typing import Any, Dict
from agentd.tool_decorator import tool
from config.settings import clients, INDEX_NAME, EMBED_MODEL
from auth_context import get_auth_context
@ -166,11 +166,11 @@ class SearchService:
for hit in results["hits"]["hits"]:
chunks.append(
{
"filename": hit["_source"]["filename"],
"mimetype": hit["_source"]["mimetype"],
"page": hit["_source"]["page"],
"text": hit["_source"]["text"],
"score": hit["_score"],
"filename": hit["_source"].get("filename"),
"mimetype": hit["_source"].get("mimetype"),
"page": hit["_source"].get("page"),
"text": hit["_source"].get("text"),
"score": hit.get("_score"),
"source_url": hit["_source"].get("source_url"),
"owner": hit["_source"].get("owner"),
"owner_name": hit["_source"].get("owner_name"),