Unverified Commit d76d1adb authored by Joel's avatar Joel Committed by GitHub

feat: Nodejs sdk support auto rename conversation api (#2265)

parent cadc6b17
...@@ -27,8 +27,8 @@ export const routes = { ...@@ -27,8 +27,8 @@ export const routes = {
url: () => `/conversations`, url: () => `/conversations`,
}, },
renameConversation: { renameConversation: {
method: "PATCH", method: "POST",
url: (conversation_id) => `/conversations/${conversation_id}`, url: (conversation_id) => `/conversations/${conversation_id}/name`,
}, },
deleteConversation: { deleteConversation: {
method: "DELETE", method: "DELETE",
...@@ -204,8 +204,8 @@ export class ChatClient extends DifyClient { ...@@ -204,8 +204,8 @@ export class ChatClient extends DifyClient {
); );
} }
renameConversation(conversation_id, name, user) { renameConversation(conversation_id, name, user, auto_generate) {
const data = { name, user }; const data = { name, user, auto_generate };
return this.sendRequest( return this.sendRequest(
routes.renameConversation.method, routes.renameConversation.method,
routes.renameConversation.url(conversation_id), routes.renameConversation.url(conversation_id),
......
{ {
"name": "dify-client", "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.", "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", "main": "index.js",
"type": "module", "type": "module",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment