lemma-sdk 0.2.36 → 0.2.38
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/README.md +45 -30
- package/dist/browser/lemma-client.js +224 -212
- package/dist/client.d.ts +1 -4
- package/dist/client.js +1 -6
- package/dist/index.d.ts +2 -5
- package/dist/index.js +1 -2
- package/dist/namespaces/agents.js +1 -1
- package/dist/namespaces/conversations.d.ts +68 -0
- package/dist/namespaces/conversations.js +159 -0
- package/dist/namespaces/files.d.ts +24 -6
- package/dist/namespaces/files.js +25 -12
- package/dist/namespaces/integrations.js +1 -1
- package/dist/namespaces/pod-surfaces.d.ts +1 -1
- package/dist/namespaces/pod-surfaces.js +6 -6
- package/dist/openapi_client/index.d.ts +17 -32
- package/dist/openapi_client/index.js +8 -12
- package/dist/openapi_client/models/AdminConsentInfoResponse.d.ts +2 -2
- package/dist/openapi_client/models/AgentListResponse.d.ts +2 -4
- package/dist/openapi_client/models/AgentMessageResponse.d.ts +0 -3
- package/dist/openapi_client/models/{AvailableModels.d.ts → AgentModelName.d.ts} +4 -1
- package/dist/openapi_client/models/AgentModelName.js +18 -0
- package/dist/openapi_client/models/AgentResponse.d.ts +18 -13
- package/dist/openapi_client/models/AgentSurfaceListResponse.d.ts +6 -0
- package/dist/openapi_client/models/{AssistantSurfaceResponse.d.ts → AgentSurfaceResponse.d.ts} +6 -5
- package/dist/openapi_client/models/{AssistantSurfaceStatus.d.ts → AgentSurfaceStatus.d.ts} +1 -1
- package/dist/openapi_client/models/AgentSurfaceStatus.js +10 -0
- package/dist/openapi_client/models/{ToolSet.d.ts → AgentToolset.d.ts} +3 -5
- package/dist/openapi_client/models/AgentToolset.js +17 -0
- package/dist/openapi_client/models/ApplicationAccessConfig.d.ts +3 -5
- package/dist/openapi_client/models/ApplicationMode.d.ts +3 -3
- package/dist/openapi_client/models/ApplicationMode.js +3 -3
- package/dist/openapi_client/models/ConversationResponse.d.ts +9 -20
- package/dist/openapi_client/models/CreateAgentRequest.d.ts +11 -7
- package/dist/openapi_client/models/CreateConversationRequest.d.ts +4 -8
- package/dist/openapi_client/models/CreateFolderRequest.d.ts +2 -5
- package/dist/openapi_client/models/CreateFunctionRequest.d.ts +2 -2
- package/dist/openapi_client/models/CreateSurfaceRequest.d.ts +1 -1
- package/dist/openapi_client/models/DatastoreFileUploadRequest.d.ts +2 -2
- package/dist/openapi_client/models/FileNamespace.d.ts +4 -0
- package/dist/openapi_client/models/FileNamespace.js +9 -0
- package/dist/openapi_client/models/FileResponse.d.ts +2 -2
- package/dist/openapi_client/models/FlowRunEntity.d.ts +10 -1
- package/dist/openapi_client/models/FunctionResponse.d.ts +2 -2
- package/dist/openapi_client/models/HarnessKind.d.ts +7 -0
- package/dist/openapi_client/models/HarnessKind.js +12 -0
- package/dist/openapi_client/models/MessageListResponse.d.ts +6 -0
- package/dist/openapi_client/models/{TaskMessageResponse.d.ts → MessageResponse.d.ts} +8 -7
- package/dist/openapi_client/models/OrganizationInvitationResponse.d.ts +1 -0
- package/dist/openapi_client/models/ReportFeedbackResponse.d.ts +0 -4
- package/dist/openapi_client/models/ResourceType.d.ts +0 -1
- package/dist/openapi_client/models/ResourceType.js +0 -1
- package/dist/openapi_client/models/SendMessageRequest.d.ts +5 -0
- package/dist/openapi_client/models/{ToolCallRequest.d.ts → ToolCallContent.d.ts} +1 -1
- package/dist/openapi_client/models/{ToolCallResponse.d.ts → ToolReturnContent.d.ts} +2 -1
- package/dist/openapi_client/models/UpdateAgentRequest.d.ts +11 -7
- package/dist/openapi_client/models/UpdateConversationRequest.d.ts +2 -5
- package/dist/openapi_client/models/UpdateFunctionRequest.d.ts +2 -2
- package/dist/openapi_client/models/app__modules__agent__domain__value_objects__TableAccessEntry.d.ts +8 -0
- package/dist/openapi_client/models/{TableAccessEntry.d.ts → app__modules__function__api__schemas__function_schemas__TableAccessEntry.d.ts} +1 -1
- package/dist/openapi_client/models/update.d.ts +2 -2
- package/dist/openapi_client/services/AgentConversationsService.d.ts +87 -0
- package/dist/openapi_client/services/{ConversationsService.js → AgentConversationsService.js} +61 -72
- package/dist/openapi_client/services/{AssistantSurfacesIngressService.d.ts → AgentSurfacesIngressService.d.ts} +2 -2
- package/dist/openapi_client/services/{AssistantSurfacesIngressService.js → AgentSurfacesIngressService.js} +2 -2
- package/dist/openapi_client/services/{AssistantSurfacesService.d.ts → AgentSurfacesService.d.ts} +11 -11
- package/dist/openapi_client/services/{AssistantSurfacesService.js → AgentSurfacesService.js} +10 -10
- package/dist/openapi_client/services/AgentToolsService.d.ts +8 -8
- package/dist/openapi_client/services/AgentToolsService.js +8 -8
- package/dist/openapi_client/services/AgentsService.d.ts +7 -7
- package/dist/openapi_client/services/AgentsService.js +8 -8
- package/dist/openapi_client/services/FilesService.d.ts +17 -8
- package/dist/openapi_client/services/FilesService.js +25 -8
- package/dist/openapi_client/services/WorkflowsService.d.ts +1 -1
- package/dist/openapi_client/services/WorkflowsService.js +1 -1
- package/dist/react/index.d.ts +0 -8
- package/dist/react/index.js +0 -4
- package/dist/react/useAssistantController.d.ts +6 -2
- package/dist/react/useAssistantController.js +56 -15
- package/dist/react/useAssistantSession.d.ts +15 -5
- package/dist/react/useAssistantSession.js +24 -26
- package/dist/react/useConversationMessages.d.ts +6 -2
- package/dist/react/useConversationMessages.js +2 -1
- package/dist/react/useConversations.d.ts +6 -2
- package/dist/react/useConversations.js +7 -5
- package/dist/react/useCreateFolder.d.ts +4 -2
- package/dist/react/useCreateFolder.js +6 -3
- package/dist/react/useDeleteFile.d.ts +4 -1
- package/dist/react/useDeleteFile.js +3 -3
- package/dist/react/useFile.d.ts +4 -2
- package/dist/react/useFile.js +3 -3
- package/dist/react/useFilePreview.d.ts +4 -1
- package/dist/react/useFilePreview.js +5 -4
- package/dist/react/useFileTree.d.ts +4 -2
- package/dist/react/useFileTree.js +3 -2
- package/dist/react/useFiles.d.ts +4 -2
- package/dist/react/useFiles.js +5 -3
- package/dist/react/useUpdateFile.d.ts +4 -2
- package/dist/react/useUpdateFile.js +6 -3
- package/dist/react/useUploadFile.d.ts +4 -2
- package/dist/react/useUploadFile.js +6 -3
- package/dist/react/useWorkflowRun.js +1 -1
- package/dist/react/useWorkflowStart.js +1 -1
- package/dist/run-utils.d.ts +2 -5
- package/dist/run-utils.js +0 -10
- package/dist/types.d.ts +24 -10
- package/package.json +1 -1
- package/dist/namespaces/assistants.d.ts +0 -96
- package/dist/namespaces/assistants.js +0 -160
- package/dist/namespaces/tasks.d.ts +0 -29
- package/dist/namespaces/tasks.js +0 -49
- package/dist/openapi_client/models/AddMessageRequest.d.ts +0 -6
- package/dist/openapi_client/models/AssistantListResponse.d.ts +0 -6
- package/dist/openapi_client/models/AssistantResponse.d.ts +0 -23
- package/dist/openapi_client/models/AssistantSurfaceListResponse.d.ts +0 -6
- package/dist/openapi_client/models/AssistantSurfaceStatus.js +0 -10
- package/dist/openapi_client/models/AvailableModelInfo.d.ts +0 -8
- package/dist/openapi_client/models/AvailableModels.js +0 -15
- package/dist/openapi_client/models/AvailableModelsListResponse.d.ts +0 -7
- package/dist/openapi_client/models/ConversationMessageListResponse.d.ts +0 -6
- package/dist/openapi_client/models/ConversationMessageResponse.d.ts +0 -19
- package/dist/openapi_client/models/ConversationStatus.d.ts +0 -7
- package/dist/openapi_client/models/ConversationStatus.js +0 -12
- package/dist/openapi_client/models/ConversationType.d.ts +0 -8
- package/dist/openapi_client/models/ConversationType.js +0 -13
- package/dist/openapi_client/models/CreateAssistantRequest.d.ts +0 -18
- package/dist/openapi_client/models/CreateAssistantRequest.js +0 -1
- package/dist/openapi_client/models/CreateMessageRequest.d.ts +0 -6
- package/dist/openapi_client/models/CreateMessageRequest.js +0 -1
- package/dist/openapi_client/models/CreateTaskRequest.d.ts +0 -10
- package/dist/openapi_client/models/CreateTaskRequest.js +0 -1
- package/dist/openapi_client/models/FileVisibility.d.ts +0 -4
- package/dist/openapi_client/models/FileVisibility.js +0 -9
- package/dist/openapi_client/models/TableAccessEntry.js +0 -1
- package/dist/openapi_client/models/TaskListResponse.d.ts +0 -9
- package/dist/openapi_client/models/TaskListResponse.js +0 -1
- package/dist/openapi_client/models/TaskMessageListResponse.d.ts +0 -9
- package/dist/openapi_client/models/TaskMessageListResponse.js +0 -1
- package/dist/openapi_client/models/TaskMessageResponse.js +0 -1
- package/dist/openapi_client/models/TaskResponse.d.ts +0 -16
- package/dist/openapi_client/models/TaskResponse.js +0 -1
- package/dist/openapi_client/models/TaskStatus.d.ts +0 -12
- package/dist/openapi_client/models/TaskStatus.js +0 -17
- package/dist/openapi_client/models/ToolCallRequest.js +0 -1
- package/dist/openapi_client/models/ToolCallResponse.js +0 -1
- package/dist/openapi_client/models/ToolSet.js +0 -19
- package/dist/openapi_client/models/UpdateAssistantRequest.d.ts +0 -17
- package/dist/openapi_client/models/UpdateAssistantRequest.js +0 -1
- package/dist/openapi_client/services/AssistantsService.d.ts +0 -49
- package/dist/openapi_client/services/AssistantsService.js +0 -112
- package/dist/openapi_client/services/ConversationsService.d.ts +0 -88
- package/dist/openapi_client/services/TasksService.d.ts +0 -76
- package/dist/openapi_client/services/TasksService.js +0 -167
- package/dist/react/useAgentRun.d.ts +0 -17
- package/dist/react/useAgentRun.js +0 -56
- package/dist/react/useAgentRuns.d.ts +0 -33
- package/dist/react/useAgentRuns.js +0 -149
- package/dist/react/useAssistantRun.d.ts +0 -27
- package/dist/react/useAssistantRun.js +0 -47
- package/dist/react/useTaskSession.d.ts +0 -35
- package/dist/react/useTaskSession.js +0 -269
- package/dist/task-events.d.ts +0 -8
- package/dist/task-events.js +0 -115
- /package/dist/openapi_client/models/{AddMessageRequest.js → AgentSurfaceListResponse.js} +0 -0
- /package/dist/openapi_client/models/{AssistantListResponse.js → AgentSurfaceResponse.js} +0 -0
- /package/dist/openapi_client/models/{AssistantResponse.js → MessageListResponse.js} +0 -0
- /package/dist/openapi_client/models/{AssistantSurfaceListResponse.js → MessageResponse.js} +0 -0
- /package/dist/openapi_client/models/{AssistantSurfaceResponse.js → SendMessageRequest.js} +0 -0
- /package/dist/openapi_client/models/{AvailableModelInfo.js → ToolCallContent.js} +0 -0
- /package/dist/openapi_client/models/{AvailableModelsListResponse.js → ToolReturnContent.js} +0 -0
- /package/dist/openapi_client/models/{ConversationMessageListResponse.js → app__modules__agent__domain__value_objects__TableAccessEntry.js} +0 -0
- /package/dist/openapi_client/models/{ConversationMessageResponse.js → app__modules__function__api__schemas__function_schemas__TableAccessEntry.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useDeleteFile({ client, podId, path = null, enabled = true, onSuccess, onError, }) {
|
|
3
|
+
export function useDeleteFile({ client, podId, path = null, namespace, enabled = true, onSuccess, onError, }) {
|
|
4
4
|
const [deletedPath, setDeletedPath] = useState(null);
|
|
5
5
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
6
6
|
const [error, setError] = useState(null);
|
|
@@ -21,7 +21,7 @@ export function useDeleteFile({ client, podId, path = null, enabled = true, onSu
|
|
|
21
21
|
setError(null);
|
|
22
22
|
try {
|
|
23
23
|
const scopedClient = resolvePodClient(client, podId);
|
|
24
|
-
await scopedClient.files.delete(nextPath);
|
|
24
|
+
await scopedClient.files.delete(nextPath, { namespace: overrides.namespace ?? namespace });
|
|
25
25
|
setDeletedPath(nextPath);
|
|
26
26
|
onSuccessRef.current?.(nextPath);
|
|
27
27
|
return true;
|
|
@@ -35,7 +35,7 @@ export function useDeleteFile({ client, podId, path = null, enabled = true, onSu
|
|
|
35
35
|
finally {
|
|
36
36
|
setIsSubmitting(false);
|
|
37
37
|
}
|
|
38
|
-
}, [client, isEnabled, podId, trimmedPath]);
|
|
38
|
+
}, [client, isEnabled, namespace, podId, trimmedPath]);
|
|
39
39
|
const reset = useCallback(() => {
|
|
40
40
|
setDeletedPath(null);
|
|
41
41
|
setError(null);
|
package/dist/react/useFile.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import type { FileResponse } from "../types.js";
|
|
2
|
+
import type { DatastoreFileNamespace, FileResponse } from "../types.js";
|
|
3
3
|
export interface UseFileOptions {
|
|
4
4
|
client: LemmaClient;
|
|
5
5
|
podId?: string;
|
|
6
6
|
path?: string | null;
|
|
7
|
+
namespace?: DatastoreFileNamespace | null;
|
|
7
8
|
enabled?: boolean;
|
|
8
9
|
autoLoad?: boolean;
|
|
9
10
|
}
|
|
@@ -13,6 +14,7 @@ export interface UseFileResult {
|
|
|
13
14
|
error: Error | null;
|
|
14
15
|
refresh: (overrides?: {
|
|
15
16
|
path?: string | null;
|
|
17
|
+
namespace?: DatastoreFileNamespace | null;
|
|
16
18
|
}) => Promise<FileResponse | null>;
|
|
17
19
|
}
|
|
18
|
-
export declare function useFile({ client, podId, path, enabled, autoLoad, }: UseFileOptions): UseFileResult;
|
|
20
|
+
export declare function useFile({ client, podId, path, namespace, enabled, autoLoad, }: UseFileOptions): UseFileResult;
|
package/dist/react/useFile.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useFile({ client, podId, path = null, enabled = true, autoLoad = true, }) {
|
|
3
|
+
export function useFile({ client, podId, path = null, namespace, enabled = true, autoLoad = true, }) {
|
|
4
4
|
const [file, setFile] = useState(null);
|
|
5
5
|
const [isLoading, setIsLoading] = useState(false);
|
|
6
6
|
const [error, setError] = useState(null);
|
|
@@ -18,7 +18,7 @@ export function useFile({ client, podId, path = null, enabled = true, autoLoad =
|
|
|
18
18
|
setError(null);
|
|
19
19
|
try {
|
|
20
20
|
const scopedClient = resolvePodClient(client, podId);
|
|
21
|
-
const nextFile = await scopedClient.files.get(nextPath);
|
|
21
|
+
const nextFile = await scopedClient.files.get(nextPath, { namespace: overrides.namespace ?? namespace });
|
|
22
22
|
if (signal?.aborted)
|
|
23
23
|
return null;
|
|
24
24
|
setFile(nextFile);
|
|
@@ -35,7 +35,7 @@ export function useFile({ client, podId, path = null, enabled = true, autoLoad =
|
|
|
35
35
|
if (!signal?.aborted)
|
|
36
36
|
setIsLoading(false);
|
|
37
37
|
}
|
|
38
|
-
}, [client, enabled, podId, trimmedPath]);
|
|
38
|
+
}, [client, enabled, namespace, podId, trimmedPath]);
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
if (!isEnabled) {
|
|
41
41
|
setFile(null);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
+
import type { DatastoreFileNamespace } from "../types.js";
|
|
2
3
|
export type FilePreviewMode = "rendered" | "artifact";
|
|
3
4
|
export interface UseFilePreviewOptions {
|
|
4
5
|
client: LemmaClient;
|
|
@@ -8,6 +9,7 @@ export interface UseFilePreviewOptions {
|
|
|
8
9
|
autoLoad?: boolean;
|
|
9
10
|
mode?: FilePreviewMode;
|
|
10
11
|
artifact?: string;
|
|
12
|
+
namespace?: DatastoreFileNamespace | null;
|
|
11
13
|
}
|
|
12
14
|
export interface UseFilePreviewResult {
|
|
13
15
|
content: string | null;
|
|
@@ -18,6 +20,7 @@ export interface UseFilePreviewResult {
|
|
|
18
20
|
path?: string | null;
|
|
19
21
|
mode?: FilePreviewMode;
|
|
20
22
|
artifact?: string;
|
|
23
|
+
namespace?: DatastoreFileNamespace | null;
|
|
21
24
|
}) => Promise<string | null>;
|
|
22
25
|
}
|
|
23
|
-
export declare function useFilePreview({ client, podId, path, enabled, autoLoad, mode, artifact, }: UseFilePreviewOptions): UseFilePreviewResult;
|
|
26
|
+
export declare function useFilePreview({ client, podId, path, enabled, autoLoad, mode, artifact, namespace, }: UseFilePreviewOptions): UseFilePreviewResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useFilePreview({ client, podId, path = null, enabled = true, autoLoad = true, mode = "rendered", artifact = "document.md", }) {
|
|
3
|
+
export function useFilePreview({ client, podId, path = null, enabled = true, autoLoad = true, mode = "rendered", artifact = "document.md", namespace, }) {
|
|
4
4
|
const [content, setContent] = useState(null);
|
|
5
5
|
const [blob, setBlob] = useState(null);
|
|
6
6
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -22,8 +22,9 @@ export function useFilePreview({ client, podId, path = null, enabled = true, aut
|
|
|
22
22
|
setError(null);
|
|
23
23
|
try {
|
|
24
24
|
const scopedClient = resolvePodClient(client, podId);
|
|
25
|
+
const nextNamespace = overrides.namespace ?? namespace;
|
|
25
26
|
if (nextMode === "artifact") {
|
|
26
|
-
const nextBlob = await scopedClient.files.converted.download(nextPath, nextArtifact);
|
|
27
|
+
const nextBlob = await scopedClient.files.converted.download(nextPath, nextArtifact, { namespace: nextNamespace });
|
|
27
28
|
const text = await nextBlob.text();
|
|
28
29
|
if (signal?.aborted)
|
|
29
30
|
return null;
|
|
@@ -31,7 +32,7 @@ export function useFilePreview({ client, podId, path = null, enabled = true, aut
|
|
|
31
32
|
setContent(text);
|
|
32
33
|
return text;
|
|
33
34
|
}
|
|
34
|
-
const rendered = await scopedClient.files.converted.render(nextPath);
|
|
35
|
+
const rendered = await scopedClient.files.converted.render(nextPath, { namespace: nextNamespace });
|
|
35
36
|
const text = typeof rendered === "string" ? rendered : String(rendered ?? "");
|
|
36
37
|
if (signal?.aborted)
|
|
37
38
|
return null;
|
|
@@ -51,7 +52,7 @@ export function useFilePreview({ client, podId, path = null, enabled = true, aut
|
|
|
51
52
|
if (!signal?.aborted)
|
|
52
53
|
setIsLoading(false);
|
|
53
54
|
}
|
|
54
|
-
}, [artifact, client, enabled, mode, podId, trimmedPath]);
|
|
55
|
+
}, [artifact, client, enabled, mode, namespace, podId, trimmedPath]);
|
|
55
56
|
useEffect(() => {
|
|
56
57
|
if (!isEnabled) {
|
|
57
58
|
setContent(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import type { DirectoryTreeNode, DirectoryTreeResponse } from "../types.js";
|
|
2
|
+
import type { DatastoreFileNamespace, DirectoryTreeNode, DirectoryTreeResponse } from "../types.js";
|
|
3
3
|
export interface UseFileTreeOptions {
|
|
4
4
|
client: LemmaClient;
|
|
5
5
|
podId?: string;
|
|
@@ -7,6 +7,7 @@ export interface UseFileTreeOptions {
|
|
|
7
7
|
autoLoad?: boolean;
|
|
8
8
|
rootPath?: string;
|
|
9
9
|
filesPerDirectory?: number;
|
|
10
|
+
namespace?: DatastoreFileNamespace | null;
|
|
10
11
|
}
|
|
11
12
|
export interface UseFileTreeResult {
|
|
12
13
|
tree: DirectoryTreeNode | null;
|
|
@@ -16,6 +17,7 @@ export interface UseFileTreeResult {
|
|
|
16
17
|
refresh: (overrides?: {
|
|
17
18
|
rootPath?: string;
|
|
18
19
|
filesPerDirectory?: number;
|
|
20
|
+
namespace?: DatastoreFileNamespace | null;
|
|
19
21
|
}) => Promise<DirectoryTreeResponse | null>;
|
|
20
22
|
}
|
|
21
|
-
export declare function useFileTree({ client, podId, enabled, autoLoad, rootPath, filesPerDirectory, }: UseFileTreeOptions): UseFileTreeResult;
|
|
23
|
+
export declare function useFileTree({ client, podId, enabled, autoLoad, rootPath, filesPerDirectory, namespace, }: UseFileTreeOptions): UseFileTreeResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useFileTree({ client, podId, enabled = true, autoLoad = true, rootPath = "/", filesPerDirectory = 3, }) {
|
|
3
|
+
export function useFileTree({ client, podId, enabled = true, autoLoad = true, rootPath = "/", filesPerDirectory = 3, namespace, }) {
|
|
4
4
|
const [response, setResponse] = useState(null);
|
|
5
5
|
const [isLoading, setIsLoading] = useState(false);
|
|
6
6
|
const [error, setError] = useState(null);
|
|
@@ -18,6 +18,7 @@ export function useFileTree({ client, podId, enabled = true, autoLoad = true, ro
|
|
|
18
18
|
const nextResponse = await scopedClient.files.tree({
|
|
19
19
|
rootPath: overrides.rootPath ?? rootPath,
|
|
20
20
|
filesPerDirectory: overrides.filesPerDirectory ?? filesPerDirectory,
|
|
21
|
+
namespace: overrides.namespace ?? namespace,
|
|
21
22
|
});
|
|
22
23
|
if (signal?.aborted)
|
|
23
24
|
return null;
|
|
@@ -35,7 +36,7 @@ export function useFileTree({ client, podId, enabled = true, autoLoad = true, ro
|
|
|
35
36
|
if (!signal?.aborted)
|
|
36
37
|
setIsLoading(false);
|
|
37
38
|
}
|
|
38
|
-
}, [client, enabled, filesPerDirectory, podId, rootPath]);
|
|
39
|
+
}, [client, enabled, filesPerDirectory, namespace, podId, rootPath]);
|
|
39
40
|
useEffect(() => {
|
|
40
41
|
if (!enabled) {
|
|
41
42
|
setResponse(null);
|
package/dist/react/useFiles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import type { FileResponse } from "../types.js";
|
|
2
|
+
import type { DatastoreFileNamespace, FileResponse } from "../types.js";
|
|
3
3
|
export interface UseFilesOptions {
|
|
4
4
|
client: LemmaClient;
|
|
5
5
|
podId?: string;
|
|
@@ -9,6 +9,7 @@ export interface UseFilesOptions {
|
|
|
9
9
|
pageToken?: string;
|
|
10
10
|
directoryPath?: string;
|
|
11
11
|
parentId?: string;
|
|
12
|
+
namespace?: DatastoreFileNamespace | null;
|
|
12
13
|
}
|
|
13
14
|
export interface UseFilesResult {
|
|
14
15
|
files: FileResponse[];
|
|
@@ -21,9 +22,10 @@ export interface UseFilesResult {
|
|
|
21
22
|
pageToken?: string;
|
|
22
23
|
directoryPath?: string;
|
|
23
24
|
parentId?: string;
|
|
25
|
+
namespace?: DatastoreFileNamespace | null;
|
|
24
26
|
}) => Promise<FileResponse[]>;
|
|
25
27
|
loadMore: (overrides?: {
|
|
26
28
|
limit?: number;
|
|
27
29
|
}) => Promise<FileResponse[]>;
|
|
28
30
|
}
|
|
29
|
-
export declare function useFiles({ client, podId, enabled, autoLoad, limit, pageToken, directoryPath, parentId, }: UseFilesOptions): UseFilesResult;
|
|
31
|
+
export declare function useFiles({ client, podId, enabled, autoLoad, limit, pageToken, directoryPath, parentId, namespace, }: UseFilesOptions): UseFilesResult;
|
package/dist/react/useFiles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useFiles({ client, podId, enabled = true, autoLoad = true, limit = 100, pageToken, directoryPath = "/", parentId, }) {
|
|
3
|
+
export function useFiles({ client, podId, enabled = true, autoLoad = true, limit = 100, pageToken, directoryPath = "/", parentId, namespace, }) {
|
|
4
4
|
const [files, setFiles] = useState([]);
|
|
5
5
|
const [nextPageToken, setNextPageToken] = useState(null);
|
|
6
6
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -18,6 +18,7 @@ export function useFiles({ client, podId, enabled = true, autoLoad = true, limit
|
|
|
18
18
|
pageToken: overrides.pageToken ?? pageToken,
|
|
19
19
|
directoryPath: overrides.directoryPath ?? directoryPath,
|
|
20
20
|
parentId: overrides.parentId ?? parentId,
|
|
21
|
+
namespace: overrides.namespace ?? namespace,
|
|
21
22
|
});
|
|
22
23
|
if (signal?.aborted)
|
|
23
24
|
return [];
|
|
@@ -36,7 +37,7 @@ export function useFiles({ client, podId, enabled = true, autoLoad = true, limit
|
|
|
36
37
|
if (!signal?.aborted)
|
|
37
38
|
setIsLoading(false);
|
|
38
39
|
}
|
|
39
|
-
}, [client, directoryPath, enabled, limit, pageToken, parentId, podId]);
|
|
40
|
+
}, [client, directoryPath, enabled, limit, namespace, pageToken, parentId, podId]);
|
|
40
41
|
const loadMore = useCallback(async (overrides = {}) => {
|
|
41
42
|
if (!enabled || !nextPageToken || isLoading || isLoadingMore)
|
|
42
43
|
return [];
|
|
@@ -49,6 +50,7 @@ export function useFiles({ client, podId, enabled = true, autoLoad = true, limit
|
|
|
49
50
|
pageToken: nextPageToken,
|
|
50
51
|
directoryPath,
|
|
51
52
|
parentId,
|
|
53
|
+
namespace,
|
|
52
54
|
});
|
|
53
55
|
const moreFiles = response.items ?? [];
|
|
54
56
|
setFiles((previous) => [...previous, ...moreFiles]);
|
|
@@ -62,7 +64,7 @@ export function useFiles({ client, podId, enabled = true, autoLoad = true, limit
|
|
|
62
64
|
finally {
|
|
63
65
|
setIsLoadingMore(false);
|
|
64
66
|
}
|
|
65
|
-
}, [client, directoryPath, enabled, isLoading, isLoadingMore, limit, nextPageToken, parentId, podId]);
|
|
67
|
+
}, [client, directoryPath, enabled, isLoading, isLoadingMore, limit, namespace, nextPageToken, parentId, podId]);
|
|
66
68
|
useEffect(() => {
|
|
67
69
|
if (!enabled) {
|
|
68
70
|
setFiles([]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import type { FileResponse } from "../types.js";
|
|
2
|
+
import type { DatastoreFileNamespace, FileResponse } from "../types.js";
|
|
3
3
|
export interface UpdateFileInput {
|
|
4
4
|
file?: Blob;
|
|
5
5
|
name?: string;
|
|
@@ -8,11 +8,13 @@ export interface UpdateFileInput {
|
|
|
8
8
|
parentId?: string;
|
|
9
9
|
newPath?: string;
|
|
10
10
|
searchEnabled?: boolean;
|
|
11
|
+
namespace?: DatastoreFileNamespace | null;
|
|
11
12
|
}
|
|
12
13
|
export interface UseUpdateFileOptions {
|
|
13
14
|
client: LemmaClient;
|
|
14
15
|
podId?: string;
|
|
15
16
|
path?: string | null;
|
|
17
|
+
namespace?: DatastoreFileNamespace | null;
|
|
16
18
|
enabled?: boolean;
|
|
17
19
|
onSuccess?: (file: FileResponse) => void;
|
|
18
20
|
onError?: (error: unknown) => void;
|
|
@@ -26,4 +28,4 @@ export interface UseUpdateFileResult<TFile extends FileResponse = FileResponse>
|
|
|
26
28
|
}) => Promise<TFile | null>;
|
|
27
29
|
reset: () => void;
|
|
28
30
|
}
|
|
29
|
-
export declare function useUpdateFile<TFile extends FileResponse = FileResponse>({ client, podId, path, enabled, onSuccess, onError, }: UseUpdateFileOptions): UseUpdateFileResult<TFile>;
|
|
31
|
+
export declare function useUpdateFile<TFile extends FileResponse = FileResponse>({ client, podId, path, namespace, enabled, onSuccess, onError, }: UseUpdateFileOptions): UseUpdateFileResult<TFile>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useUpdateFile({ client, podId, path = null, enabled = true, onSuccess, onError, }) {
|
|
3
|
+
export function useUpdateFile({ client, podId, path = null, namespace, enabled = true, onSuccess, onError, }) {
|
|
4
4
|
const [updatedFile, setUpdatedFile] = useState(null);
|
|
5
5
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
6
6
|
const [error, setError] = useState(null);
|
|
@@ -21,7 +21,10 @@ export function useUpdateFile({ client, podId, path = null, enabled = true, onSu
|
|
|
21
21
|
setError(null);
|
|
22
22
|
try {
|
|
23
23
|
const scopedClient = resolvePodClient(client, podId);
|
|
24
|
-
const nextFile = await scopedClient.files.update(nextPath,
|
|
24
|
+
const nextFile = await scopedClient.files.update(nextPath, {
|
|
25
|
+
...input,
|
|
26
|
+
namespace: input.namespace ?? namespace,
|
|
27
|
+
});
|
|
25
28
|
setUpdatedFile(nextFile);
|
|
26
29
|
onSuccessRef.current?.(nextFile);
|
|
27
30
|
return nextFile;
|
|
@@ -35,7 +38,7 @@ export function useUpdateFile({ client, podId, path = null, enabled = true, onSu
|
|
|
35
38
|
finally {
|
|
36
39
|
setIsSubmitting(false);
|
|
37
40
|
}
|
|
38
|
-
}, [client, isEnabled, podId, trimmedPath]);
|
|
41
|
+
}, [client, isEnabled, namespace, podId, trimmedPath]);
|
|
39
42
|
const reset = useCallback(() => {
|
|
40
43
|
setUpdatedFile(null);
|
|
41
44
|
setError(null);
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { LemmaClient } from "../client.js";
|
|
2
|
-
import type { FileResponse } from "../types.js";
|
|
2
|
+
import type { DatastoreFileNamespace, FileResponse } from "../types.js";
|
|
3
3
|
export interface UploadFileInput {
|
|
4
4
|
name?: string;
|
|
5
5
|
directoryPath?: string;
|
|
6
6
|
parentId?: string;
|
|
7
7
|
searchEnabled?: boolean;
|
|
8
8
|
description?: string;
|
|
9
|
+
namespace?: DatastoreFileNamespace | null;
|
|
9
10
|
}
|
|
10
11
|
export interface UseUploadFileOptions {
|
|
11
12
|
client: LemmaClient;
|
|
12
13
|
podId?: string;
|
|
14
|
+
namespace?: DatastoreFileNamespace | null;
|
|
13
15
|
enabled?: boolean;
|
|
14
16
|
onSuccess?: (file: FileResponse) => void;
|
|
15
17
|
onError?: (error: unknown) => void;
|
|
@@ -21,4 +23,4 @@ export interface UseUploadFileResult<TFile extends FileResponse = FileResponse>
|
|
|
21
23
|
upload: (file: Blob, options?: UploadFileInput) => Promise<TFile | null>;
|
|
22
24
|
reset: () => void;
|
|
23
25
|
}
|
|
24
|
-
export declare function useUploadFile<TFile extends FileResponse = FileResponse>({ client, podId, enabled, onSuccess, onError, }: UseUploadFileOptions): UseUploadFileResult<TFile>;
|
|
26
|
+
export declare function useUploadFile<TFile extends FileResponse = FileResponse>({ client, podId, namespace, enabled, onSuccess, onError, }: UseUploadFileOptions): UseUploadFileResult<TFile>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { normalizeError, resolvePodClient } from "./utils.js";
|
|
3
|
-
export function useUploadFile({ client, podId, enabled = true, onSuccess, onError, }) {
|
|
3
|
+
export function useUploadFile({ client, podId, namespace, enabled = true, onSuccess, onError, }) {
|
|
4
4
|
const [uploadedFile, setUploadedFile] = useState(null);
|
|
5
5
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
6
6
|
const [error, setError] = useState(null);
|
|
@@ -16,7 +16,10 @@ export function useUploadFile({ client, podId, enabled = true, onSuccess, onErro
|
|
|
16
16
|
setError(null);
|
|
17
17
|
try {
|
|
18
18
|
const scopedClient = resolvePodClient(client, podId);
|
|
19
|
-
const nextFile = await scopedClient.files.upload(file,
|
|
19
|
+
const nextFile = await scopedClient.files.upload(file, {
|
|
20
|
+
...options,
|
|
21
|
+
namespace: options.namespace ?? namespace,
|
|
22
|
+
});
|
|
20
23
|
setUploadedFile(nextFile);
|
|
21
24
|
onSuccessRef.current?.(nextFile);
|
|
22
25
|
return nextFile;
|
|
@@ -30,7 +33,7 @@ export function useUploadFile({ client, podId, enabled = true, onSuccess, onErro
|
|
|
30
33
|
finally {
|
|
31
34
|
setIsSubmitting(false);
|
|
32
35
|
}
|
|
33
|
-
}, [client, enabled, podId]);
|
|
36
|
+
}, [client, enabled, namespace, podId]);
|
|
34
37
|
const reset = useCallback(() => {
|
|
35
38
|
setUploadedFile(null);
|
|
36
39
|
setError(null);
|
|
@@ -31,7 +31,7 @@ export function useWorkflowRun({ workflowName, ...options }) {
|
|
|
31
31
|
const normalizedStatus = normalizeRunStatus(session.status);
|
|
32
32
|
const isFinished = isTerminalFlowStatus(normalizedStatus);
|
|
33
33
|
const isWaitingForInput = normalizedStatus === "WAITING"
|
|
34
|
-
|| !!session.run?.
|
|
34
|
+
|| !!session.run?.waiting_agent_conversation_id
|
|
35
35
|
|| !!session.run?.waiting_function_run_id
|
|
36
36
|
|| !!session.run?.waiting_trigger_id;
|
|
37
37
|
const output = session.run?.execution_context ?? null;
|
|
@@ -22,7 +22,7 @@ function isWaitingFlowRun(run) {
|
|
|
22
22
|
const normalizedStatus = normalizeRunStatus(run.status);
|
|
23
23
|
return normalizedStatus === "WAITING"
|
|
24
24
|
|| !!run.waiting_function_run_id
|
|
25
|
-
|| !!run.
|
|
25
|
+
|| !!run.waiting_agent_conversation_id
|
|
26
26
|
|| !!run.waiting_trigger_id;
|
|
27
27
|
}
|
|
28
28
|
export function useWorkflowStart({ client, podId, workflowName, runId = null, enabled = true, autoLoad = true, autoPoll = true, pollIntervalMs = 2000, onRun, onError, }) {
|
package/dist/run-utils.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import type { FlowRunStatus, FunctionRunStatus
|
|
2
|
-
export type AnyRunStatus =
|
|
1
|
+
import type { FlowRunStatus, FunctionRunStatus } from "./openapi_client/index.js";
|
|
2
|
+
export type AnyRunStatus = FunctionRunStatus | FlowRunStatus | (string & {});
|
|
3
3
|
interface BackoffOptions {
|
|
4
4
|
baseMs?: number;
|
|
5
5
|
maxMs?: number;
|
|
6
6
|
factor?: number;
|
|
7
7
|
}
|
|
8
8
|
export declare function normalizeRunStatus(status: unknown): string | undefined;
|
|
9
|
-
export declare function isTerminalTaskStatus(status: unknown, options?: {
|
|
10
|
-
treatWaitingAsTerminal?: boolean;
|
|
11
|
-
}): boolean;
|
|
12
9
|
export declare function isTerminalFunctionStatus(status: unknown): boolean;
|
|
13
10
|
export declare function isTerminalFlowStatus(status: unknown, options?: {
|
|
14
11
|
treatWaitingAsTerminal?: boolean;
|
package/dist/run-utils.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const TASK_TERMINAL = new Set(["COMPLETED", "FAILED", "CANCELLED", "STOPPED"]);
|
|
2
1
|
const FUNCTION_TERMINAL = new Set(["COMPLETED", "FAILED", "CANCELLED"]);
|
|
3
2
|
const FLOW_TERMINAL = new Set(["COMPLETED", "FAILED", "CANCELLED"]);
|
|
4
3
|
export function normalizeRunStatus(status) {
|
|
@@ -8,15 +7,6 @@ export function normalizeRunStatus(status) {
|
|
|
8
7
|
const normalized = status.trim().toUpperCase();
|
|
9
8
|
return normalized.length > 0 ? normalized : undefined;
|
|
10
9
|
}
|
|
11
|
-
export function isTerminalTaskStatus(status, options = {}) {
|
|
12
|
-
const normalized = normalizeRunStatus(status);
|
|
13
|
-
if (!normalized)
|
|
14
|
-
return false;
|
|
15
|
-
if (normalized === "WAITING") {
|
|
16
|
-
return options.treatWaitingAsTerminal === true;
|
|
17
|
-
}
|
|
18
|
-
return TASK_TERMINAL.has(normalized);
|
|
19
|
-
}
|
|
20
10
|
export function isTerminalFunctionStatus(status) {
|
|
21
11
|
const normalized = normalizeRunStatus(status);
|
|
22
12
|
return !!normalized && FUNCTION_TERMINAL.has(normalized);
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentModelName, AgentResponse, ColumnSchema, ConversationResponse as GeneratedConversationResponse, CreateAgentRequest, DatastoreQueryResponse, DirectoryTreeNode, DirectoryTreeResponse, FileResponse, FileNamespace, FileSearchResponse, FileSearchResultSchema, FlowRunEntity, FlowResponse, FunctionRunResponse, IconUploadResponse, OrganizationInvitationResponse, OrganizationMemberResponse, OrganizationResponse, PodConfigResponse, PodJoinRequestCreateResponse, PodMemberResponse, PodResponse, TableResponse, UpdateAgentRequest, UserResponse } from "./openapi_client/index.js";
|
|
2
2
|
/** Public ergonomic types. */
|
|
3
|
+
export interface AvailableModelInfo {
|
|
4
|
+
id: ConversationModel;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export type AvailableModels = AgentModelName;
|
|
3
9
|
export interface PageResult<T> {
|
|
4
10
|
items: T[];
|
|
5
11
|
nextPageToken?: string;
|
|
@@ -29,8 +35,6 @@ export interface RunFunctionOptions {
|
|
|
29
35
|
/** Input payload for the function */
|
|
30
36
|
input?: Record<string, unknown>;
|
|
31
37
|
}
|
|
32
|
-
/** Alias kept for backward compatibility; shape follows generated OpenAPI schema exactly. */
|
|
33
|
-
export type CreateTaskOptions = CreateTaskRequest;
|
|
34
38
|
export interface WorkflowRunInputs {
|
|
35
39
|
[key: string]: unknown;
|
|
36
40
|
}
|
|
@@ -41,14 +45,23 @@ export interface StreamOptions {
|
|
|
41
45
|
export type Agent = AgentResponse;
|
|
42
46
|
export type CreateAgentInput = CreateAgentRequest;
|
|
43
47
|
export type UpdateAgentInput = UpdateAgentRequest;
|
|
44
|
-
export type
|
|
45
|
-
export type
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
export type ConversationModel = `${AgentModelName}` | (string & {});
|
|
49
|
+
export type Conversation = GeneratedConversationResponse & {
|
|
50
|
+
model?: ConversationModel | null;
|
|
51
|
+
status?: string | null;
|
|
52
|
+
};
|
|
53
|
+
export interface ConversationMessageResponse {
|
|
54
|
+
id: string;
|
|
55
|
+
role: string;
|
|
56
|
+
content: unknown;
|
|
57
|
+
created_at: string;
|
|
58
|
+
conversation_id?: string;
|
|
59
|
+
sequence?: number;
|
|
60
|
+
metadata?: Record<string, unknown> | null;
|
|
61
|
+
tool_call_id?: string | null;
|
|
62
|
+
tool_name?: string | null;
|
|
63
|
+
}
|
|
48
64
|
export type ConversationMessage = ConversationMessageResponse;
|
|
49
|
-
export type ConversationModel = `${AvailableModels}` | (string & {});
|
|
50
|
-
export type Task = TaskResponse;
|
|
51
|
-
export type TaskMessage = TaskMessageResponse;
|
|
52
65
|
export type FunctionRun = FunctionRunResponse;
|
|
53
66
|
export type FlowRun = FlowRunEntity;
|
|
54
67
|
export type Workflow = FlowResponse;
|
|
@@ -62,6 +75,7 @@ export type DatastoreFileSearchResponse = FileSearchResponse;
|
|
|
62
75
|
export type DatastoreFileSearchResult = FileSearchResultSchema;
|
|
63
76
|
export type DatastoreDirectoryTree = DirectoryTreeResponse;
|
|
64
77
|
export type DatastoreDirectoryTreeNode = DirectoryTreeNode;
|
|
78
|
+
export type DatastoreFileNamespace = FileNamespace | "PRIVATE" | "PERSONAL" | "POD";
|
|
65
79
|
export type Pod = PodResponse;
|
|
66
80
|
export type PodConfig = PodConfigResponse;
|
|
67
81
|
export type PodMember = PodMemberResponse;
|
package/package.json
CHANGED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { HttpClient } from "../http.js";
|
|
2
|
-
import type { AvailableModelsListResponse } from "../openapi_client/models/AvailableModelsListResponse.js";
|
|
3
|
-
import type { AssistantListResponse } from "../openapi_client/models/AssistantListResponse.js";
|
|
4
|
-
import type { AssistantResponse } from "../openapi_client/models/AssistantResponse.js";
|
|
5
|
-
import type { ConversationListResponse } from "../openapi_client/models/ConversationListResponse.js";
|
|
6
|
-
import type { ConversationMessageListResponse } from "../openapi_client/models/ConversationMessageListResponse.js";
|
|
7
|
-
import type { ConversationResponse } from "../openapi_client/models/ConversationResponse.js";
|
|
8
|
-
import type { CreateAssistantRequest } from "../openapi_client/models/CreateAssistantRequest.js";
|
|
9
|
-
import type { CreateConversationRequest } from "../openapi_client/models/CreateConversationRequest.js";
|
|
10
|
-
import type { CreateMessageRequest } from "../openapi_client/models/CreateMessageRequest.js";
|
|
11
|
-
import type { UpdateAssistantRequest } from "../openapi_client/models/UpdateAssistantRequest.js";
|
|
12
|
-
import type { UpdateConversationRequest } from "../openapi_client/models/UpdateConversationRequest.js";
|
|
13
|
-
export declare class AssistantsNamespace {
|
|
14
|
-
private readonly http;
|
|
15
|
-
private readonly podId;
|
|
16
|
-
constructor(http: HttpClient, podId: () => string);
|
|
17
|
-
list(options?: {
|
|
18
|
-
limit?: number;
|
|
19
|
-
page_token?: string;
|
|
20
|
-
}): Promise<AssistantListResponse>;
|
|
21
|
-
create(payload: CreateAssistantRequest): Promise<AssistantResponse>;
|
|
22
|
-
get(assistantName: string): Promise<AssistantResponse>;
|
|
23
|
-
update(assistantName: string, payload: UpdateAssistantRequest): Promise<AssistantResponse>;
|
|
24
|
-
delete(assistantName: string): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export declare class ConversationsNamespace {
|
|
27
|
-
private readonly http;
|
|
28
|
-
private readonly podId;
|
|
29
|
-
constructor(http: HttpClient, podId: () => string);
|
|
30
|
-
private resolvePodId;
|
|
31
|
-
private requirePodId;
|
|
32
|
-
list(options?: {
|
|
33
|
-
assistant_name?: string;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use assistant_name instead.
|
|
36
|
-
*/
|
|
37
|
-
assistant_id?: string;
|
|
38
|
-
pod_id?: string;
|
|
39
|
-
organization_id?: string;
|
|
40
|
-
global_only?: boolean;
|
|
41
|
-
limit?: number;
|
|
42
|
-
page_token?: string;
|
|
43
|
-
}): Promise<ConversationListResponse>;
|
|
44
|
-
listByAssistant(assistantName: string, options?: {
|
|
45
|
-
pod_id?: string;
|
|
46
|
-
organization_id?: string;
|
|
47
|
-
global_only?: boolean;
|
|
48
|
-
limit?: number;
|
|
49
|
-
page_token?: string;
|
|
50
|
-
}): Promise<ConversationListResponse>;
|
|
51
|
-
listByAssistantName(assistantName: string, options?: {
|
|
52
|
-
pod_id?: string;
|
|
53
|
-
organization_id?: string;
|
|
54
|
-
global_only?: boolean;
|
|
55
|
-
limit?: number;
|
|
56
|
-
page_token?: string;
|
|
57
|
-
}): Promise<ConversationListResponse>;
|
|
58
|
-
listModels(): Promise<AvailableModelsListResponse>;
|
|
59
|
-
create(payload: CreateConversationRequest & {
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Use assistant_name instead.
|
|
62
|
-
*/
|
|
63
|
-
assistant_id?: string | null;
|
|
64
|
-
}): Promise<ConversationResponse>;
|
|
65
|
-
createForAssistant(assistantName: string, payload?: Omit<CreateConversationRequest, "assistant_name">): Promise<ConversationResponse>;
|
|
66
|
-
get(conversationId: string, options?: {
|
|
67
|
-
pod_id?: string;
|
|
68
|
-
}): Promise<ConversationResponse>;
|
|
69
|
-
update(conversationId: string, payload: UpdateConversationRequest, options?: {
|
|
70
|
-
pod_id?: string;
|
|
71
|
-
}): Promise<ConversationResponse>;
|
|
72
|
-
delete(conversationId: string, options?: {
|
|
73
|
-
pod_id?: string;
|
|
74
|
-
}): Promise<unknown>;
|
|
75
|
-
sendMessageStream(conversationId: string, payload: CreateMessageRequest, options?: {
|
|
76
|
-
pod_id?: string;
|
|
77
|
-
signal?: AbortSignal;
|
|
78
|
-
}): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
79
|
-
resumeStream(conversationId: string, options?: {
|
|
80
|
-
pod_id?: string;
|
|
81
|
-
signal?: AbortSignal;
|
|
82
|
-
}): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
83
|
-
stopRun(conversationId: string, options?: {
|
|
84
|
-
pod_id?: string;
|
|
85
|
-
}): Promise<unknown>;
|
|
86
|
-
readonly messages: {
|
|
87
|
-
list: (conversationId: string, options?: {
|
|
88
|
-
limit?: number;
|
|
89
|
-
page_token?: string;
|
|
90
|
-
pod_id?: string;
|
|
91
|
-
}) => Promise<ConversationMessageListResponse>;
|
|
92
|
-
send: (conversationId: string, payload: CreateMessageRequest, options?: {
|
|
93
|
-
pod_id?: string;
|
|
94
|
-
}) => Promise<unknown>;
|
|
95
|
-
};
|
|
96
|
-
}
|