Add dynamic variable support to Assistant model and related components
- Introduce dynamic variable definitions in AssistantConfig and Assistant models, allowing for flexible prompt customization. - Implement validation for dynamic variable names and types in the schema. - Update backend services and routes to handle dynamic variables in assistant configurations and runtime processing. - Enhance frontend components to support dynamic variable definitions, including a new editor for managing variables. - Add tests to ensure proper functionality and validation of dynamic variables in various scenarios.
This commit is contained in:
@@ -183,6 +183,7 @@ export type Assistant = {
|
||||
knowledgeRetrievalConfig: KnowledgeRetrievalConfig;
|
||||
toolIds: string[];
|
||||
prompt: string;
|
||||
dynamicVariableDefinitions: Record<string, DynamicVariableDefinition>;
|
||||
apiUrl: string;
|
||||
apiKey: string;
|
||||
appId: string;
|
||||
@@ -190,6 +191,12 @@ export type Assistant = {
|
||||
updatedAt?: string | null;
|
||||
};
|
||||
|
||||
export type DynamicVariableDefinition = {
|
||||
type: "string" | "number" | "boolean";
|
||||
required: boolean;
|
||||
default: string | number | boolean | null;
|
||||
};
|
||||
|
||||
export type KnowledgeRetrievalConfig = {
|
||||
mode: "automatic" | "on_demand";
|
||||
topN: number;
|
||||
@@ -307,6 +314,7 @@ export type HttpToolDefinition = {
|
||||
headers: Record<string, string>;
|
||||
parameters: ToolParameter[];
|
||||
body: Record<string, unknown>;
|
||||
dynamicVariableAssignments: Record<string, string>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user