fix
This commit is contained in:
parent
d664cdce00
commit
d2611ff498
1 changed files with 15 additions and 0 deletions
|
|
@ -20,6 +20,21 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
def _registerDataSourceTools(registry: ToolRegistry, services):
|
||||
"""Auto-extracted from registerCoreTools."""
|
||||
|
||||
def _buildResolverDb():
|
||||
"""Build a DB adapter that ConnectorResolver can use to load UserConnections.
|
||||
interfaceDbApp has getUserConnectionById; ConnectorResolver expects getUserConnection."""
|
||||
chatService = services.chat
|
||||
appIf = getattr(chatService, "interfaceDbApp", None)
|
||||
if appIf and hasattr(appIf, "getUserConnectionById"):
|
||||
class _Adapter:
|
||||
def __init__(self, app):
|
||||
self._app = app
|
||||
def getUserConnection(self, connectionId: str):
|
||||
return self._app.getUserConnectionById(connectionId)
|
||||
return _Adapter(appIf)
|
||||
return getattr(chatService, "interfaceDbComponent", None)
|
||||
|
||||
# ---- DataSource convenience tools ----
|
||||
_SOURCE_TYPE_TO_SERVICE = {
|
||||
"sharepointFolder": "sharepoint",
|
||||
|
|
|
|||
Loading…
Reference in a new issue