@letta-ai/letta-client 1.2.0 → 1.3.1
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/CHANGELOG.md +20 -0
- package/client.d.mts +10 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -4
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +18 -13
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +18 -13
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -1
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -1
- 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/tools.d.mts +59 -1
- package/resources/agents/tools.d.mts.map +1 -1
- package/resources/agents/tools.d.ts +59 -1
- package/resources/agents/tools.d.ts.map +1 -1
- package/resources/agents/tools.js +10 -0
- package/resources/agents/tools.js.map +1 -1
- package/resources/agents/tools.mjs +10 -0
- package/resources/agents/tools.mjs.map +1 -1
- package/resources/archives/archives.d.mts +2 -2
- package/resources/archives/archives.d.mts.map +1 -1
- package/resources/archives/archives.d.ts +2 -2
- package/resources/archives/archives.d.ts.map +1 -1
- package/resources/archives/archives.js.map +1 -1
- package/resources/archives/archives.mjs.map +1 -1
- package/resources/archives/index.d.mts +1 -1
- package/resources/archives/index.d.mts.map +1 -1
- package/resources/archives/index.d.ts +1 -1
- package/resources/archives/index.d.ts.map +1 -1
- package/resources/archives/index.js.map +1 -1
- package/resources/archives/index.mjs +1 -1
- package/resources/archives/index.mjs.map +1 -1
- package/resources/archives/passages.d.mts +3 -71
- package/resources/archives/passages.d.mts.map +1 -1
- package/resources/archives/passages.d.ts +3 -71
- package/resources/archives/passages.d.ts.map +1 -1
- package/resources/blocks/agents.d.mts +4 -4
- package/resources/blocks/agents.d.ts +4 -4
- package/resources/blocks/blocks.d.mts +9 -8
- package/resources/blocks/blocks.d.mts.map +1 -1
- package/resources/blocks/blocks.d.ts +9 -8
- package/resources/blocks/blocks.d.ts.map +1 -1
- package/resources/blocks/blocks.js.map +1 -1
- package/resources/blocks/blocks.mjs.map +1 -1
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/mcp-servers/index.d.mts +1 -1
- package/resources/mcp-servers/index.d.mts.map +1 -1
- package/resources/mcp-servers/index.d.ts +1 -1
- package/resources/mcp-servers/index.d.ts.map +1 -1
- package/resources/mcp-servers/index.js.map +1 -1
- package/resources/mcp-servers/index.mjs.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.mts +1 -41
- package/resources/mcp-servers/mcp-servers.d.mts.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.ts +1 -41
- package/resources/mcp-servers/mcp-servers.d.ts.map +1 -1
- package/resources/mcp-servers/mcp-servers.js.map +1 -1
- package/resources/mcp-servers/mcp-servers.mjs.map +1 -1
- package/resources/mcp-servers/tools.d.mts +4 -4
- package/resources/mcp-servers/tools.d.mts.map +1 -1
- package/resources/mcp-servers/tools.d.ts +4 -4
- package/resources/mcp-servers/tools.d.ts.map +1 -1
- package/resources/mcp-servers/tools.js +1 -1
- package/resources/mcp-servers/tools.mjs +1 -1
- package/resources/messages.d.mts +114 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +114 -0
- package/resources/messages.d.ts.map +1 -0
- package/resources/messages.js +24 -0
- package/resources/messages.js.map +1 -0
- package/resources/messages.mjs +20 -0
- package/resources/messages.mjs.map +1 -0
- package/resources/models/models.d.mts +11 -0
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +11 -0
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/passages.d.mts +150 -0
- package/resources/passages.d.mts.map +1 -0
- package/resources/passages.d.ts +150 -0
- package/resources/passages.d.ts.map +1 -0
- package/resources/passages.js +25 -0
- package/resources/passages.js.map +1 -0
- package/resources/passages.mjs +21 -0
- package/resources/passages.mjs.map +1 -0
- package/resources/tools.d.mts +83 -1
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +83 -1
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +11 -0
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +11 -0
- package/resources/tools.mjs.map +1 -1
- package/src/client.ts +39 -4
- package/src/resources/agents/agents.ts +30 -12
- package/src/resources/agents/index.ts +3 -0
- package/src/resources/agents/tools.ts +70 -0
- package/src/resources/archives/archives.ts +1 -2
- package/src/resources/archives/index.ts +1 -6
- package/src/resources/archives/passages.ts +3 -88
- package/src/resources/blocks/agents.ts +4 -4
- package/src/resources/blocks/blocks.ts +9 -8
- package/src/resources/index.ts +14 -2
- package/src/resources/mcp-servers/index.ts +0 -2
- package/src/resources/mcp-servers/mcp-servers.ts +0 -47
- package/src/resources/mcp-servers/tools.ts +4 -4
- package/src/resources/messages.ts +165 -0
- package/src/resources/models/models.ts +21 -0
- package/src/resources/passages.ts +182 -0
- package/src/resources/tools.ts +105 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as ToolsAPI from '../tools';
|
|
5
|
-
import * as
|
|
5
|
+
import * as AgentsToolsAPI from '../agents/tools';
|
|
6
6
|
import { APIPromise } from '../../core/api-promise';
|
|
7
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
8
|
import { path } from '../../internal/utils/path';
|
|
@@ -26,14 +26,14 @@ export class Tools extends APIResource {
|
|
|
26
26
|
/**
|
|
27
27
|
* Execute a specific MCP tool
|
|
28
28
|
*
|
|
29
|
-
* The request body should contain the tool arguments in the
|
|
29
|
+
* The request body should contain the tool arguments in the ToolExecuteRequest
|
|
30
30
|
* format.
|
|
31
31
|
*/
|
|
32
32
|
run(
|
|
33
33
|
toolID: string,
|
|
34
34
|
params: ToolRunParams,
|
|
35
35
|
options?: RequestOptions,
|
|
36
|
-
): APIPromise<
|
|
36
|
+
): APIPromise<AgentsToolsAPI.ToolExecutionResult> {
|
|
37
37
|
const { mcp_server_id, ...body } = params;
|
|
38
38
|
return this._client.post(path`/v1/mcp-servers/${mcp_server_id}/tools/${toolID}/run`, {
|
|
39
39
|
body,
|
|
@@ -55,7 +55,7 @@ export interface ToolRunParams {
|
|
|
55
55
|
mcp_server_id: string;
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Body param: Arguments to pass to the
|
|
58
|
+
* Body param: Arguments to pass to the tool
|
|
59
59
|
*/
|
|
60
60
|
args?: { [key: string]: unknown };
|
|
61
61
|
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as ToolsAPI from './tools';
|
|
5
|
+
import * as AgentsMessagesAPI from './agents/messages';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
|
|
9
|
+
export class Messages extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List messages across all agents for the current user.
|
|
12
|
+
*/
|
|
13
|
+
list(
|
|
14
|
+
query: MessageListParams | null | undefined = {},
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<MessageListResponse> {
|
|
17
|
+
return this._client.get('/v1/messages/', { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Search messages across the organization with optional agent filtering. Returns
|
|
22
|
+
* messages with FTS/vector ranks and total RRF score.
|
|
23
|
+
*
|
|
24
|
+
* This is a cloud-only feature.
|
|
25
|
+
*/
|
|
26
|
+
search(body: MessageSearchParams, options?: RequestOptions): APIPromise<MessageSearchResponse> {
|
|
27
|
+
return this._client.post('/v1/messages/search', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface MessageSearchRequest {
|
|
32
|
+
/**
|
|
33
|
+
* Text query for full-text search
|
|
34
|
+
*/
|
|
35
|
+
query: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Filter messages created on or before this date
|
|
39
|
+
*/
|
|
40
|
+
end_date?: string | null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of results to return
|
|
44
|
+
*/
|
|
45
|
+
limit?: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Search mode to use
|
|
49
|
+
*/
|
|
50
|
+
search_mode?: 'vector' | 'fts' | 'hybrid';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Filter messages created after this date
|
|
54
|
+
*/
|
|
55
|
+
start_date?: string | null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Result from a message search operation with scoring details.
|
|
60
|
+
*/
|
|
61
|
+
export interface MessageSearchResult {
|
|
62
|
+
/**
|
|
63
|
+
* The embedded content (LLM-friendly)
|
|
64
|
+
*/
|
|
65
|
+
embedded_text: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The raw message object
|
|
69
|
+
*/
|
|
70
|
+
message: AgentsMessagesAPI.InternalMessage;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Reciprocal Rank Fusion combined score
|
|
74
|
+
*/
|
|
75
|
+
rrf_score: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Full-text search rank position if FTS was used
|
|
79
|
+
*/
|
|
80
|
+
fts_rank?: number | null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Vector search rank position if vector search was used
|
|
84
|
+
*/
|
|
85
|
+
vector_rank?: number | null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type MessageListResponse = Array<AgentsMessagesAPI.Message>;
|
|
89
|
+
|
|
90
|
+
export type MessageSearchResponse = Array<
|
|
91
|
+
| AgentsMessagesAPI.SystemMessage
|
|
92
|
+
| AgentsMessagesAPI.UserMessage
|
|
93
|
+
| AgentsMessagesAPI.ReasoningMessage
|
|
94
|
+
| AgentsMessagesAPI.HiddenReasoningMessage
|
|
95
|
+
| AgentsMessagesAPI.ToolCallMessage
|
|
96
|
+
| ToolsAPI.ToolReturnMessage
|
|
97
|
+
| AgentsMessagesAPI.AssistantMessage
|
|
98
|
+
| AgentsMessagesAPI.ApprovalRequestMessage
|
|
99
|
+
| AgentsMessagesAPI.ApprovalResponseMessage
|
|
100
|
+
| AgentsMessagesAPI.SummaryMessage
|
|
101
|
+
| AgentsMessagesAPI.EventMessage
|
|
102
|
+
>;
|
|
103
|
+
|
|
104
|
+
export interface MessageListParams {
|
|
105
|
+
/**
|
|
106
|
+
* Message ID cursor for pagination. Returns messages that come after this message
|
|
107
|
+
* ID in the specified sort order
|
|
108
|
+
*/
|
|
109
|
+
after?: string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Message ID cursor for pagination. Returns messages that come before this message
|
|
113
|
+
* ID in the specified sort order
|
|
114
|
+
*/
|
|
115
|
+
before?: string | null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Maximum number of messages to return
|
|
119
|
+
*/
|
|
120
|
+
limit?: number | null;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
|
|
124
|
+
* newest first
|
|
125
|
+
*/
|
|
126
|
+
order?: 'asc' | 'desc';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface MessageSearchParams {
|
|
130
|
+
/**
|
|
131
|
+
* Text query for full-text search
|
|
132
|
+
*/
|
|
133
|
+
query: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Filter messages created on or before this date
|
|
137
|
+
*/
|
|
138
|
+
end_date?: string | null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Maximum number of results to return
|
|
142
|
+
*/
|
|
143
|
+
limit?: number;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Search mode to use
|
|
147
|
+
*/
|
|
148
|
+
search_mode?: 'vector' | 'fts' | 'hybrid';
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Filter messages created after this date
|
|
152
|
+
*/
|
|
153
|
+
start_date?: string | null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export declare namespace Messages {
|
|
157
|
+
export {
|
|
158
|
+
type MessageSearchRequest as MessageSearchRequest,
|
|
159
|
+
type MessageSearchResult as MessageSearchResult,
|
|
160
|
+
type MessageListResponse as MessageListResponse,
|
|
161
|
+
type MessageSearchResponse as MessageSearchResponse,
|
|
162
|
+
type MessageListParams as MessageListParams,
|
|
163
|
+
type MessageSearchParams as MessageSearchParams,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -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 '../../core/resource';
|
|
4
|
+
import * as AgentsAPI from '../agents/agents';
|
|
4
5
|
import * as EmbeddingsAPI from './embeddings';
|
|
5
6
|
import { EmbeddingListResponse, Embeddings } from './embeddings';
|
|
6
7
|
import { APIPromise } from '../../core/api-promise';
|
|
@@ -326,6 +327,16 @@ export interface LlmConfig {
|
|
|
326
327
|
*/
|
|
327
328
|
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | null;
|
|
328
329
|
|
|
330
|
+
/**
|
|
331
|
+
* The response format for the model's output. Supports text, json_object, and
|
|
332
|
+
* json_schema (structured outputs). Can be set via model_settings.
|
|
333
|
+
*/
|
|
334
|
+
response_format?:
|
|
335
|
+
| AgentsAPI.TextResponseFormat
|
|
336
|
+
| AgentsAPI.JsonSchemaResponseFormat
|
|
337
|
+
| AgentsAPI.JsonObjectResponseFormat
|
|
338
|
+
| null;
|
|
339
|
+
|
|
329
340
|
/**
|
|
330
341
|
* The temperature to use when generating text with the model. A higher temperature
|
|
331
342
|
* will result in more random text.
|
|
@@ -481,6 +492,16 @@ export interface Model {
|
|
|
481
492
|
*/
|
|
482
493
|
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | null;
|
|
483
494
|
|
|
495
|
+
/**
|
|
496
|
+
* The response format for the model's output. Supports text, json_object, and
|
|
497
|
+
* json_schema (structured outputs). Can be set via model_settings.
|
|
498
|
+
*/
|
|
499
|
+
response_format?:
|
|
500
|
+
| AgentsAPI.TextResponseFormat
|
|
501
|
+
| AgentsAPI.JsonSchemaResponseFormat
|
|
502
|
+
| AgentsAPI.JsonObjectResponseFormat
|
|
503
|
+
| null;
|
|
504
|
+
|
|
484
505
|
/**
|
|
485
506
|
* @deprecated Deprecated: The temperature to use when generating text with the
|
|
486
507
|
* model.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as PassagesAPI from './passages';
|
|
5
|
+
import * as ModelsAPI from './models/models';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
|
|
9
|
+
export class Passages extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Search passages across the organization with optional agent and archive
|
|
12
|
+
* filtering. Returns passages with relevance scores.
|
|
13
|
+
*
|
|
14
|
+
* This endpoint supports semantic search through passages:
|
|
15
|
+
*
|
|
16
|
+
* - If neither agent_id nor archive_id is provided, searches ALL passages in the
|
|
17
|
+
* organization
|
|
18
|
+
* - If agent_id is provided, searches passages across all archives attached to
|
|
19
|
+
* that agent
|
|
20
|
+
* - If archive_id is provided, searches passages within that specific archive
|
|
21
|
+
* - If both are provided, agent_id takes precedence
|
|
22
|
+
*/
|
|
23
|
+
search(body: PassageSearchParams, options?: RequestOptions): APIPromise<PassageSearchResponse> {
|
|
24
|
+
return this._client.post('/v1/passages/search', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Representation of a passage, which is stored in archival memory.
|
|
30
|
+
*/
|
|
31
|
+
export interface Passage {
|
|
32
|
+
/**
|
|
33
|
+
* The embedding of the passage.
|
|
34
|
+
*/
|
|
35
|
+
embedding: Array<number> | null;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Configuration for embedding model connection and processing parameters.
|
|
39
|
+
*/
|
|
40
|
+
embedding_config: ModelsAPI.EmbeddingConfig | null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The text of the passage.
|
|
44
|
+
*/
|
|
45
|
+
text: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The human-friendly ID of the Passage
|
|
49
|
+
*/
|
|
50
|
+
id?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The unique identifier of the archive containing this passage.
|
|
54
|
+
*/
|
|
55
|
+
archive_id?: string | null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The creation date of the passage.
|
|
59
|
+
*/
|
|
60
|
+
created_at?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The id of the user that made this object.
|
|
64
|
+
*/
|
|
65
|
+
created_by_id?: string | null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The unique identifier of the file associated with the passage.
|
|
69
|
+
*/
|
|
70
|
+
file_id?: string | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The name of the file (only for source passages).
|
|
74
|
+
*/
|
|
75
|
+
file_name?: string | null;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Whether this passage is deleted or not.
|
|
79
|
+
*/
|
|
80
|
+
is_deleted?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The id of the user that made this object.
|
|
84
|
+
*/
|
|
85
|
+
last_updated_by_id?: string | null;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The metadata of the passage.
|
|
89
|
+
*/
|
|
90
|
+
metadata?: { [key: string]: unknown } | null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Deprecated: Use `folder_id` field instead. The data source of the
|
|
94
|
+
* passage.
|
|
95
|
+
*/
|
|
96
|
+
source_id?: string | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Tags associated with this passage.
|
|
100
|
+
*/
|
|
101
|
+
tags?: Array<string> | null;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The timestamp when the object was last updated.
|
|
105
|
+
*/
|
|
106
|
+
updated_at?: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type PassageSearchResponse = Array<PassageSearchResponse.PassageSearchResponseItem>;
|
|
110
|
+
|
|
111
|
+
export namespace PassageSearchResponse {
|
|
112
|
+
/**
|
|
113
|
+
* Result from a passage search operation with scoring details.
|
|
114
|
+
*/
|
|
115
|
+
export interface PassageSearchResponseItem {
|
|
116
|
+
/**
|
|
117
|
+
* The passage object
|
|
118
|
+
*/
|
|
119
|
+
passage: PassagesAPI.Passage;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Relevance score
|
|
123
|
+
*/
|
|
124
|
+
score: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Additional metadata about the search result
|
|
128
|
+
*/
|
|
129
|
+
metadata?: { [key: string]: unknown };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface PassageSearchParams {
|
|
134
|
+
/**
|
|
135
|
+
* Text query for semantic search
|
|
136
|
+
*/
|
|
137
|
+
query: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Filter passages by agent ID
|
|
141
|
+
*/
|
|
142
|
+
agent_id?: string | null;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Filter passages by archive ID
|
|
146
|
+
*/
|
|
147
|
+
archive_id?: string | null;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Filter results to passages created before this datetime
|
|
151
|
+
*/
|
|
152
|
+
end_date?: string | null;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Maximum number of results to return
|
|
156
|
+
*/
|
|
157
|
+
limit?: number;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Filter results to passages created after this datetime
|
|
161
|
+
*/
|
|
162
|
+
start_date?: string | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* How to match tags - 'any' to match passages with any of the tags, 'all' to match
|
|
166
|
+
* only passages with all tags
|
|
167
|
+
*/
|
|
168
|
+
tag_match_mode?: 'any' | 'all';
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Optional list of tags to filter search results
|
|
172
|
+
*/
|
|
173
|
+
tags?: Array<string> | null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare namespace Passages {
|
|
177
|
+
export {
|
|
178
|
+
type Passage as Passage,
|
|
179
|
+
type PassageSearchResponse as PassageSearchResponse,
|
|
180
|
+
type PassageSearchParams as PassageSearchParams,
|
|
181
|
+
};
|
|
182
|
+
}
|
package/src/resources/tools.ts
CHANGED
|
@@ -46,6 +46,18 @@ export class Tools extends APIResource {
|
|
|
46
46
|
return this._client.delete(path`/v1/tools/${toolID}`, options);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Search tools using semantic search.
|
|
51
|
+
*
|
|
52
|
+
* Requires tool embedding to be enabled (embed_tools=True). Uses vector search,
|
|
53
|
+
* full-text search, or hybrid mode to find tools matching the query.
|
|
54
|
+
*
|
|
55
|
+
* Returns tools ranked by relevance with their search scores.
|
|
56
|
+
*/
|
|
57
|
+
search(body: ToolSearchParams, options?: RequestOptions): APIPromise<ToolSearchResponse> {
|
|
58
|
+
return this._client.post('/v1/tools/search', { body, ...options });
|
|
59
|
+
}
|
|
60
|
+
|
|
49
61
|
/**
|
|
50
62
|
* Create or update a tool
|
|
51
63
|
*/
|
|
@@ -304,6 +316,66 @@ export interface ToolReturnMessage {
|
|
|
304
316
|
tool_returns?: Array<MessagesAPI.ToolReturn> | null;
|
|
305
317
|
}
|
|
306
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Request model for searching tools using semantic search.
|
|
321
|
+
*/
|
|
322
|
+
export interface ToolSearchRequest {
|
|
323
|
+
/**
|
|
324
|
+
* Maximum number of results to return.
|
|
325
|
+
*/
|
|
326
|
+
limit?: number;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Text query for semantic search.
|
|
330
|
+
*/
|
|
331
|
+
query?: string | null;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Search mode: vector, fts, or hybrid.
|
|
335
|
+
*/
|
|
336
|
+
search_mode?: 'vector' | 'fts' | 'hybrid';
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Filter by tags (match any).
|
|
340
|
+
*/
|
|
341
|
+
tags?: Array<string> | null;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Filter by tool types (e.g., 'custom', 'letta_core').
|
|
345
|
+
*/
|
|
346
|
+
tool_types?: Array<string> | null;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Result from a tool search operation.
|
|
351
|
+
*/
|
|
352
|
+
export interface ToolSearchResult {
|
|
353
|
+
/**
|
|
354
|
+
* Combined relevance score (RRF for hybrid mode).
|
|
355
|
+
*/
|
|
356
|
+
combined_score: number;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* The matched tool.
|
|
360
|
+
*/
|
|
361
|
+
tool: Tool;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* The embedded text content used for matching.
|
|
365
|
+
*/
|
|
366
|
+
embedded_text?: string | null;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Full-text search rank position.
|
|
370
|
+
*/
|
|
371
|
+
fts_rank?: number | null;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Vector search rank position.
|
|
375
|
+
*/
|
|
376
|
+
vector_rank?: number | null;
|
|
377
|
+
}
|
|
378
|
+
|
|
307
379
|
export type ToolType =
|
|
308
380
|
| 'custom'
|
|
309
381
|
| 'letta_core'
|
|
@@ -319,6 +391,8 @@ export type ToolType =
|
|
|
319
391
|
|
|
320
392
|
export type ToolDeleteResponse = unknown;
|
|
321
393
|
|
|
394
|
+
export type ToolSearchResponse = Array<ToolSearchResult>;
|
|
395
|
+
|
|
322
396
|
export type ToolUpsertBaseToolsResponse = Array<Tool>;
|
|
323
397
|
|
|
324
398
|
export interface ToolCreateParams {
|
|
@@ -481,6 +555,33 @@ export interface ToolListParams extends ArrayPageParams {
|
|
|
481
555
|
tool_types?: Array<string> | null;
|
|
482
556
|
}
|
|
483
557
|
|
|
558
|
+
export interface ToolSearchParams {
|
|
559
|
+
/**
|
|
560
|
+
* Maximum number of results to return.
|
|
561
|
+
*/
|
|
562
|
+
limit?: number;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Text query for semantic search.
|
|
566
|
+
*/
|
|
567
|
+
query?: string | null;
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Search mode: vector, fts, or hybrid.
|
|
571
|
+
*/
|
|
572
|
+
search_mode?: 'vector' | 'fts' | 'hybrid';
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Filter by tags (match any).
|
|
576
|
+
*/
|
|
577
|
+
tags?: Array<string> | null;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Filter by tool types (e.g., 'custom', 'letta_core').
|
|
581
|
+
*/
|
|
582
|
+
tool_types?: Array<string> | null;
|
|
583
|
+
}
|
|
584
|
+
|
|
484
585
|
export interface ToolUpsertParams {
|
|
485
586
|
/**
|
|
486
587
|
* The source code of the function.
|
|
@@ -547,13 +648,17 @@ export declare namespace Tools {
|
|
|
547
648
|
type Tool as Tool,
|
|
548
649
|
type ToolCreate as ToolCreate,
|
|
549
650
|
type ToolReturnMessage as ToolReturnMessage,
|
|
651
|
+
type ToolSearchRequest as ToolSearchRequest,
|
|
652
|
+
type ToolSearchResult as ToolSearchResult,
|
|
550
653
|
type ToolType as ToolType,
|
|
551
654
|
type ToolDeleteResponse as ToolDeleteResponse,
|
|
655
|
+
type ToolSearchResponse as ToolSearchResponse,
|
|
552
656
|
type ToolUpsertBaseToolsResponse as ToolUpsertBaseToolsResponse,
|
|
553
657
|
type ToolsArrayPage as ToolsArrayPage,
|
|
554
658
|
type ToolCreateParams as ToolCreateParams,
|
|
555
659
|
type ToolUpdateParams as ToolUpdateParams,
|
|
556
660
|
type ToolListParams as ToolListParams,
|
|
661
|
+
type ToolSearchParams as ToolSearchParams,
|
|
557
662
|
type ToolUpsertParams as ToolUpsertParams,
|
|
558
663
|
};
|
|
559
664
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.3.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.3.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.3.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.3.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|