mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-20 00:14:50 +00:00
Add a default chat to the Telegram connector
A Telegram connection can now hold an optional default chat ID. When it is set, both Telegram actions send there, the model is no longer asked for a chat, and a chat it names anyway is ignored. In member mode each member's own connection supplies their own chat. The same bot with a different chat is a separate connection.
This commit is contained in:
1 parent
744cfde565
commit
c3e83ff9dd
8 files changed
+253
-26
No files matched your search
@@ -256,7 +256,8 @@ class ConnectionSetup(Resource):
|
||||
conn, user_id, row, permissions=body.get("tool_permissions") or None,
|
||||
mcp_actions=mcp_actions,
|
||||
)
|
||||
tool_payload = [service.serialize_tool(tool) for tool in tools]
|
||||
account_parameters = service.connection_parameters(row)
|
||||
tool_payload = [service.serialize_tool(tool, account_parameters) for tool in tools]
|
||||
sources = []
|
||||
if body.get("sync"):
|
||||
started = _start_sync(user_id, row, body["sync"])
|
||||
@@ -514,7 +515,7 @@ class ConnectionToolPermissions(Resource):
|
||||
tool = service.set_tool_permissions(conn, user_id, connection_id, tool_id, permissions)
|
||||
if tool is None:
|
||||
return _not_found()
|
||||
payload = service.serialize_tool(tool)
|
||||
payload = service.serialize_tool(tool, service.connection_parameters(row))
|
||||
return make_response(jsonify({"success": True, "tool": payload}), 200)
|
||||
|
||||
|
||||
@@ -544,7 +545,7 @@ class ConnectionToolParameters(Resource):
|
||||
return _error(str(err), 400)
|
||||
if tool is None:
|
||||
return _not_found()
|
||||
payload = service.serialize_tool(tool)
|
||||
payload = service.serialize_tool(tool, service.connection_parameters(row))
|
||||
return make_response(jsonify({"success": True, "tool": payload}), 200)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user