From d76d1adb591d43bce15a0e665e6db838840529da Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 29 Jan 2024 12:57:39 +0800 Subject: [PATCH] feat: Nodejs sdk support auto rename conversation api (#2265) --- sdks/nodejs-client/index.js | 8 ++++---- sdks/nodejs-client/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdks/nodejs-client/index.js b/sdks/nodejs-client/index.js index 584ee8743b..b59d9c42e7 100644 --- a/sdks/nodejs-client/index.js +++ b/sdks/nodejs-client/index.js @@ -27,8 +27,8 @@ export const routes = { url: () => `/conversations`, }, renameConversation: { - method: "PATCH", - url: (conversation_id) => `/conversations/${conversation_id}`, + method: "POST", + url: (conversation_id) => `/conversations/${conversation_id}/name`, }, deleteConversation: { method: "DELETE", @@ -204,8 +204,8 @@ export class ChatClient extends DifyClient { ); } - renameConversation(conversation_id, name, user) { - const data = { name, user }; + renameConversation(conversation_id, name, user, auto_generate) { + const data = { name, user, auto_generate }; return this.sendRequest( routes.renameConversation.method, routes.renameConversation.url(conversation_id), diff --git a/sdks/nodejs-client/package.json b/sdks/nodejs-client/package.json index 30de613f30..8bd08befc9 100644 --- a/sdks/nodejs-client/package.json +++ b/sdks/nodejs-client/package.json @@ -1,6 +1,6 @@ { "name": "dify-client", - "version": "2.1.0", + "version": "2.2.0", "description": "This is the Node.js SDK for the Dify.AI API, which allows you to easily integrate Dify.AI into your Node.js applications.", "main": "index.js", "type": "module",