llama-stack-client 0.2.13 → 0.2.14-rc2
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/LICENSE +201 -22
- package/README.md +67 -48
- package/_shims/web-runtime.js +1 -1
- package/_shims/web-runtime.js.map +1 -1
- package/_shims/web-runtime.mjs +1 -1
- package/_shims/web-runtime.mjs.map +1 -1
- package/core.js +1 -1
- package/core.js.map +1 -1
- package/core.mjs +1 -1
- package/core.mjs.map +1 -1
- package/index.d.mts +10 -8
- package/index.d.ts +10 -8
- package/index.d.ts.map +1 -1
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/index.mjs +3 -3
- package/index.mjs.map +1 -1
- package/package.json +4 -5
- package/resources/agents/agents.d.ts +52 -4
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +13 -0
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +13 -0
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.d.ts +2 -2
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/session.d.ts +35 -1
- package/resources/agents/session.d.ts.map +1 -1
- package/resources/agents/session.js +6 -0
- package/resources/agents/session.js.map +1 -1
- package/resources/agents/session.mjs +6 -0
- package/resources/agents/session.mjs.map +1 -1
- package/resources/agents/turn.d.ts +6 -2
- package/resources/agents/turn.d.ts.map +1 -1
- package/resources/benchmarks.d.ts +6 -2
- package/resources/benchmarks.d.ts.map +1 -1
- package/resources/chat/completions.d.ts +21 -7
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/completions.d.ts +6 -2
- package/resources/completions.d.ts.map +1 -1
- package/resources/datasets.d.ts +40 -10
- package/resources/datasets.d.ts.map +1 -1
- package/resources/datasets.js +10 -0
- package/resources/datasets.js.map +1 -1
- package/resources/datasets.mjs +10 -0
- package/resources/datasets.mjs.map +1 -1
- package/resources/eval/eval.d.ts +15 -5
- package/resources/eval/eval.d.ts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/inference.d.ts +9 -3
- package/resources/inference.d.ts.map +1 -1
- package/resources/inspect.d.ts +6 -2
- package/resources/inspect.d.ts.map +1 -1
- package/resources/models.d.ts +6 -2
- package/resources/models.d.ts.map +1 -1
- package/resources/post-training/job.d.ts +3 -1
- package/resources/post-training/job.d.ts.map +1 -1
- package/resources/post-training/job.js.map +1 -1
- package/resources/post-training/job.mjs.map +1 -1
- package/resources/post-training/post-training.d.ts +12 -4
- package/resources/post-training/post-training.d.ts.map +1 -1
- package/resources/responses/input-items.d.ts +32 -1
- package/resources/responses/input-items.d.ts.map +1 -1
- package/resources/responses/responses.d.ts +223 -17
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/safety.d.ts +3 -1
- package/resources/safety.d.ts.map +1 -1
- package/resources/scoring-functions.d.ts +3 -1
- package/resources/scoring-functions.d.ts.map +1 -1
- package/resources/scoring.d.ts +15 -5
- package/resources/scoring.d.ts.map +1 -1
- package/resources/shared.d.ts +29 -9
- package/resources/shared.d.ts.map +1 -1
- package/resources/shields.d.ts +6 -2
- package/resources/shields.d.ts.map +1 -1
- package/resources/synthetic-data-generation.d.ts +6 -2
- package/resources/synthetic-data-generation.d.ts.map +1 -1
- package/resources/telemetry.d.ts +21 -7
- package/resources/telemetry.d.ts.map +1 -1
- package/resources/tool-runtime/tool-runtime.d.ts +9 -3
- package/resources/tool-runtime/tool-runtime.d.ts.map +1 -1
- package/resources/toolgroups.d.ts +6 -2
- package/resources/toolgroups.d.ts.map +1 -1
- package/resources/tools.d.ts +3 -1
- package/resources/tools.d.ts.map +1 -1
- package/resources/vector-io.d.ts +139 -7
- package/resources/vector-io.d.ts.map +1 -1
- package/resources/vector-stores/files.d.ts +78 -3
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +34 -0
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +34 -0
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.ts +1 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs +1 -1
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +33 -11
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +1 -1
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/_shims/web-runtime.ts +1 -1
- package/src/core.ts +1 -1
- package/src/index.ts +16 -6
- package/src/resources/agents/agents.ts +74 -1
- package/src/resources/agents/index.ts +5 -0
- package/src/resources/agents/session.ts +54 -0
- package/src/resources/agents/turn.ts +2 -2
- package/src/resources/benchmarks.ts +2 -2
- package/src/resources/chat/completions.ts +7 -7
- package/src/resources/completions.ts +2 -2
- package/src/resources/datasets.ts +32 -9
- package/src/resources/eval/eval.ts +5 -5
- package/src/resources/index.ts +4 -0
- package/src/resources/inference.ts +3 -3
- package/src/resources/inspect.ts +2 -2
- package/src/resources/models.ts +2 -2
- package/src/resources/post-training/job.ts +1 -2
- package/src/resources/post-training/post-training.ts +4 -4
- package/src/resources/responses/input-items.ts +54 -1
- package/src/resources/responses/responses.ts +335 -17
- package/src/resources/safety.ts +1 -1
- package/src/resources/scoring-functions.ts +1 -1
- package/src/resources/scoring.ts +5 -5
- package/src/resources/shared.ts +17 -17
- package/src/resources/shields.ts +2 -2
- package/src/resources/synthetic-data-generation.ts +2 -2
- package/src/resources/telemetry.ts +7 -7
- package/src/resources/tool-runtime/tool-runtime.ts +3 -3
- package/src/resources/toolgroups.ts +2 -2
- package/src/resources/tools.ts +1 -1
- package/src/resources/vector-io.ts +159 -7
- package/src/resources/vector-stores/files.ts +146 -3
- package/src/resources/vector-stores/index.ts +10 -1
- package/src/resources/vector-stores/vector-stores.ts +29 -10
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/shared.ts
CHANGED
|
@@ -99,7 +99,7 @@ export namespace AgentConfig {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export interface AgentToolGroupWithArgs {
|
|
102
|
-
args:
|
|
102
|
+
args: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
103
103
|
|
|
104
104
|
name: string;
|
|
105
105
|
}
|
|
@@ -212,7 +212,7 @@ export interface Document {
|
|
|
212
212
|
/**
|
|
213
213
|
* Additional metadata for the document.
|
|
214
214
|
*/
|
|
215
|
-
metadata:
|
|
215
|
+
metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* The MIME type of the document.
|
|
@@ -574,7 +574,7 @@ export namespace QueryGeneratorConfig {
|
|
|
574
574
|
}
|
|
575
575
|
|
|
576
576
|
export interface QueryResult {
|
|
577
|
-
metadata:
|
|
577
|
+
metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
578
578
|
|
|
579
579
|
/**
|
|
580
580
|
* A image content item
|
|
@@ -596,7 +596,7 @@ export namespace ResponseFormat {
|
|
|
596
596
|
* The JSON schema the response should conform to. In a Python SDK, this is often a
|
|
597
597
|
* `pydantic` model.
|
|
598
598
|
*/
|
|
599
|
-
json_schema:
|
|
599
|
+
json_schema: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
600
600
|
|
|
601
601
|
/**
|
|
602
602
|
* Must be "json_schema" to identify this format type
|
|
@@ -611,7 +611,7 @@ export namespace ResponseFormat {
|
|
|
611
611
|
/**
|
|
612
612
|
* The BNF grammar specification the response should conform to
|
|
613
613
|
*/
|
|
614
|
-
bnf:
|
|
614
|
+
bnf: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
615
615
|
|
|
616
616
|
/**
|
|
617
617
|
* Must be "grammar" to identify this format type
|
|
@@ -635,7 +635,7 @@ export interface ReturnType {
|
|
|
635
635
|
}
|
|
636
636
|
|
|
637
637
|
export interface SafetyViolation {
|
|
638
|
-
metadata:
|
|
638
|
+
metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
639
639
|
|
|
640
640
|
violation_level: 'info' | 'warn' | 'error';
|
|
641
641
|
|
|
@@ -701,12 +701,12 @@ export interface ScoringResult {
|
|
|
701
701
|
/**
|
|
702
702
|
* Map of metric name to aggregated value
|
|
703
703
|
*/
|
|
704
|
-
aggregated_results:
|
|
704
|
+
aggregated_results: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
705
705
|
|
|
706
706
|
/**
|
|
707
707
|
* The scoring result for each row. Each row is a map of column name to value.
|
|
708
708
|
*/
|
|
709
|
-
score_rows: Array<
|
|
709
|
+
score_rows: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
/**
|
|
@@ -729,15 +729,15 @@ export interface SystemMessage {
|
|
|
729
729
|
export interface ToolCall {
|
|
730
730
|
arguments:
|
|
731
731
|
| string
|
|
732
|
-
|
|
|
733
|
-
string
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
732
|
+
| {
|
|
733
|
+
[key: string]:
|
|
734
|
+
| string
|
|
735
|
+
| number
|
|
736
|
+
| boolean
|
|
737
|
+
| Array<string | number | boolean | null>
|
|
738
|
+
| { [key: string]: string | number | boolean | null }
|
|
739
|
+
| null;
|
|
740
|
+
};
|
|
741
741
|
|
|
742
742
|
call_id: string;
|
|
743
743
|
|
package/src/resources/shields.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface Shield {
|
|
|
42
42
|
|
|
43
43
|
type: 'shield';
|
|
44
44
|
|
|
45
|
-
params?:
|
|
45
|
+
params?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
46
46
|
|
|
47
47
|
provider_resource_id?: string;
|
|
48
48
|
}
|
|
@@ -58,7 +58,7 @@ export interface ShieldRegisterParams {
|
|
|
58
58
|
/**
|
|
59
59
|
* The parameters of the shield.
|
|
60
60
|
*/
|
|
61
|
-
params?:
|
|
61
|
+
params?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* The identifier of the provider.
|
|
@@ -18,9 +18,9 @@ export class SyntheticDataGeneration extends APIResource {
|
|
|
18
18
|
* tuples that pass the threshold.
|
|
19
19
|
*/
|
|
20
20
|
export interface SyntheticDataGenerationResponse {
|
|
21
|
-
synthetic_data: Array<
|
|
21
|
+
synthetic_data: Array<{ [key: string]: boolean | number | string | Array<unknown> | unknown | null }>;
|
|
22
22
|
|
|
23
|
-
statistics?:
|
|
23
|
+
statistics?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface SyntheticDataGenerationGenerateParams {
|
|
@@ -107,7 +107,7 @@ export namespace Event {
|
|
|
107
107
|
|
|
108
108
|
type: 'unstructured_log';
|
|
109
109
|
|
|
110
|
-
attributes?:
|
|
110
|
+
attributes?: { [key: string]: string | number | boolean | null };
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export interface MetricEvent {
|
|
@@ -125,7 +125,7 @@ export namespace Event {
|
|
|
125
125
|
|
|
126
126
|
value: number;
|
|
127
127
|
|
|
128
|
-
attributes?:
|
|
128
|
+
attributes?: { [key: string]: string | number | boolean | null };
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export interface StructuredLogEvent {
|
|
@@ -139,7 +139,7 @@ export namespace Event {
|
|
|
139
139
|
|
|
140
140
|
type: 'structured_log';
|
|
141
141
|
|
|
142
|
-
attributes?:
|
|
142
|
+
attributes?: { [key: string]: string | number | boolean | null };
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
export namespace StructuredLogEvent {
|
|
@@ -180,7 +180,7 @@ export interface SpanWithStatus {
|
|
|
180
180
|
|
|
181
181
|
trace_id: string;
|
|
182
182
|
|
|
183
|
-
attributes?:
|
|
183
|
+
attributes?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
184
184
|
|
|
185
185
|
end_time?: string;
|
|
186
186
|
|
|
@@ -208,14 +208,14 @@ export interface TelemetryGetSpanResponse {
|
|
|
208
208
|
|
|
209
209
|
trace_id: string;
|
|
210
210
|
|
|
211
|
-
attributes?:
|
|
211
|
+
attributes?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
212
212
|
|
|
213
213
|
end_time?: string;
|
|
214
214
|
|
|
215
215
|
parent_span_id?: string;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
export type TelemetryGetSpanTreeResponse =
|
|
218
|
+
export type TelemetryGetSpanTreeResponse = { [key: string]: SpanWithStatus };
|
|
219
219
|
|
|
220
220
|
export type TelemetryQuerySpansResponse = Array<TelemetryQuerySpansResponse.TelemetryQuerySpansResponseItem>;
|
|
221
221
|
|
|
@@ -229,7 +229,7 @@ export namespace TelemetryQuerySpansResponse {
|
|
|
229
229
|
|
|
230
230
|
trace_id: string;
|
|
231
231
|
|
|
232
|
-
attributes?:
|
|
232
|
+
attributes?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
233
233
|
|
|
234
234
|
end_time?: string;
|
|
235
235
|
|
|
@@ -48,7 +48,7 @@ export interface ToolDef {
|
|
|
48
48
|
|
|
49
49
|
description?: string;
|
|
50
50
|
|
|
51
|
-
metadata?:
|
|
51
|
+
metadata?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
52
52
|
|
|
53
53
|
parameters?: Array<ToolDef.Parameter>;
|
|
54
54
|
}
|
|
@@ -77,7 +77,7 @@ export interface ToolInvocationResult {
|
|
|
77
77
|
|
|
78
78
|
error_message?: string;
|
|
79
79
|
|
|
80
|
-
metadata?:
|
|
80
|
+
metadata?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export type ToolRuntimeListToolsResponse = Array<ToolDef>;
|
|
@@ -86,7 +86,7 @@ export interface ToolRuntimeInvokeToolParams {
|
|
|
86
86
|
/**
|
|
87
87
|
* A dictionary of arguments to pass to the tool.
|
|
88
88
|
*/
|
|
89
|
-
kwargs:
|
|
89
|
+
kwargs: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* The name of the tool to invoke.
|
|
@@ -53,7 +53,7 @@ export interface ToolGroup {
|
|
|
53
53
|
|
|
54
54
|
type: 'tool_group';
|
|
55
55
|
|
|
56
|
-
args?:
|
|
56
|
+
args?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
57
57
|
|
|
58
58
|
mcp_endpoint?: ToolGroup.McpEndpoint;
|
|
59
59
|
|
|
@@ -82,7 +82,7 @@ export interface ToolgroupRegisterParams {
|
|
|
82
82
|
/**
|
|
83
83
|
* A dictionary of arguments to pass to the tool group.
|
|
84
84
|
*/
|
|
85
|
-
args?:
|
|
85
|
+
args?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* The MCP endpoint to use for the tool group.
|
package/src/resources/tools.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface Tool {
|
|
|
47
47
|
|
|
48
48
|
type: 'tool';
|
|
49
49
|
|
|
50
|
-
metadata?:
|
|
50
|
+
metadata?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
51
51
|
|
|
52
52
|
provider_resource_id?: string;
|
|
53
53
|
}
|
|
@@ -41,15 +41,91 @@ export namespace QueryChunksResponse {
|
|
|
41
41
|
content: Shared.InterleavedContent;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Metadata associated with the chunk
|
|
45
|
-
*
|
|
44
|
+
* Metadata associated with the chunk that will be used in the model context during
|
|
45
|
+
* inference.
|
|
46
46
|
*/
|
|
47
|
-
metadata:
|
|
47
|
+
metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Metadata for the chunk that will NOT be used in the context during inference.
|
|
51
|
+
* The `chunk_metadata` is required backend functionality.
|
|
52
|
+
*/
|
|
53
|
+
chunk_metadata?: Chunk.ChunkMetadata;
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
56
|
* Optional embedding for the chunk. If not provided, it will be computed later.
|
|
51
57
|
*/
|
|
52
58
|
embedding?: Array<number>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The chunk ID that is stored in the vector database. Used for backend
|
|
62
|
+
* functionality.
|
|
63
|
+
*/
|
|
64
|
+
stored_chunk_id?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export namespace Chunk {
|
|
68
|
+
/**
|
|
69
|
+
* Metadata for the chunk that will NOT be used in the context during inference.
|
|
70
|
+
* The `chunk_metadata` is required backend functionality.
|
|
71
|
+
*/
|
|
72
|
+
export interface ChunkMetadata {
|
|
73
|
+
/**
|
|
74
|
+
* The dimension of the embedding vector for the chunk.
|
|
75
|
+
*/
|
|
76
|
+
chunk_embedding_dimension?: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The embedding model used to create the chunk's embedding.
|
|
80
|
+
*/
|
|
81
|
+
chunk_embedding_model?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The ID of the chunk. If not set, it will be generated based on the document ID
|
|
85
|
+
* and content.
|
|
86
|
+
*/
|
|
87
|
+
chunk_id?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The tokenizer used to create the chunk. Default is Tiktoken.
|
|
91
|
+
*/
|
|
92
|
+
chunk_tokenizer?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The window of the chunk, which can be used to group related chunks together.
|
|
96
|
+
*/
|
|
97
|
+
chunk_window?: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The number of tokens in the content of the chunk.
|
|
101
|
+
*/
|
|
102
|
+
content_token_count?: number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* An optional timestamp indicating when the chunk was created.
|
|
106
|
+
*/
|
|
107
|
+
created_timestamp?: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The ID of the document this chunk belongs to.
|
|
111
|
+
*/
|
|
112
|
+
document_id?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The number of tokens in the metadata of the chunk.
|
|
116
|
+
*/
|
|
117
|
+
metadata_token_count?: number;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The source of the content, such as a URL, file path, or other identifier.
|
|
121
|
+
*/
|
|
122
|
+
source?: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* An optional timestamp indicating when the chunk was last updated.
|
|
126
|
+
*/
|
|
127
|
+
updated_timestamp?: number;
|
|
128
|
+
}
|
|
53
129
|
}
|
|
54
130
|
}
|
|
55
131
|
|
|
@@ -85,15 +161,91 @@ export namespace VectorIoInsertParams {
|
|
|
85
161
|
content: Shared.InterleavedContent;
|
|
86
162
|
|
|
87
163
|
/**
|
|
88
|
-
* Metadata associated with the chunk
|
|
89
|
-
*
|
|
164
|
+
* Metadata associated with the chunk that will be used in the model context during
|
|
165
|
+
* inference.
|
|
90
166
|
*/
|
|
91
|
-
metadata:
|
|
167
|
+
metadata: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Metadata for the chunk that will NOT be used in the context during inference.
|
|
171
|
+
* The `chunk_metadata` is required backend functionality.
|
|
172
|
+
*/
|
|
173
|
+
chunk_metadata?: Chunk.ChunkMetadata;
|
|
92
174
|
|
|
93
175
|
/**
|
|
94
176
|
* Optional embedding for the chunk. If not provided, it will be computed later.
|
|
95
177
|
*/
|
|
96
178
|
embedding?: Array<number>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The chunk ID that is stored in the vector database. Used for backend
|
|
182
|
+
* functionality.
|
|
183
|
+
*/
|
|
184
|
+
stored_chunk_id?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export namespace Chunk {
|
|
188
|
+
/**
|
|
189
|
+
* Metadata for the chunk that will NOT be used in the context during inference.
|
|
190
|
+
* The `chunk_metadata` is required backend functionality.
|
|
191
|
+
*/
|
|
192
|
+
export interface ChunkMetadata {
|
|
193
|
+
/**
|
|
194
|
+
* The dimension of the embedding vector for the chunk.
|
|
195
|
+
*/
|
|
196
|
+
chunk_embedding_dimension?: number;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The embedding model used to create the chunk's embedding.
|
|
200
|
+
*/
|
|
201
|
+
chunk_embedding_model?: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The ID of the chunk. If not set, it will be generated based on the document ID
|
|
205
|
+
* and content.
|
|
206
|
+
*/
|
|
207
|
+
chunk_id?: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The tokenizer used to create the chunk. Default is Tiktoken.
|
|
211
|
+
*/
|
|
212
|
+
chunk_tokenizer?: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The window of the chunk, which can be used to group related chunks together.
|
|
216
|
+
*/
|
|
217
|
+
chunk_window?: string;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The number of tokens in the content of the chunk.
|
|
221
|
+
*/
|
|
222
|
+
content_token_count?: number;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* An optional timestamp indicating when the chunk was created.
|
|
226
|
+
*/
|
|
227
|
+
created_timestamp?: number;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The ID of the document this chunk belongs to.
|
|
231
|
+
*/
|
|
232
|
+
document_id?: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The number of tokens in the metadata of the chunk.
|
|
236
|
+
*/
|
|
237
|
+
metadata_token_count?: number;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The source of the content, such as a URL, file path, or other identifier.
|
|
241
|
+
*/
|
|
242
|
+
source?: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* An optional timestamp indicating when the chunk was last updated.
|
|
246
|
+
*/
|
|
247
|
+
updated_timestamp?: number;
|
|
248
|
+
}
|
|
97
249
|
}
|
|
98
250
|
}
|
|
99
251
|
|
|
@@ -111,7 +263,7 @@ export interface VectorIoQueryParams {
|
|
|
111
263
|
/**
|
|
112
264
|
* The parameters of the query.
|
|
113
265
|
*/
|
|
114
|
-
params?:
|
|
266
|
+
params?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
115
267
|
}
|
|
116
268
|
|
|
117
269
|
export declare namespace VectorIo {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
4
5
|
import * as Core from '../../core';
|
|
5
6
|
|
|
6
7
|
export class Files extends APIResource {
|
|
@@ -14,6 +15,74 @@ export class Files extends APIResource {
|
|
|
14
15
|
): Core.APIPromise<VectorStoreFile> {
|
|
15
16
|
return this._client.post(`/v1/openai/v1/vector_stores/${vectorStoreId}/files`, { body, ...options });
|
|
16
17
|
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a vector store file.
|
|
21
|
+
*/
|
|
22
|
+
retrieve(
|
|
23
|
+
vectorStoreId: string,
|
|
24
|
+
fileId: string,
|
|
25
|
+
options?: Core.RequestOptions,
|
|
26
|
+
): Core.APIPromise<VectorStoreFile> {
|
|
27
|
+
return this._client.get(`/v1/openai/v1/vector_stores/${vectorStoreId}/files/${fileId}`, options);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Updates a vector store file.
|
|
32
|
+
*/
|
|
33
|
+
update(
|
|
34
|
+
vectorStoreId: string,
|
|
35
|
+
fileId: string,
|
|
36
|
+
body: FileUpdateParams,
|
|
37
|
+
options?: Core.RequestOptions,
|
|
38
|
+
): Core.APIPromise<VectorStoreFile> {
|
|
39
|
+
return this._client.post(`/v1/openai/v1/vector_stores/${vectorStoreId}/files/${fileId}`, {
|
|
40
|
+
body,
|
|
41
|
+
...options,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* List files in a vector store.
|
|
47
|
+
*/
|
|
48
|
+
list(
|
|
49
|
+
vectorStoreId: string,
|
|
50
|
+
query?: FileListParams,
|
|
51
|
+
options?: Core.RequestOptions,
|
|
52
|
+
): Core.APIPromise<FileListResponse>;
|
|
53
|
+
list(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<FileListResponse>;
|
|
54
|
+
list(
|
|
55
|
+
vectorStoreId: string,
|
|
56
|
+
query: FileListParams | Core.RequestOptions = {},
|
|
57
|
+
options?: Core.RequestOptions,
|
|
58
|
+
): Core.APIPromise<FileListResponse> {
|
|
59
|
+
if (isRequestOptions(query)) {
|
|
60
|
+
return this.list(vectorStoreId, {}, query);
|
|
61
|
+
}
|
|
62
|
+
return this._client.get(`/v1/openai/v1/vector_stores/${vectorStoreId}/files`, { query, ...options });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Delete a vector store file.
|
|
67
|
+
*/
|
|
68
|
+
delete(
|
|
69
|
+
vectorStoreId: string,
|
|
70
|
+
fileId: string,
|
|
71
|
+
options?: Core.RequestOptions,
|
|
72
|
+
): Core.APIPromise<FileDeleteResponse> {
|
|
73
|
+
return this._client.delete(`/v1/openai/v1/vector_stores/${vectorStoreId}/files/${fileId}`, options);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the contents of a vector store file.
|
|
78
|
+
*/
|
|
79
|
+
content(
|
|
80
|
+
vectorStoreId: string,
|
|
81
|
+
fileId: string,
|
|
82
|
+
options?: Core.RequestOptions,
|
|
83
|
+
): Core.APIPromise<FileContentResponse> {
|
|
84
|
+
return this._client.get(`/v1/openai/v1/vector_stores/${vectorStoreId}/files/${fileId}/content`, options);
|
|
85
|
+
}
|
|
17
86
|
}
|
|
18
87
|
|
|
19
88
|
/**
|
|
@@ -22,7 +91,7 @@ export class Files extends APIResource {
|
|
|
22
91
|
export interface VectorStoreFile {
|
|
23
92
|
id: string;
|
|
24
93
|
|
|
25
|
-
attributes:
|
|
94
|
+
attributes: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
26
95
|
|
|
27
96
|
chunking_strategy:
|
|
28
97
|
| VectorStoreFile.VectorStoreChunkingStrategyAuto
|
|
@@ -67,6 +136,53 @@ export namespace VectorStoreFile {
|
|
|
67
136
|
}
|
|
68
137
|
}
|
|
69
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Response from listing vector stores.
|
|
141
|
+
*/
|
|
142
|
+
export interface FileListResponse {
|
|
143
|
+
data: Array<VectorStoreFile>;
|
|
144
|
+
|
|
145
|
+
has_more: boolean;
|
|
146
|
+
|
|
147
|
+
object: string;
|
|
148
|
+
|
|
149
|
+
first_id?: string;
|
|
150
|
+
|
|
151
|
+
last_id?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Response from deleting a vector store file.
|
|
156
|
+
*/
|
|
157
|
+
export interface FileDeleteResponse {
|
|
158
|
+
id: string;
|
|
159
|
+
|
|
160
|
+
deleted: boolean;
|
|
161
|
+
|
|
162
|
+
object: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Response from retrieving the contents of a vector store file.
|
|
167
|
+
*/
|
|
168
|
+
export interface FileContentResponse {
|
|
169
|
+
attributes: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
170
|
+
|
|
171
|
+
content: Array<FileContentResponse.Content>;
|
|
172
|
+
|
|
173
|
+
file_id: string;
|
|
174
|
+
|
|
175
|
+
filename: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export namespace FileContentResponse {
|
|
179
|
+
export interface Content {
|
|
180
|
+
text: string;
|
|
181
|
+
|
|
182
|
+
type: 'text';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
70
186
|
export interface FileCreateParams {
|
|
71
187
|
/**
|
|
72
188
|
* The ID of the file to attach to the vector store.
|
|
@@ -76,7 +192,7 @@ export interface FileCreateParams {
|
|
|
76
192
|
/**
|
|
77
193
|
* The key-value attributes stored with the file, which can be used for filtering.
|
|
78
194
|
*/
|
|
79
|
-
attributes?:
|
|
195
|
+
attributes?: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
80
196
|
|
|
81
197
|
/**
|
|
82
198
|
* The chunking strategy to use for the file.
|
|
@@ -106,6 +222,33 @@ export namespace FileCreateParams {
|
|
|
106
222
|
}
|
|
107
223
|
}
|
|
108
224
|
|
|
225
|
+
export interface FileUpdateParams {
|
|
226
|
+
/**
|
|
227
|
+
* The updated key-value attributes to store with the file.
|
|
228
|
+
*/
|
|
229
|
+
attributes: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface FileListParams {
|
|
233
|
+
after?: string;
|
|
234
|
+
|
|
235
|
+
before?: string;
|
|
236
|
+
|
|
237
|
+
filter?: 'completed' | 'in_progress' | 'cancelled' | 'failed';
|
|
238
|
+
|
|
239
|
+
limit?: number;
|
|
240
|
+
|
|
241
|
+
order?: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
109
244
|
export declare namespace Files {
|
|
110
|
-
export {
|
|
245
|
+
export {
|
|
246
|
+
type VectorStoreFile as VectorStoreFile,
|
|
247
|
+
type FileListResponse as FileListResponse,
|
|
248
|
+
type FileDeleteResponse as FileDeleteResponse,
|
|
249
|
+
type FileContentResponse as FileContentResponse,
|
|
250
|
+
type FileCreateParams as FileCreateParams,
|
|
251
|
+
type FileUpdateParams as FileUpdateParams,
|
|
252
|
+
type FileListParams as FileListParams,
|
|
253
|
+
};
|
|
111
254
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
Files,
|
|
5
|
+
type VectorStoreFile,
|
|
6
|
+
type FileListResponse,
|
|
7
|
+
type FileDeleteResponse,
|
|
8
|
+
type FileContentResponse,
|
|
9
|
+
type FileCreateParams,
|
|
10
|
+
type FileUpdateParams,
|
|
11
|
+
type FileListParams,
|
|
12
|
+
} from './files';
|
|
4
13
|
export {
|
|
5
14
|
VectorStores,
|
|
6
15
|
type ListVectorStoresResponse,
|