Skip to content

Commit

Permalink
Break up and organize graph object files. Fix floating node group issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
blindmansion committed Aug 18, 2024
1 parent 0464011 commit 52208cb
Show file tree
Hide file tree
Showing 31 changed files with 4,900 additions and 4,877 deletions.
2 changes: 1 addition & 1 deletion packages/cannoli-core/src/bake.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { run } from "./cannoli";
import { FileManager } from "./fileManager";
import { VerifiedCannoliCanvasData } from "./models/graph";
import { VerifiedCannoliCanvasData } from "./graph";
import { LLMConfig } from "./providers";
import { Action, HttpTemplate } from "./run";

Expand Down
8 changes: 6 additions & 2 deletions packages/cannoli-core/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
VerifiedCannoliCanvasGroupData,
AllVerifiedCannoliCanvasNodeData,
VerifiedCannoliCanvasEdgeData,
} from "./models/graph";
} from "./graph";

export enum IndicatedNodeType {
Call = "call",
Expand Down Expand Up @@ -293,7 +293,7 @@ export class CannoliFactory {
node.type === "text" || node.type === "file"
? this.parseNodeReferences(node)
: [];
const groups = this.getGroupsForVertex(node);
let groups = this.getGroupsForVertex(node);
const dependencies = [] as string[];
const originalObject = null;
const status =
Expand All @@ -305,6 +305,10 @@ export class CannoliFactory {
return null;
}

if (type === FloatingNodeType.Variable) {
groups = [];
}

return {
kind,
type,
Expand Down
2 changes: 1 addition & 1 deletion packages/cannoli-core/src/fileManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reference } from "./models/graph";
import { Reference } from "./graph";

export interface FileManager {
editNote(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,28 @@ import {
CanvasGroupData,
CanvasLinkData,
CanvasTextData,
} from "../persistor";

import { CannoliObject } from "./object";
import { CannoliGroup, RepeatGroup } from "./group";
import {
CallNode,
CannoliNode,
ChooseNode,
ContentNode,
FormNode,
FloatingNode,
FormatterNode,
HttpNode,
ReferenceNode,
SearchNode,
} from "./node";
import {
CannoliEdge,
ChatConverterEdge,
ChatResponseEdge,
LoggingEdge,
SystemMessageEdge,
} from "./edge";
import { GenericCompletionResponse } from "../providers";
import { ReceiveInfo } from "../run";
} from "./persistor";

import { GenericCompletionResponse } from "./providers";
import { ReceiveInfo } from "./run";
import { CannoliObject } from "./graph/CannoliObject";
import { CannoliEdge } from "./graph/objects/CannoliEdge";
import { ChatConverterEdge } from "./graph/objects/edges/ChatConverterEdge";
import { ChatResponseEdge } from "./graph/objects/edges/ChatResponseEdge";
import { LoggingEdge } from "./graph/objects/edges/LoggingEdge";
import { SystemMessageEdge } from "./graph/objects/edges/SystemMessageEdge";
import { CannoliGroup } from "./graph/objects/vertices/CannoliGroup";
import { CannoliNode } from "./graph/objects/vertices/CannoliNode";
import { RepeatGroup } from "./graph/objects/vertices/groups/RepeatGroup";
import { ChooseNode } from "./graph/objects/vertices/nodes/call/ChooseNode";
import { FormNode } from "./graph/objects/vertices/nodes/call/FormNode";
import { CallNode } from "./graph/objects/vertices/nodes/CallNode";
import { FormatterNode } from "./graph/objects/vertices/nodes/content/FormatterNode";
import { HttpNode } from "./graph/objects/vertices/nodes/content/HttpNode";
import { ReferenceNode } from "./graph/objects/vertices/nodes/content/ReferenceNode";
import { SearchNode } from "./graph/objects/vertices/nodes/content/SearchNode";
import { ContentNode } from "./graph/objects/vertices/nodes/ContentNode";
import { FloatingNode } from "./graph/objects/FloatingNode";

export enum CannoliObjectKind {
Node = "node",
Expand Down
Loading

0 comments on commit 52208cb

Please sign in to comment.