sarvam-agents-client 0.1.1 → 0.1.2

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.
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { FieldDefinition } from './FieldDefinition.js';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -28,13 +29,11 @@ export interface CollectionCreate {
28
29
  */
29
30
  description?: string | null;
30
31
  /**
31
- *
32
- * @type {{ [key: string]: any; }}
32
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
33
+ * @type {Array<FieldDefinition>}
33
34
  * @memberof CollectionCreate
34
35
  */
35
- fieldDefinitions?: {
36
- [key: string]: any;
37
- } | null;
36
+ fieldDefinitions?: Array<FieldDefinition> | null;
38
37
  /**
39
38
  *
40
39
  * @type {{ [key: string]: any; }}
@@ -11,6 +11,7 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { FieldDefinitionFromJSON, FieldDefinitionToJSON, } from './FieldDefinition.js';
14
15
  /**
15
16
  * Check if a given object implements the CollectionCreate interface.
16
17
  */
@@ -27,7 +28,7 @@ export function CollectionCreateFromJSONTyped(json, ignoreDiscriminator) {
27
28
  return {
28
29
  'name': json['name'] == null ? undefined : json['name'],
29
30
  'description': json['description'] == null ? undefined : json['description'],
30
- 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : json['fieldDefinitions'],
31
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : (json['fieldDefinitions'].map(FieldDefinitionFromJSON)),
31
32
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
32
33
  };
33
34
  }
@@ -41,7 +42,7 @@ export function CollectionCreateToJSONTyped(value, ignoreDiscriminator = false)
41
42
  return {
42
43
  'name': value['name'],
43
44
  'description': value['description'],
44
- 'fieldDefinitions': value['fieldDefinitions'],
45
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : (value['fieldDefinitions'].map(FieldDefinitionToJSON)),
45
46
  'kbMetadata': value['kbMetadata'],
46
47
  };
47
48
  }
@@ -12,6 +12,7 @@
12
12
  import type { Scope } from './Scope.js';
13
13
  import type { Capabilities } from './Capabilities.js';
14
14
  import type { FieldHighlight } from './FieldHighlight.js';
15
+ import type { FieldDefinition } from './FieldDefinition.js';
15
16
  /**
16
17
  *
17
18
  * @export
@@ -104,6 +105,18 @@ export interface CollectionResource {
104
105
  kbMetadata?: {
105
106
  [key: string]: any;
106
107
  } | null;
108
+ /**
109
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
110
+ * @type {Array<FieldDefinition>}
111
+ * @memberof CollectionResource
112
+ */
113
+ fieldDefinitions?: Array<FieldDefinition> | null;
114
+ /**
115
+ * True once the collection has field definitions, so search can filter on them.
116
+ * @type {boolean}
117
+ * @memberof CollectionResource
118
+ */
119
+ filterable?: boolean;
107
120
  }
108
121
  /**
109
122
  * @export
@@ -14,6 +14,7 @@
14
14
  import { ScopeFromJSON, ScopeToJSON, } from './Scope.js';
15
15
  import { CapabilitiesFromJSON, CapabilitiesToJSON, } from './Capabilities.js';
16
16
  import { FieldHighlightFromJSON, FieldHighlightToJSON, } from './FieldHighlight.js';
17
+ import { FieldDefinitionFromJSON, FieldDefinitionToJSON, } from './FieldDefinition.js';
17
18
  /**
18
19
  * @export
19
20
  */
@@ -62,6 +63,8 @@ export function CollectionResourceFromJSONTyped(json, ignoreDiscriminator) {
62
63
  'highlight': json['highlight'] == null ? undefined : (json['highlight'].map(FieldHighlightFromJSON)),
63
64
  'slug': json['slug'],
64
65
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
66
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : (json['fieldDefinitions'].map(FieldDefinitionFromJSON)),
67
+ 'filterable': json['filterable'] == null ? undefined : json['filterable'],
65
68
  };
66
69
  }
