Compare commits

...

2 commits

Author SHA1 Message Date
4e33cc26dd Merge branch 'int'
All checks were successful
Deploy Plattform-Core / test (push) Successful in 46s
Deploy Plattform-Core / deploy (push) Successful in 4s
2026-06-04 23:22:43 +02:00
76753f6037 fix data connector readfile
All checks were successful
Deploy Plattform-Core (Int) / test (push) Successful in 1m2s
Deploy Plattform-Core (Int) / deploy (push) Successful in 8s
2026-06-04 23:20:28 +02:00

View file

@ -61,13 +61,11 @@ def _registerConnectionTools(registry: ToolRegistry, services):
)
adapter = await resolver.resolveService(connectionId, service)
chatService = services.chat
fileContent = chatService.getFileContent(fileId)
if not fileContent:
fileData = chatService.getFileData(fileId)
if not fileData:
return ToolResult(toolCallId="", toolName="uploadToExternal", success=False, error="File not found")
fileData = fileContent.get("data", b"") if isinstance(fileContent, dict) else b""
if isinstance(fileData, str):
fileData = fileData.encode("utf-8")
fileName = fileContent.get("fileName", "file") if isinstance(fileContent, dict) else "file"
fileInfo = chatService.getFileInfo(fileId)
fileName = (fileInfo or {}).get("fileName", "file")
result = await adapter.upload(path, fileData, fileName)
return ToolResult(toolCallId="", toolName="uploadToExternal", success=True, data=str(result))
except Exception as e: