mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-19 00:40:59 +00:00
feat(agent-platform): add bot route dry-run
This commit is contained in:
@@ -246,6 +246,34 @@ export interface EventBinding {
|
||||
order?: number;
|
||||
}
|
||||
|
||||
export interface BotRouteDryRunRequest {
|
||||
event_type: string;
|
||||
payload?: Record<string, unknown>;
|
||||
event_bindings?: EventBinding[];
|
||||
}
|
||||
|
||||
export interface BotRouteDryRunTarget {
|
||||
target_type: EventBinding['target_type'];
|
||||
target_uuid?: string | null;
|
||||
target_name?: string | null;
|
||||
kind?: AgentKind | 'discard' | null;
|
||||
}
|
||||
|
||||
export interface BotRouteDryRunResult {
|
||||
matched: boolean;
|
||||
target?: BotRouteDryRunTarget | null;
|
||||
binding_id?: string | null;
|
||||
event_pattern?: string | null;
|
||||
target_type?: EventBinding['target_type'] | null;
|
||||
target_uuid?: string | null;
|
||||
reason?: string | null;
|
||||
failure_code?: string | null;
|
||||
diagnostic_steps: string[];
|
||||
diagnostic_details?: Array<Record<string, unknown>>;
|
||||
matched_binding_id?: string | null;
|
||||
matched_binding_index?: number | null;
|
||||
}
|
||||
|
||||
export interface ApiRespKnowledgeBases {
|
||||
bases: KnowledgeBase[];
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ import {
|
||||
Skill,
|
||||
ApiRespSkills,
|
||||
ApiRespSkill,
|
||||
BotRouteDryRunRequest,
|
||||
BotRouteDryRunResult,
|
||||
} from '@/app/infra/entities/api';
|
||||
import { Plugin } from '@/app/infra/entities/plugin';
|
||||
import type { PluginLogEntry } from '@/app/infra/entities/plugin';
|
||||
@@ -454,6 +456,16 @@ export class BackendClient extends BaseHttpClient {
|
||||
return this.put(`/api/v1/platform/bots/${uuid}`, bot);
|
||||
}
|
||||
|
||||
public dryRunBotEventRoute(
|
||||
botId: string,
|
||||
request: BotRouteDryRunRequest,
|
||||
): Promise<BotRouteDryRunResult> {
|
||||
return this.post(
|
||||
`/api/v1/platform/bots/${botId}/event-routes/dry-run`,
|
||||
request,
|
||||
);
|
||||
}
|
||||
|
||||
public deleteBot(uuid: string): Promise<object> {
|
||||
return this.delete(`/api/v1/platform/bots/${uuid}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user