67
70
  export function CollectionResourceToJSON(json) {
@@ -86,5 +89,7 @@ export function CollectionResourceToJSONTyped(value, ignoreDiscriminator = false
86
89
  'highlight': value['highlight'] == null ? undefined : (value['highlight'].map(FieldHighlightToJSON)),
87
90
  'slug': value['slug'],
88
91
  'kbMetadata': value['kbMetadata'],
92
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : (value['fieldDefinitions'].map(FieldDefinitionToJSON)),
93
+ 'filterable': value['filterable'],
89
94
  };
90
95
  }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { FieldDefinition } from './FieldDefinition.js';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -28,13 +29,11 @@ export interface CollectionUpdate {
28
29
  */
29
30
  description?: string | null;
30
31
  /**
31
- *
32
- * @type {{ [key: string]: any; }}
32
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
33
+ * @type {Array<FieldDefinition>}
33
34
  * @memberof CollectionUpdate
34
35
  */
35
- fieldDefinitions?: {
36
- [key: string]: any;
37
- } | null;
36
+ fieldDefinitions?: Array<FieldDefinition> | null;
38
37
  /**
39
38
  *
40
39
  * @type {{ [key: string]: any; }}
@@ -11,6 +11,7 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { FieldDefinitionFromJSON, FieldDefinitionToJSON, } from './FieldDefinition.js';
14
15
  /**
15
16
  * Check if a given object implements the CollectionUpdate interface.
16
17
  */
@@ -27,7 +28,7 @@ export function CollectionUpdateFromJSONTyped(json, ignoreDiscriminator) {
27
28
  return {
28
29
  'name': json['name'] == null ? undefined : json['name'],
29
30
  'description': json['description'] == null ? undefined : json['description'],
30
- 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : json['fieldDefinitions'],
31
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : (json['fieldDefinitions'].map(FieldDefinitionFromJSON)),
31
32
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
32
33
  };
33
34
  }
@@ -41,7 +42,7 @@ export function CollectionUpdateToJSONTyped(value, ignoreDiscriminator = false)
41
42
  return {
42
43
  'name': value['name'],
43
44
  'description': value['description'],
44
- 'fieldDefinitions': value['fieldDefinitions'],
45
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : (value['fieldDefinitions'].map(FieldDefinitionToJSON)),
45
46
  'kbMetadata': value['kbMetadata'],
46
47
  };
47
48
  }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Sarvam Agents API
3
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ * Contact: support@sarvam.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Published shape of one collection metadata field definition.
14
+ *
15
+ * Documentation only: it is never used to validate or serialize. KB owns
16
+ * every rule (types, enum values, the 50-field limit, duplicate names, what
17
+ * may change after creation) and chat-service relays its verdicts, so
18
+ * :data:`FieldDefinitions` keeps the runtime a plain ``dict`` and only swaps
19
+ * in this model's schema for the OpenAPI spec. Extra keys stay allowed.
20
+ * @export
21
+ * @interface FieldDefinition
22
+ */
23
+ export interface FieldDefinition {
24
+ [key: string]: any | any;
25
+ /**
26
+ * Unique within the collection.
27
+ * @type {string}
28
+ * @memberof FieldDefinition
29
+ */
30
+ name: string;
31
+ /**
32
+ * One of `string`, `integer`, `number`, `boolean`, `date`, `enum`. Locked once set.
33
+ * @type {string}
34
+ * @memberof FieldDefinition
35
+ */
36
+ type: string;
37
+ /**
38
+ * Uploads without this field are rejected. Can be changed in either direction.
39
+ * @type {boolean}
40
+ * @memberof FieldDefinition
41
+ */
42
+ required?: boolean;
43
+ /**
44
+ *
45
+ * @type {Array<string>}
46
+ * @memberof FieldDefinition
47
+ */
48
+ values?: Array<string> | null;
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof FieldDefinition
53
+ */
54
+ description?: string | null;
55
+ }
56
+ /**
57
+ * Check if a given object implements the FieldDefinition interface.
58
+ */
59
+ export declare function instanceOfFieldDefinition(value: object): value is FieldDefinition;
60
+ export declare function FieldDefinitionFromJSON(json: any): FieldDefinition;
61
+ export declare function FieldDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): FieldDefinition;
62
+ export declare function FieldDefinitionToJSON(json: any): FieldDefinition;
63
+ export declare function FieldDefinitionToJSONTyped(value?: FieldDefinition | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,55 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sarvam Agents API
5
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ * Contact: support@sarvam.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the FieldDefinition interface.
16
+ */
17
+ export function instanceOfFieldDefinition(value) {
18
+ if (!('name' in value) || value['name'] === undefined)
19
+ return false;
20
+ if (!('type' in value) || value['type'] === undefined)
21
+ return false;
22
+ return true;
23
+ }
24
+ export function FieldDefinitionFromJSON(json) {
25
+ return FieldDefinitionFromJSONTyped(json, false);
26
+ }
27
+ export function FieldDefinitionFromJSONTyped(json, ignoreDiscriminator) {
28
+ if (json == null) {
29
+ return json;
30
+ }
31
+ return {
32
+ ...json,
33
+ 'name': json['name'],
34
+ 'type': json['type'],
35
+ 'required': json['required'] == null ? undefined : json['required'],
36
+ 'values': json['values'] == null ? undefined : json['values'],
37
+ 'description': json['description'] == null ? undefined : json['description'],
38
+ };
39
+ }
40
+ export function FieldDefinitionToJSON(json) {
41
+ return FieldDefinitionToJSONTyped(json, false);
42
+ }
43
+ export function FieldDefinitionToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ ...value,
49
+ 'name': value['name'],
50
+ 'type': value['type'],
51
+ 'required': value['required'],
52
+ 'values': value['values'],
53
+ 'description': value['description'],
54
+ };
55
+ }
@@ -64,6 +64,7 @@ export * from './ExportBody.js';
64
64
  export * from './ExportResponse.js';
65
65
  export * from './FeedbackBody.js';
66
66
  export * from './FeedbackResult.js';
67
+ export * from './FieldDefinition.js';
67
68
  export * from './FieldHighlight.js';
68
69
  export * from './FileCompleteBody.js';
69
70
  export * from './FileError.js';
@@ -66,6 +66,7 @@ export * from './ExportBody.js';
66
66
  export * from './ExportResponse.js';
67
67
  export * from './FeedbackBody.js';
68
68
  export * from './FeedbackResult.js';
69
+ export * from './FieldDefinition.js';
69
70
  export * from './FieldHighlight.js';
70
71
  export * from './FileCompleteBody.js';
71
72
  export * from './FileError.js';
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { FieldDefinition } from './FieldDefinition.js';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -28,13 +29,11 @@ export interface CollectionCreate {
28
29
  */
29
30
  description?: string | null;
30
31
  /**
31
- *
32
- * @type {{ [key: string]: any; }}
32
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
33
+ * @type {Array<FieldDefinition>}
33
34
  * @memberof CollectionCreate
34
35
  */
35
- fieldDefinitions?: {
36
- [key: string]: any;
37
- } | null;
36
+ fieldDefinitions?: Array<FieldDefinition> | null;
38
37
  /**
39
38
  *
40
39
  * @type {{ [key: string]: any; }}
@@ -18,6 +18,7 @@ exports.CollectionCreateFromJSON = CollectionCreateFromJSON;
18
18
  exports.CollectionCreateFromJSONTyped = CollectionCreateFromJSONTyped;
19
19
  exports.CollectionCreateToJSON = CollectionCreateToJSON;
20
20
  exports.CollectionCreateToJSONTyped = CollectionCreateToJSONTyped;
21
+ const FieldDefinition_js_1 = require("./FieldDefinition.js");
21
22
  /**
22
23
  * Check if a given object implements the CollectionCreate interface.
23
24
  */
@@ -34,7 +35,7 @@ function CollectionCreateFromJSONTyped(json, ignoreDiscriminator) {
34
35
  return {
35
36
  'name': json['name'] == null ? undefined : json['name'],
36
37
  'description': json['description'] == null ? undefined : json['description'],
37
- 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : json['fieldDefinitions'],
38
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : (json['fieldDefinitions'].map(FieldDefinition_js_1.FieldDefinitionFromJSON)),
38
39
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
39
40
  };
40
41
  }
@@ -48,7 +49,7 @@ function CollectionCreateToJSONTyped(value, ignoreDiscriminator = false) {
48
49
  return {
49
50
  'name': value['name'],
50
51
  'description': value['description'],
51
- 'fieldDefinitions': value['fieldDefinitions'],
52
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : (value['fieldDefinitions'].map(FieldDefinition_js_1.FieldDefinitionToJSON)),
52
53
  'kbMetadata': value['kbMetadata'],
53
54
  };
54
55
  }
@@ -12,6 +12,7 @@
12
12
  import type { Scope } from './Scope.js';
13
13
  import type { Capabilities } from './Capabilities.js';
14
14
  import type { FieldHighlight } from './FieldHighlight.js';
15
+ import type { FieldDefinition } from './FieldDefinition.js';
15
16
  /**
16
17
  *
17
18
  * @export
@@ -104,6 +105,18 @@ export interface CollectionResource {
104
105
  kbMetadata?: {
105
106
  [key: string]: any;
106
107
  } | null;
108
+ /**
109
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
110
+ * @type {Array<FieldDefinition>}
111
+ * @memberof CollectionResource
112
+ */
113
+ fieldDefinitions?: Array<FieldDefinition> | null;
114
+ /**
115
+ * True once the collection has field definitions, so search can filter on them.
116
+ * @type {boolean}
117
+ * @memberof CollectionResource
118
+ */
119
+ filterable?: boolean;
107
120
  }
