feat: create a chat assistant and extract SimilaritySlider (#67)
* feat: extract SimilaritySlider * feat: create a chat assistant
This commit is contained in:
@@ -42,4 +42,14 @@ export default {
|
||||
document_create: `${api_host}/document/create`,
|
||||
document_run: `${api_host}/document/run`,
|
||||
document_change_parser: `${api_host}/document/change_parser`,
|
||||
|
||||
setDialog: `${api_host}/dialog/set`,
|
||||
getDialog: `${api_host}/dialog/get`,
|
||||
listDialog: `${api_host}/dialog/list`,
|
||||
|
||||
setConversation: `${api_host}/conversation/set`,
|
||||
getConversation: `${api_host}/conversation/get`,
|
||||
listConversation: `${api_host}/conversation/list`,
|
||||
removeConversation: `${api_host}/conversation/rm`,
|
||||
completeConversation: `${api_host}/conversation/completion`,
|
||||
};
|
||||
|
||||
@@ -5,22 +5,23 @@
|
||||
*/
|
||||
// import numeral from 'numeral';
|
||||
|
||||
import JSEncrypt from 'jsencrypt';
|
||||
import { Base64 } from 'js-base64';
|
||||
import JSEncrypt from 'jsencrypt';
|
||||
|
||||
export const getWidth = () => {
|
||||
return { width: window.innerWidth };
|
||||
};
|
||||
export const rsaPsw = (password: string) => {
|
||||
const pub = "-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB-----END PUBLIC KEY-----"
|
||||
const encryptor = new JSEncrypt()
|
||||
const pub =
|
||||
'-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB-----END PUBLIC KEY-----';
|
||||
const encryptor = new JSEncrypt();
|
||||
|
||||
encryptor.setPublicKey(pub)
|
||||
encryptor.setPublicKey(pub);
|
||||
|
||||
return encryptor.encrypt(Base64.encode(password))
|
||||
}
|
||||
return encryptor.encrypt(Base64.encode(password));
|
||||
};
|
||||
|
||||
export default {
|
||||
getWidth,
|
||||
rsaPsw
|
||||
rsaPsw,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user