librechat-data-provider 0.7.63 → 0.7.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react-query/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/data-service.ts +10 -0
- package/src/schemas.ts +5 -1
- package/src/types/mutations.ts +9 -0
package/package.json
CHANGED
package/src/data-service.ts
CHANGED
|
@@ -428,6 +428,16 @@ export const updateAgent = ({
|
|
|
428
428
|
);
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
+
export const duplicateAgent = ({
|
|
432
|
+
agent_id,
|
|
433
|
+
}: m.DuplicateAgentBody): Promise<{ agent: a.Agent; actions: a.Action[] }> => {
|
|
434
|
+
return request.post(
|
|
435
|
+
endpoints.agents({
|
|
436
|
+
path: `${agent_id}/duplicate`,
|
|
437
|
+
}),
|
|
438
|
+
);
|
|
439
|
+
};
|
|
440
|
+
|
|
431
441
|
export const deleteAgent = ({ agent_id }: m.DeleteAgentBody): Promise<void> => {
|
|
432
442
|
return request.delete(
|
|
433
443
|
endpoints.agents({
|
package/src/schemas.ts
CHANGED
|
@@ -49,7 +49,11 @@ export enum BedrockProviders {
|
|
|
49
49
|
|
|
50
50
|
export const getModelKey = (endpoint: EModelEndpoint | string, model: string) => {
|
|
51
51
|
if (endpoint === EModelEndpoint.bedrock) {
|
|
52
|
-
|
|
52
|
+
const parts = model.split('.');
|
|
53
|
+
const provider = [parts[0], parts[1]].find((part) =>
|
|
54
|
+
Object.values(BedrockProviders).includes(part as BedrockProviders),
|
|
55
|
+
);
|
|
56
|
+
return (provider ?? parts[0]) as BedrockProviders;
|
|
53
57
|
}
|
|
54
58
|
return model;
|
|
55
59
|
};
|
package/src/types/mutations.ts
CHANGED
|
@@ -126,6 +126,15 @@ export type UpdateAgentVariables = {
|
|
|
126
126
|
|
|
127
127
|
export type UpdateAgentMutationOptions = MutationOptions<Agent, UpdateAgentVariables>;
|
|
128
128
|
|
|
129
|
+
export type DuplicateAgentBody = {
|
|
130
|
+
agent_id: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type DuplicateAgentMutationOptions = MutationOptions<
|
|
134
|
+
{ agent: Agent; actions: Action[] },
|
|
135
|
+
Pick<DuplicateAgentBody, 'agent_id'>
|
|
136
|
+
>;
|
|
137
|
+
|
|
129
138
|
export type DeleteAgentBody = {
|
|
130
139
|
agent_id: string;
|
|
131
140
|
};
|