ts
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import type {
|
import type {
|
||||||
AvailableGraphsResponse,
|
AvailableGraphsResponse,
|
||||||
|
ConversationListItem,
|
||||||
|
ConversationMessageItem,
|
||||||
GraphConfigListResponse,
|
GraphConfigListResponse,
|
||||||
GraphConfigReadResponse,
|
GraphConfigReadResponse,
|
||||||
GraphConfigUpsertRequest,
|
GraphConfigUpsertRequest,
|
||||||
@@ -10,6 +12,8 @@ import type {
|
|||||||
McpToolConfigUpdateResponse,
|
McpToolConfigUpdateResponse,
|
||||||
PipelineCreateRequest,
|
PipelineCreateRequest,
|
||||||
PipelineCreateResponse,
|
PipelineCreateResponse,
|
||||||
|
PipelineConversationListResponse,
|
||||||
|
PipelineConversationMessagesResponse,
|
||||||
PipelineListResponse,
|
PipelineListResponse,
|
||||||
PipelineStopResponse,
|
PipelineStopResponse,
|
||||||
} from "../types";
|
} from "../types";
|
||||||
@@ -138,3 +142,23 @@ export function stopPipeline(pipelineId: string): Promise<PipelineStopResponse>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function listPipelineConversations(
|
||||||
|
pipelineId: string,
|
||||||
|
limit = 100
|
||||||
|
): Promise<ConversationListItem[]> {
|
||||||
|
const response = await fetchJson<PipelineConversationListResponse>(
|
||||||
|
`/v1/pipelines/${encodeURIComponent(pipelineId)}/conversations?limit=${limit}`
|
||||||
|
);
|
||||||
|
return response.items || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getPipelineConversationMessages(
|
||||||
|
pipelineId: string,
|
||||||
|
conversationId: string
|
||||||
|
): Promise<ConversationMessageItem[]> {
|
||||||
|
const response = await fetchJson<PipelineConversationMessagesResponse>(
|
||||||
|
`/v1/pipelines/${encodeURIComponent(pipelineId)}/conversations/${encodeURIComponent(conversationId)}/messages`
|
||||||
|
);
|
||||||
|
return response.items || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,33 @@ export type PipelineStopResponse = {
|
|||||||
reload_required: boolean;
|
reload_required: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ConversationListItem = {
|
||||||
|
conversation_id: string;
|
||||||
|
pipeline_id: string;
|
||||||
|
message_count: number;
|
||||||
|
last_updated?: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PipelineConversationListResponse = {
|
||||||
|
pipeline_id: string;
|
||||||
|
items: ConversationListItem[];
|
||||||
|
count: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ConversationMessageItem = {
|
||||||
|
message_type: string;
|
||||||
|
content: string;
|
||||||
|
sequence_number: number;
|
||||||
|
created_at: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PipelineConversationMessagesResponse = {
|
||||||
|
pipeline_id: string;
|
||||||
|
conversation_id: string;
|
||||||
|
items: ConversationMessageItem[];
|
||||||
|
count: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type McpToolConfigResponse = {
|
export type McpToolConfigResponse = {
|
||||||
path: string;
|
path: string;
|
||||||
raw_content: string;
|
raw_content: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user