mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🔧 feat: Share Assistant Actions between Users (#2116)
* fix: remove unique field from assistant_id, which can be shared between different users * refactor: remove unique user fields from actions/assistant queries * feat: only allow user who saved action to delete it * refactor: allow deletions for anyone with builder access * refactor: update user.id when updating assistants/actions records, instead of searching with it * fix: stringify response data in case it's an object * fix: correctly handle path input * fix(decryptV2): handle edge case where value is already decrypted
This commit is contained in:
parent
2f90c8764a
commit
a8cdd3460c
7 changed files with 65 additions and 16 deletions
|
|
@ -164,6 +164,39 @@ describe('ActionRequest', () => {
|
|||
);
|
||||
await expect(actionRequest.execute()).rejects.toThrow('Unsupported HTTP method: INVALID');
|
||||
});
|
||||
|
||||
it('replaces path parameters with values from toolInput', async () => {
|
||||
const actionRequest = new ActionRequest(
|
||||
'https://example.com',
|
||||
'/stocks/{stocksTicker}/bars/{multiplier}',
|
||||
'GET',
|
||||
'getAggregateBars',
|
||||
false,
|
||||
'application/json',
|
||||
);
|
||||
|
||||
await actionRequest.setParams({
|
||||
stocksTicker: 'AAPL',
|
||||
multiplier: 5,
|
||||
startDate: '2023-01-01',
|
||||
endDate: '2023-12-31',
|
||||
});
|
||||
|
||||
expect(actionRequest.path).toBe('/stocks/AAPL/bars/5');
|
||||
expect(actionRequest.params).toEqual({
|
||||
startDate: '2023-01-01',
|
||||
endDate: '2023-12-31',
|
||||
});
|
||||
|
||||
await actionRequest.execute();
|
||||
expect(mockedAxios.get).toHaveBeenCalledWith('https://example.com/stocks/AAPL/bars/5', {
|
||||
headers: expect.anything(),
|
||||
params: {
|
||||
startDate: '2023-01-01',
|
||||
endDate: '2023-12-31',
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('throws an error for unsupported HTTP method', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue