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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "librechat-data-provider",
3
- "version": "0.7.63",
3
+ "version": "0.7.65",
4
4
  "description": "data services for librechat apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -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
- return model.split('.')[0] as BedrockProviders;
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
  };
@@ -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
  };