feat: Support for conversational streaming (#809)

### What problem does this PR solve?

feat: Support for conversational streaming
#709

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-05-16 20:15:02 +08:00
committed by GitHub
parent 95f809187e
commit c6c9dbde64
21 changed files with 424 additions and 255 deletions

View File

@@ -1,5 +1,5 @@
import { Authorization, Token, UserInfo } from '@/constants/authorization';
import { getSearchValue } from './commonUtil';
const KeySet = [Authorization, Token, UserInfo];
const storage = {
@@ -21,7 +21,7 @@ const storage = {
setToken: (value: string) => {
localStorage.setItem(Token, value);
},
setUserInfo: (value: string | Object) => {
setUserInfo: (value: string | Record<string, unknown>) => {
let valueStr = typeof value !== 'string' ? JSON.stringify(value) : value;
localStorage.setItem(UserInfo, valueStr);
},
@@ -46,4 +46,13 @@ const storage = {
},
};
export const getAuthorization = () => {
const sharedId = getSearchValue('shared_id');
const authorization = sharedId
? 'Bearer ' + sharedId
: storage.getAuthorization() || '';
return authorization;
};
export default storage;