0.0.38 • Published 6 months ago

claude-revert-api v0.0.38

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

claude-revert-api

A wrapper of the claude 2. Basicly use the axios mock a sdk. For my project switch to claude2. Code will be open source. I still test for it. If you have more requirement just send email to 3173991952@qq.com or follow my twitter

And feel free open an issue or PR.

Document: https://parsedark.github.io/claude-revert-api/

NPM version NPM downloads

Install

// npm 
npm install claude-revert-api

// pnpm 
pnpm install claude-revert-api

Develop

pnpm install
$ npm run dev
$ npm run build

Usage 1: only use the sdk

// baseURL?: string
// uuid: string;
// organization_uuid: organizationType;
// sessionKey: string;
// name?: string;
createConversationSDK
// baseURL?: string
// sessionKey: string;
// prompt: string;
// metadata: IMetadata;
appendMessageSDK
// baseURL?: string
// organization_uuid: organizationType;
// sessionKey: string;
conversationListSDK
// baseURL?: string
// sessionKey: string;
// organization_uuid: organizationType;
// conversation_uuid: conversationType;
deleteConversationSDK
//   baseURL?: string
//   sessionKey: string;
//   organization_uuid: organizationType;
//   conversation_uuid: conversationType;
getConversationSDK
// baseURL?: string
// organization_uuid: organizationType;
// conversation_uuid: conversationType;
// sessionKey: string;
// title: string;
renameConversationSDK

Usage 2: if need to customize the base_url or token

for this usage i think your are not the claude api support region. So we need to do a proxy. When use the proxy will change the base url. So you need to use this OOP style.

// ClaudeRevertAPI(baseURL: string, sessionKey: string)
const claude = new ClaudeRevertAPI("https://claude.ai", "sessionKey");

// create a new chat session
claude.createConversation(organization_uuid: string)
// post a new message session
claude.appendMessage(prompt: string, metadata: IMetadata)
// get all chat session
claude.conversationList(organization_uuid: string)
// delete chat session
claude.deleteConversation(organization_uuid: organizationType, conversation_uuid: conversationType)
// get history message 
claude.getConversation(organization_uuid: organizationType, conversation_uuid: conversationType)
// rename your session
claude.renameConversation(title: string,organization_uuid: organizationType, conversation_uuid: conversationType)

Pending issue

  1. axios browser call streaming issue. If you use the sdk to the browser. The appendMessage SDK can't be a stream response. Only return all of thing one time. It's will cause long response time.

Have fun for it.

LICENSE

MIT

0.0.38

6 months ago

0.0.37

6 months ago

0.0.36

10 months ago

0.0.35

10 months ago

0.0.34

10 months ago

0.0.33

10 months ago

0.0.32

10 months ago

0.0.30

10 months ago

0.0.29

10 months ago

0.0.28

10 months ago

0.0.27

10 months ago

0.0.26

10 months ago

0.0.25

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago