Feat/add ruby sdk (#583)

This commit is contained in:
crazywoola 2023-07-18 10:18:58 +08:00 • committed by GitHub
commit cb6e73347e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 460 additions and 2 deletions

View file

@ -20,16 +20,20 @@ export const routes = {
},
getConversationMessages: {
method: "GET",
url: () => "/messages",
url: () => `/messages`,
},
getConversations: {
method: "GET",
url: () => "/conversations",
url: () => `/conversations`,
},
renameConversation: {
method: "PATCH",
url: (conversation_id) => `/conversations/${conversation_id}`,
},
deleteConversation: {
method: "DELETE",
url: (conversation_id) => `/conversations/${conversation_id}`,
},
};
export class DifyClient {
@ -185,4 +189,13 @@ export class ChatClient extends DifyClient {
data
);
}
deleteConversation(conversation_id, user) {
const data = { user };
return this.sendRequest(
routes.deleteConversation.method,
routes.deleteConversation.url(conversation_id),
data
);
}
}