Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Fixes bug in which displayed state was incorrect

elijahbenizzy8f15db5c3588
diff --git a/burr/cli/demo_data.py b/burr/cli/demo_data.py
index 6ee5e1ed..fcd7d7fd 100644
--- a/burr/cli/demo_data.py
+++ b/burr/cli/demo_data.py
@@ -55,7 +55,7 @@ def generate_chatbot_data(data_dir: str, use_traces: bool):
"What is the meaning of life?", # answered by the question mode (ish)
],
"chat-5-jokes": [
- "Please draw a picture of a good joke joke", # answered by the image mode
+ "Please draw a picture of a good joke", # answered by the image mode
"Please write code for an interactive knock-knock joke", # answered by the code mode
"What is a good joke?", # answered by the question mode
"The chicken crossed the road because it was a free-range chicken", # answered by nothing
diff --git a/telemetry/ui/src/components/routes/app/AppView.tsx b/telemetry/ui/src/components/routes/app/AppView.tsx
index fabf90cb..7702993a 100644
--- a/telemetry/ui/src/components/routes/app/AppView.tsx
+++ b/telemetry/ui/src/components/routes/app/AppView.tsx
@@ -197,7 +197,7 @@ export const AppView = () => {
stateMachine={data.application}
highlightedActions={previousActions}
hoverAction={hoverIndex ? stepsSorted[hoverIndex] : undefined}
- currentActionIndex={currentActionIndex}
+ currentSequenceID={currentActionIndex}
/>
}
/>
diff --git a/telemetry/ui/src/components/routes/app/StateMachine.tsx b/telemetry/ui/src/components/routes/app/StateMachine.tsx
index 94460899..83c6d08a 100644
--- a/telemetry/ui/src/components/routes/app/StateMachine.tsx
+++ b/telemetry/ui/src/components/routes/app/StateMachine.tsx
@@ -10,13 +10,15 @@ export const AppStateView = (props: {
stateMachine: ApplicationModel;
highlightedActions: Step[] | undefined;
hoverAction: Step | undefined;
- currentActionIndex: number | undefined;
+ currentSequenceID: number | undefined;
}) => {
const [currentTab, setCurrentTab] = useState('graph');
- const currentStep =
- props.currentActionIndex !== undefined ? props.steps[props.currentActionIndex] : undefined;
- const priorStep =
- props.currentActionIndex !== undefined ? props.steps[props.currentActionIndex + 1] : undefined;
+ const currentStep = props.steps.find(
+ (step) => step.step_start_log.sequence_id === props.currentSequenceID
+ );
+ const priorStep = props.steps.find(
+ (step) => step.step_start_log.sequence_id === (props.currentSequenceID || 0) - 1
+ );
const actionModel = props.stateMachine.actions.find(
(action) => action.name === currentStep?.step_start_log.action
@@ -34,8 +36,8 @@ export const AppStateView = (props: {
<GraphView
stateMachine={props.stateMachine}
currentAction={
- props.currentActionIndex !== undefined
- ? props.steps[props.currentActionIndex]
+ props.currentSequenceID !== undefined
+ ? props.steps[props.currentSequenceID]
: undefined
}
highlightedActions={props.highlightedActions}