|
13 | 13 | UiPathStreamOptions, |
14 | 14 | ) |
15 | 15 | from uipath.runtime.debug import UiPathBreakpointResult |
16 | | -from uipath.runtime.schema import UiPathRuntimeSchema |
| 16 | +from uipath.runtime.schema import ( |
| 17 | + UiPathRuntimeEdge, |
| 18 | + UiPathRuntimeGraph, |
| 19 | + UiPathRuntimeNode, |
| 20 | + UiPathRuntimeSchema, |
| 21 | +) |
17 | 22 |
|
18 | 23 | ENTRYPOINT_TELEMETRY = "agent/telemetry.py:run" |
19 | 24 |
|
@@ -58,6 +63,113 @@ async def get_schema(self) -> UiPathRuntimeSchema: |
58 | 63 | "properties": {"result": {"type": "string"}}, |
59 | 64 | "required": ["result"], |
60 | 65 | }, |
| 66 | + graph=UiPathRuntimeGraph( |
| 67 | + nodes=[ |
| 68 | + UiPathRuntimeNode(id="__start__", name="__start__", type="node"), |
| 69 | + UiPathRuntimeNode(id="input", name="input", type="node"), |
| 70 | + UiPathRuntimeNode( |
| 71 | + id="supervisor", |
| 72 | + name="supervisor", |
| 73 | + type="model", |
| 74 | + metadata={ |
| 75 | + "model_name": "claude-3-7-sonnet-latest", |
| 76 | + "max_tokens": 64000, |
| 77 | + }, |
| 78 | + ), |
| 79 | + UiPathRuntimeNode( |
| 80 | + id="researcher", |
| 81 | + name="researcher", |
| 82 | + type="node", |
| 83 | + subgraph=UiPathRuntimeGraph( |
| 84 | + nodes=[ |
| 85 | + UiPathRuntimeNode( |
| 86 | + id="__start__", name="__start__", type="node" |
| 87 | + ), |
| 88 | + UiPathRuntimeNode( |
| 89 | + id="model", |
| 90 | + name="model", |
| 91 | + type="model", |
| 92 | + metadata={ |
| 93 | + "model_name": "claude-3-7-sonnet-latest", |
| 94 | + "max_tokens": 64000, |
| 95 | + }, |
| 96 | + ), |
| 97 | + UiPathRuntimeNode( |
| 98 | + id="tools", |
| 99 | + name="tools", |
| 100 | + type="tool", |
| 101 | + metadata={ |
| 102 | + "tool_names": ["tavily_search"], |
| 103 | + "tool_count": 1, |
| 104 | + }, |
| 105 | + ), |
| 106 | + UiPathRuntimeNode( |
| 107 | + id="__end__", name="__end__", type="node" |
| 108 | + ), |
| 109 | + ], |
| 110 | + edges=[ |
| 111 | + UiPathRuntimeEdge(source="__start__", target="model"), |
| 112 | + UiPathRuntimeEdge(source="model", target="__end__"), |
| 113 | + UiPathRuntimeEdge(source="model", target="tools"), |
| 114 | + UiPathRuntimeEdge(source="tools", target="model"), |
| 115 | + ], |
| 116 | + ), |
| 117 | + ), |
| 118 | + UiPathRuntimeNode( |
| 119 | + id="coder", |
| 120 | + name="coder", |
| 121 | + type="node", |
| 122 | + subgraph=UiPathRuntimeGraph( |
| 123 | + nodes=[ |
| 124 | + UiPathRuntimeNode( |
| 125 | + id="__start__", name="__start__", type="node" |
| 126 | + ), |
| 127 | + UiPathRuntimeNode( |
| 128 | + id="model", |
| 129 | + name="model", |
| 130 | + type="model", |
| 131 | + metadata={ |
| 132 | + "model_name": "claude-3-7-sonnet-latest", |
| 133 | + "max_tokens": 64000, |
| 134 | + }, |
| 135 | + ), |
| 136 | + UiPathRuntimeNode( |
| 137 | + id="tools", |
| 138 | + name="tools", |
| 139 | + type="tool", |
| 140 | + metadata={ |
| 141 | + "tool_names": ["python_repl_tool"], |
| 142 | + "tool_count": 1, |
| 143 | + }, |
| 144 | + ), |
| 145 | + UiPathRuntimeNode( |
| 146 | + id="__end__", name="__end__", type="node" |
| 147 | + ), |
| 148 | + ], |
| 149 | + edges=[ |
| 150 | + UiPathRuntimeEdge(source="__start__", target="model"), |
| 151 | + UiPathRuntimeEdge(source="model", target="__end__"), |
| 152 | + UiPathRuntimeEdge(source="model", target="tools"), |
| 153 | + UiPathRuntimeEdge(source="tools", target="model"), |
| 154 | + ], |
| 155 | + ), |
| 156 | + ), |
| 157 | + UiPathRuntimeNode(id="output", name="output", type="node"), |
| 158 | + UiPathRuntimeNode(id="__end__", name="__end__", type="__end__"), |
| 159 | + ], |
| 160 | + edges=[ |
| 161 | + UiPathRuntimeEdge(source="__start__", target="input"), |
| 162 | + UiPathRuntimeEdge(source="coder", target="supervisor"), |
| 163 | + UiPathRuntimeEdge(source="input", target="supervisor"), |
| 164 | + UiPathRuntimeEdge(source="researcher", target="supervisor"), |
| 165 | + UiPathRuntimeEdge(source="supervisor", target="coder"), |
| 166 | + UiPathRuntimeEdge( |
| 167 | + source="supervisor", target="output", label="__end__" |
| 168 | + ), |
| 169 | + UiPathRuntimeEdge(source="supervisor", target="researcher"), |
| 170 | + UiPathRuntimeEdge(source="output", target="__end__"), |
| 171 | + ], |
| 172 | + ), |
61 | 173 | ) |
62 | 174 |
|
63 | 175 | async def execute( |
|
0 commit comments