108
121
  /**
109
122
  * @export
@@ -22,6 +22,7 @@ exports.CollectionResourceToJSONTyped = CollectionResourceToJSONTyped;
22
22
  const Scope_js_1 = require("./Scope.js");
23
23
  const Capabilities_js_1 = require("./Capabilities.js");
24
24
  const FieldHighlight_js_1 = require("./FieldHighlight.js");
25
+ const FieldDefinition_js_1 = require("./FieldDefinition.js");
25
26
  /**
26
27
  * @export
27
28
  */
@@ -70,6 +71,8 @@ function CollectionResourceFromJSONTyped(json, ignoreDiscriminator) {
70
71
  'highlight': json['highlight'] == null ? undefined : (json['highlight'].map(FieldHighlight_js_1.FieldHighlightFromJSON)),
71
72
  'slug': json['slug'],
72
73
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
74
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : (json['fieldDefinitions'].map(FieldDefinition_js_1.FieldDefinitionFromJSON)),
75
+ 'filterable': json['filterable'] == null ? undefined : json['filterable'],
73
76
  };
74
77
  }
75
78
  function CollectionResourceToJSON(json) {
@@ -94,5 +97,7 @@ function CollectionResourceToJSONTyped(value, ignoreDiscriminator = false) {
94
97
  'highlight': value['highlight'] == null ? undefined : (value['highlight'].map(FieldHighlight_js_1.FieldHighlightToJSON)),
95
98
  'slug': value['slug'],
96
99
  'kbMetadata': value['kbMetadata'],
100
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : (value['fieldDefinitions'].map(FieldDefinition_js_1.FieldDefinitionToJSON)),
101
+ 'filterable': value['filterable'],
97
102
  };
98
103
  }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { FieldDefinition } from './FieldDefinition.js';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -28,13 +29,11 @@ export interface CollectionUpdate {
28
29
  */
29
30
  description?: string | null;
30
31
  /**
31
- *
32
- * @type {{ [key: string]: any; }}
32
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
33
+ * @type {Array<FieldDefinition>}
33
34
  * @memberof CollectionUpdate
34
35
  */
35
- fieldDefinitions?: {
36
- [key: string]: any;
37
- } | null;
36
+ fieldDefinitions?: Array<FieldDefinition> | null;
38
37
  /**
39
38
  *
40
39
  * @type {{ [key: string]: any; }}
@@ -18,6 +18,7 @@ exports.CollectionUpdateFromJSON = CollectionUpdateFromJSON;
18
18
  exports.CollectionUpdateFromJSONTyped = CollectionUpdateFromJSONTyped;
19
19
  exports.CollectionUpdateToJSON = CollectionUpdateToJSON;
20
20
  exports.CollectionUpdateToJSONTyped = CollectionUpdateToJSONTyped;
21
+ const FieldDefinition_js_1 = require("./FieldDefinition.js");
21
22
  /**
22
23
  * Check if a given object implements the CollectionUpdate interface.
23
24
  */
@@ -34,7 +35,7 @@ function CollectionUpdateFromJSONTyped(json, ignoreDiscriminator) {
34
35
  return {
35
36
  'name': json['name'] == null ? undefined : json['name'],
36
37
  'description': json['description'] == null ? undefined : json['description'],
37
- 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : json['fieldDefinitions'],
38
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : (json['fieldDefinitions'].map(FieldDefinition_js_1.FieldDefinitionFromJSON)),
38
39
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
39
40
  };
40
41
  }
@@ -48,7 +49,7 @@ function CollectionUpdateToJSONTyped(value, ignoreDiscriminator = false) {
48
49
  return {
49
50
  'name': value['name'],
50
51
  'description': value['description'],
51
- 'fieldDefinitions': value['fieldDefinitions'],
52
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : (value['fieldDefinitions'].map(FieldDefinition_js_1.FieldDefinitionToJSON)),
52
53
  'kbMetadata': value['kbMetadata'],
53
54
  };
54
55
  }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Sarvam Agents API
3
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ * Contact: support@sarvam.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Published shape of one collection metadata field definition.
14
+ *
15
+ * Documentation only: it is never used to validate or serialize. KB owns
16
+ * every rule (types, enum values, the 50-field limit, duplicate names, what
17
+ * may change after creation) and chat-service relays its verdicts, so
18
+ * :data:`FieldDefinitions` keeps the runtime a plain ``dict`` and only swaps
19
+ * in this model's schema for the OpenAPI spec. Extra keys stay allowed.
20
+ * @export
21
+ * @interface FieldDefinition
22
+ */
23
+ export interface FieldDefinition {
24
+ [key: string]: any | any;
25
+ /**
26
+ * Unique within the collection.
27
+ * @type {string}
28
+ * @memberof FieldDefinition
29
+ */
30
+ name: string;
31
+ /**
32
+ * One of `string`, `integer`, `number`, `boolean`, `date`, `enum`. Locked once set.
33
+ * @type {string}
34
+ * @memberof FieldDefinition
35
+ */
36
+ type: string;
37
+ /**
38
+ * Uploads without this field are rejected. Can be changed in either direction.
39
+ * @type {boolean}
40
+ * @memberof FieldDefinition
41
+ */
42
+ required?: boolean;
43
+ /**
44
+ *
45
+ * @type {Array<string>}
46
+ * @memberof FieldDefinition
47
+ */
48
+ values?: Array<string> | null;
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof FieldDefinition
53
+ */
54
+ description?: string | null;
55
+ }
56
+ /**
57
+ * Check if a given object implements the FieldDefinition interface.
58
+ */
59
+ export declare function instanceOfFieldDefinition(value: object): value is FieldDefinition;
60
+ export declare function FieldDefinitionFromJSON(json: any): FieldDefinition;
61
+ export declare function FieldDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): FieldDefinition;
62
+ export declare function FieldDefinitionToJSON(json: any): FieldDefinition;
63
+ export declare function FieldDefinitionToJSONTyped(value?: FieldDefinition | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Sarvam Agents API
6
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ * Contact: support@sarvam.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfFieldDefinition = instanceOfFieldDefinition;
17
+ exports.FieldDefinitionFromJSON = FieldDefinitionFromJSON;
18
+ exports.FieldDefinitionFromJSONTyped = FieldDefinitionFromJSONTyped;
19
+ exports.FieldDefinitionToJSON = FieldDefinitionToJSON;
20
+ exports.FieldDefinitionToJSONTyped = FieldDefinitionToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the FieldDefinition interface.
23
+ */
24
+ function instanceOfFieldDefinition(value) {
25
+ if (!('name' in value) || value['name'] === undefined)
26
+ return false;
27
+ if (!('type' in value) || value['type'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function FieldDefinitionFromJSON(json) {
32
+ return FieldDefinitionFromJSONTyped(json, false);
33
+ }
34
+ function FieldDefinitionFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ ...json,
40
+ 'name': json['name'],
41
+ 'type': json['type'],
42
+ 'required': json['required'] == null ? undefined : json['required'],
43
+ 'values': json['values'] == null ? undefined : json['values'],
44
+ 'description': json['description'] == null ? undefined : json['description'],
45
+ };
46
+ }
47
+ function FieldDefinitionToJSON(json) {
48
+ return FieldDefinitionToJSONTyped(json, false);
49
+ }
50
+ function FieldDefinitionToJSONTyped(value, ignoreDiscriminator = false) {
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ return {
55
+ ...value,
56
+ 'name': value['name'],
57
+ 'type': value['type'],
58
+ 'required': value['required'],
59
+ 'values': value['values'],
60
+ 'description': value['description'],
61
+ };
62
+ }
@@ -64,6 +64,7 @@ export * from './ExportBody.js';
64
64
  export * from './ExportResponse.js';
65
65
  export * from './FeedbackBody.js';
66
66
  export * from './FeedbackResult.js';
67
+ export * from './FieldDefinition.js';
67
68
  export * from './FieldHighlight.js';
68
69
  export * from './FileCompleteBody.js';
69
70
  export * from './FileError.js';
@@ -82,6 +82,7 @@ __exportStar(require("./ExportBody.js"), exports);
82
82
  __exportStar(require("./ExportResponse.js"), exports);
83
83
  __exportStar(require("./FeedbackBody.js"), exports);
84
84
  __exportStar(require("./FeedbackResult.js"), exports);
85
+ __exportStar(require("./FieldDefinition.js"), exports);
85
86
  __exportStar(require("./FieldHighlight.js"), exports);
86
87
  __exportStar(require("./FileCompleteBody.js"), exports);
87
88
  __exportStar(require("./FileError.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sarvam-agents-client",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Client for the Sarvam Agents API: chat with an agent, exchange files with it, and set it up from your own code.",
5
5
  "author": "Sarvam AI <support@sarvam.ai>",
6
6
  "license": "MIT",
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime.js';
16
+ import type { FieldDefinition } from './FieldDefinition.js';
17
+ import {
18
+ FieldDefinitionFromJSON,
19
+ FieldDefinitionFromJSONTyped,
20
+ FieldDefinitionToJSON,
21
+ FieldDefinitionToJSONTyped,
22
+ } from './FieldDefinition.js';
23
+
16
24
  /**
17
25
  *
18
26
  * @export
@@ -32,11 +40,11 @@ export interface CollectionCreate {
32
40
  */
33
41
  description?: string | null;
34
42
  /**
35
- *
36
- * @type {{ [key: string]: any; }}
43
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
44
+ * @type {Array<FieldDefinition>}
37
45
  * @memberof CollectionCreate
38
46
  */
39
- fieldDefinitions?: { [key: string]: any; } | null;
47
+ fieldDefinitions?: Array<FieldDefinition> | null;
40
48
  /**
41
49
  *
42
50
  * @type {{ [key: string]: any; }}
@@ -64,7 +72,7 @@ export function CollectionCreateFromJSONTyped(json: any, ignoreDiscriminator: bo
64
72
 
65
73
  'name': json['name'] == null ? undefined : json['name'],
66
74
  'description': json['description'] == null ? undefined : json['description'],
67
- 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : json['fieldDefinitions'],
75
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : ((json['fieldDefinitions'] as Array<any>).map(FieldDefinitionFromJSON)),
68
76
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
69
77
  };
70
78
  }
@@ -82,7 +90,7 @@ export function CollectionCreateToJSONTyped(value?: CollectionCreate | null, ign
82
90
 
83
91
  'name': value['name'],
84
92
  'description': value['description'],
85
- 'fieldDefinitions': value['fieldDefinitions'],
93
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : ((value['fieldDefinitions'] as Array<any>).map(FieldDefinitionToJSON)),
86
94
  'kbMetadata': value['kbMetadata'],
87
95
  };
88
96
  }
@@ -34,6 +34,13 @@ import {
34
34
  FieldHighlightToJSON,
35
35
  FieldHighlightToJSONTyped,
36
36
  } from './FieldHighlight.js';
37
+ import type { FieldDefinition } from './FieldDefinition.js';
38
+ import {
39
+ FieldDefinitionFromJSON,
40
+ FieldDefinitionFromJSONTyped,
41
+ FieldDefinitionToJSON,
42
+ FieldDefinitionToJSONTyped,
43
+ } from './FieldDefinition.js';
37
44
 
38
45
  /**
39
46
  *
@@ -125,6 +132,18 @@ export interface CollectionResource {
125
132
  * @memberof CollectionResource
126
133
  */
127
134
  kbMetadata?: { [key: string]: any; } | null;
135
+ /**
136
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
137
+ * @type {Array<FieldDefinition>}
138
+ * @memberof CollectionResource
139
+ */
140
+ fieldDefinitions?: Array<FieldDefinition> | null;
141
+ /**
142
+ * True once the collection has field definitions, so search can filter on them.
143
+ * @type {boolean}
144
+ * @memberof CollectionResource
145
+ */
146
+ filterable?: boolean;
128
147
  }
129
148
 
130
149
 
@@ -175,6 +194,8 @@ export function CollectionResourceFromJSONTyped(json: any, ignoreDiscriminator:
175
194
  'highlight': json['highlight'] == null ? undefined : ((json['highlight'] as Array<any>).map(FieldHighlightFromJSON)),
176
195
  'slug': json['slug'],
177
196
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
197
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : ((json['fieldDefinitions'] as Array<any>).map(FieldDefinitionFromJSON)),
198
+ 'filterable': json['filterable'] == null ? undefined : json['filterable'],
178
199
  };
179
200
  }
180
201
 
@@ -203,6 +224,8 @@ export function CollectionResourceToJSONTyped(value?: CollectionResource | null,
203
224
  'highlight': value['highlight'] == null ? undefined : ((value['highlight'] as Array<any>).map(FieldHighlightToJSON)),
204
225
  'slug': value['slug'],
205
226
  'kbMetadata': value['kbMetadata'],
227
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : ((value['fieldDefinitions'] as Array<any>).map(FieldDefinitionToJSON)),
228
+ 'filterable': value['filterable'],
206
229
  };
207
230
  }
208
231
 
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime.js';
16
+ import type { FieldDefinition } from './FieldDefinition.js';
17
+ import {
18
+ FieldDefinitionFromJSON,
19
+ FieldDefinitionFromJSONTyped,
20
+ FieldDefinitionToJSON,
21
+ FieldDefinitionToJSONTyped,
22
+ } from './FieldDefinition.js';
23
+
16
24
  /**
17
25
  *
18
26
  * @export
@@ -32,11 +40,11 @@ export interface CollectionUpdate {
32
40
  */
33
41
  description?: string | null;
34
42
  /**
35
- *
36
- * @type {{ [key: string]: any; }}
43
+ * Metadata fields files in this collection carry, and that search can filter on. On update, send the full list: it replaces the stored one.
44
+ * @type {Array<FieldDefinition>}
37
45
  * @memberof CollectionUpdate
38
46
  */
39
- fieldDefinitions?: { [key: string]: any; } | null;
47
+ fieldDefinitions?: Array<FieldDefinition> | null;
40
48
  /**
41
49
  *
42
50
  * @type {{ [key: string]: any; }}
@@ -64,7 +72,7 @@ export function CollectionUpdateFromJSONTyped(json: any, ignoreDiscriminator: bo
64
72
 
65
73
  'name': json['name'] == null ? undefined : json['name'],
66
74
  'description': json['description'] == null ? undefined : json['description'],
67
- 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : json['fieldDefinitions'],
75
+ 'fieldDefinitions': json['fieldDefinitions'] == null ? undefined : ((json['fieldDefinitions'] as Array<any>).map(FieldDefinitionFromJSON)),
68
76
  'kbMetadata': json['kbMetadata'] == null ? undefined : json['kbMetadata'],
69
77
  };
70
78
  }
@@ -82,7 +90,7 @@ export function CollectionUpdateToJSONTyped(value?: CollectionUpdate | null, ign
82
90
 
83
91
  'name': value['name'],
84
92
  'description': value['description'],
85
- 'fieldDefinitions': value['fieldDefinitions'],
93
+ 'fieldDefinitions': value['fieldDefinitions'] == null ? undefined : ((value['fieldDefinitions'] as Array<any>).map(FieldDefinitionToJSON)),
86
94
  'kbMetadata': value['kbMetadata'],
87
95
  };
88
96
  }
@@ -0,0 +1,108 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sarvam Agents API
5
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ * Contact: support@sarvam.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime.js';
16
+ /**
17
+ * Published shape of one collection metadata field definition.
18
+ *
19
+ * Documentation only: it is never used to validate or serialize. KB owns
20
+ * every rule (types, enum values, the 50-field limit, duplicate names, what
21
+ * may change after creation) and chat-service relays its verdicts, so
22
+ * :data:`FieldDefinitions` keeps the runtime a plain ``dict`` and only swaps
23
+ * in this model's schema for the OpenAPI spec. Extra keys stay allowed.
24
+ * @export
25
+ * @interface FieldDefinition
26
+ */
27
+ export interface FieldDefinition {
28
+ [key: string]: any | any;
29
+ /**
30
+ * Unique within the collection.
31
+ * @type {string}
32
+ * @memberof FieldDefinition
33
+ */
34
+ name: string;
35
+ /**
36
+ * One of `string`, `integer`, `number`, `boolean`, `date`, `enum`. Locked once set.
37
+ * @type {string}
38
+ * @memberof FieldDefinition
39
+ */
40
+ type: string;
41
+ /**
42
+ * Uploads without this field are rejected. Can be changed in either direction.
43
+ * @type {boolean}
44
+ * @memberof FieldDefinition
45
+ */
46
+ required?: boolean;
47
+ /**
48
+ *
49
+ * @type {Array<string>}
50
+ * @memberof FieldDefinition
51
+ */
52
+ values?: Array<string> | null;
53
+ /**
54
+ *
55
+ * @type {string}
56
+ * @memberof FieldDefinition
57
+ */
58
+ description?: string | null;
59
+ }
60
+
61
+ /**
62
+ * Check if a given object implements the FieldDefinition interface.
63
+ */
64
+ export function instanceOfFieldDefinition(value: object): value is FieldDefinition {
65
+ if (!('name' in value) || value['name'] === undefined) return false;
66
+ if (!('type' in value) || value['type'] === undefined) return false;
67
+ return true;
68
+ }
69
+
70
+ export function FieldDefinitionFromJSON(json: any): FieldDefinition {
71
+ return FieldDefinitionFromJSONTyped(json, false);
72
+ }
73
+
74
+ export function FieldDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): FieldDefinition {
75
+ if (json == null) {
76
+ return json;
77
+ }
78
+ return {
79
+
80
+ ...json,
81
+ 'name': json['name'],
82
+ 'type': json['type'],
83
+ 'required': json['required'] == null ? undefined : json['required'],
84
+ 'values': json['values'] == null ? undefined : json['values'],
85
+ 'description': json['description'] == null ? undefined : json['description'],
86
+ };
87
+ }
88
+
89
+ export function FieldDefinitionToJSON(json: any): FieldDefinition {
90
+ return FieldDefinitionToJSONTyped(json, false);
91
+ }
92
+
93
+ export function FieldDefinitionToJSONTyped(value?: FieldDefinition | null, ignoreDiscriminator: boolean = false): any {
94
+ if (value == null) {
95
+ return value;
96
+ }
97
+
98
+ return {
99
+
100
+ ...value,
101
+ 'name': value['name'],
102
+ 'type': value['type'],
103
+ 'required': value['required'],
104
+ 'values': value['values'],
105
+ 'description': value['description'],
106
+ };
107
+ }
108
+
@@ -66,6 +66,7 @@ export * from './ExportBody.js';
66
66
  export * from './ExportResponse.js';
67
67
  export * from './FeedbackBody.js';
68
68
  export * from './FeedbackResult.js';
69
+ export * from './FieldDefinition.js';
69
70
  export * from './FieldHighlight.js';
70
71
  export * from './FileCompleteBody.js';
71
72
  export * from './FileError.js';