Skip to content

Commit 63f65bd

Browse files
fix: remove debug logs
1 parent e8e6905 commit 63f65bd

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
flowchart TB
22
__start__(__start__)
3-
chat(chat)
3+
aggregate_tool_results(aggregate_tool_results)
4+
call_tool(call_tool)
5+
init_run(init_run)
6+
parse_agent_output(parse_agent_output)
7+
run_agent_step(run_agent_step)
8+
setup_agent(setup_agent)
49
__end__(__end__)
5-
__start__ --> |ChatInput|chat
6-
chat --> |StopEvent|__end__
10+
aggregate_tool_results --> |AgentInput|setup_agent
11+
aggregate_tool_results --> |StopEvent|__end__
12+
call_tool --> |ToolCallResult|aggregate_tool_results
13+
__start__ --> |AgentWorkflowStartEvent|init_run
14+
init_run --> |AgentInput|setup_agent
15+
parse_agent_output --> |StopEvent|__end__
16+
parse_agent_output --> |AgentInput|setup_agent
17+
parse_agent_output --> |ToolCall|call_tool
18+
run_agent_step --> |AgentOutput|parse_agent_output
19+
setup_agent --> |AgentSetup|run_agent_step

packages/uipath-llamaindex/samples/chat-agent/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
from llama_index.core.agent.workflow import FunctionAgent
3+
from llama_index.core.agent.workflow import FunctionAgent, AgentWorkflow
44
from llama_index.llms.openai import OpenAI
55
from llama_index.tools.tavily_research import TavilyToolSpec
66

@@ -24,8 +24,8 @@
2424
"Remember previous messages and maintain context across the discussion."
2525
)
2626

27-
agent = FunctionAgent(
28-
tools=tavily_tool.to_tool_list(),
27+
agent = AgentWorkflow.from_tools_or_functions(
28+
tools_or_functions=tavily_tool.to_tool_list(),
2929
llm=llm,
3030
system_prompt=SYSTEM_PROMPT
3131
)

packages/uipath-llamaindex/samples/chat-agent/uipath.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://cloud.uipath.com/draft/2024-12/uipath",
33
"runtimeOptions": {
4-
"isConversational": false
4+
"isConversational": true
55
},
66
"packOptions": {
77
"fileExtensionsIncluded": [],

packages/uipath-llamaindex/src/uipath_llamaindex/runtime/runtime.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,8 @@ async def _run_workflow(
171171
suspended_event: InputRequiredEvent | None = None
172172
chat = UiPathChatMessagesMapper(runtime_id=self.runtime_id)
173173

174-
raw_chunks: list[dict] = []
175-
mapped_chunks: list[dict] = []
176174
is_resumed: bool = False
177175
async for event in event_stream:
178-
if not isinstance(event, BreakpointEvent):
179-
raw_chunks.append(
180-
{"type": type(event).__name__, "data": json.loads(serialize_json(event))}
181-
)
182176
node_name = self._get_node_name(event)
183177
if isinstance(event, (AgentOutput, AgentStream, ToolCall, ToolCallResult)):
184178
try:
@@ -188,7 +182,6 @@ async def _run_workflow(
188182
mapped_events = None
189183
if mapped_events:
190184
for mapped_event in mapped_events:
191-
mapped_chunks.append(mapped_event.model_dump(by_alias=True, exclude_none=True))
192185
if stream_events:
193186
yield UiPathRuntimeMessageEvent(payload=mapped_event)
194187
elif stream_events and not isinstance(event, BreakpointEvent):
@@ -223,12 +216,6 @@ async def _run_workflow(
223216
suspended_event = event
224217
break
225218

226-
for filename, data in [("raw_chunks.json", raw_chunks), ("mapped_chunks.json", mapped_chunks)]:
227-
output_path = os.path.abspath(filename)
228-
with open(output_path, "w") as f:
229-
json.dump(data, f, indent=2)
230-
print(f"{filename} written to: {output_path}")
231-
232219
if suspended_event is not None:
233220
await asyncio.sleep(0) # Yield control to event loop
234221
await self._save_context()

0 commit comments

Comments
 (0)