Rename LLM service to Intent service and refactor relevant code
Refactored the `DummyLlmService` to `DummyIntentService` across the codebase for clarity and consistency. Updated variable names, method calls, and documentation to align with this change. This improves code readability and better reflects the service's purpose.
This commit is contained in:
17
lib.d.ts
vendored
17
lib.d.ts
vendored
@@ -2,25 +2,20 @@ export interface QueryResult {
|
||||
confidence: number;
|
||||
action: string;
|
||||
}
|
||||
|
||||
export interface LLMService {
|
||||
export interface IntentService {
|
||||
query(prompt: string): Promise<QueryResult>;
|
||||
}
|
||||
|
||||
export interface State {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export class DummyLlmService implements LLMService {
|
||||
export class DummyIntentService implements IntentService {
|
||||
query(prompt: string): Promise<QueryResult>;
|
||||
}
|
||||
|
||||
export class WorkflowOperator {
|
||||
constructor(name: string, operation: (state: State) => Promise<State>);
|
||||
name: string;
|
||||
execute(state: State): Promise<State>;
|
||||
}
|
||||
|
||||
export class ManifoldRegion {
|
||||
constructor(name: string, operators?: WorkflowOperator[]);
|
||||
name: string;
|
||||
@@ -30,21 +25,19 @@ export class ManifoldRegion {
|
||||
connectTo(region: ManifoldRegion): void;
|
||||
getValidOperators(state: State): Promise<WorkflowOperator[]>;
|
||||
}
|
||||
|
||||
export class NestedManifoldRegion extends ManifoldRegion {
|
||||
constructor(name: string, nestedManifold: WorkflowFunctionManifold);
|
||||
nestedManifold: WorkflowFunctionManifold;
|
||||
navigate(prompt: string): Promise<boolean>;
|
||||
executeWorkflow(prompt: string): Promise<boolean>;
|
||||
}
|
||||
|
||||
export class WorkflowFunctionManifold {
|
||||
constructor(llmService: LLMService);
|
||||
llmService: LLMService;
|
||||
constructor(intentService: IntentService);
|
||||
intentService: IntentService;
|
||||
regions: Map<string, ManifoldRegion | NestedManifoldRegion>;
|
||||
currentRegion: ManifoldRegion | NestedManifoldRegion | null;
|
||||
state: State;
|
||||
addRegion(region: ManifoldRegion | NestedManifoldRegion): void;
|
||||
navigate(prompt: string): Promise<boolean>;
|
||||
executeWorkflow(prompt: string): Promise<boolean>;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user