Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async def connect(self, output_interface: GreetingConversationInput) -> None:
response = self.greeting_state_provider.process_conversation(llm_output)
logging.info(f"Greeting Conversation Response: {response}")

if response.get("current_state") == ConversationState.FINISHED:
if response.get("current_state") == ConversationState.FINISHED.value:
logging.info("Greeting conversation has finished.")
self.context_provider.update_context(
{"greeting_conversation_finished": True}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async def connect(self, output_interface: GreetingConversationInput) -> None:
response = self.greeting_state_provider.process_conversation(llm_output)
logging.info(f"Greeting Conversation Response: {response}")

if response.get("current_state") == ConversationState.FINISHED:
if response.get("current_state") == ConversationState.FINISHED.value:
logging.info("Greeting conversation has finished.")
self.context_provider.update_context(
{"greeting_conversation_finished": True}
Expand Down
5 changes: 4 additions & 1 deletion src/providers/greeting_conversation_state_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ def _determine_next_state(
llm_conversation_state = confidence_result["factors"].conversation_state
time_in_state = time.time() - self.state_entry_time

# From ENGAGING to CONVERSING
if self.current_state == ConversationState.ENGAGING:
return ConversationState.CONVERSING

# From CONVERSING to CONCLUDING
if self.current_state == ConversationState.CONVERSING:
# LLM thinks we should conclude with high confidence
Expand Down Expand Up @@ -582,4 +586,3 @@ def reset_state(
self.turn_count = 0
self.last_user_utterance = ""
self.confidence_history = []
self.current_state = ConversationState.CONVERSING
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def test_connect_finished_updates_context(self, connector, mock_providers)
speech_clarity=0.9,
)
mock_providers["state"].process_conversation.return_value = {
"current_state": ConversationState.FINISHED
"current_state": ConversationState.FINISHED.value
}
await connector.connect(finished_input)
mock_providers["ctx"].update_context.assert_called_once_with(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async def test_connect_finished_updates_context(self, connector, mock_providers)
speech_clarity=0.9,
)
mock_providers["state"].process_conversation.return_value = {
"current_state": ConversationState.FINISHED
"current_state": ConversationState.FINISHED.value
}
await connector.connect(finished_input)
mock_providers["ctx"].update_context.assert_called_once_with(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def test_reset_state(self, state_machine):

state_machine.reset_state(ConversationState.IDLE)

assert state_machine.current_state == ConversationState.CONVERSING
assert state_machine.current_state == ConversationState.IDLE
assert state_machine.turn_count == 0
assert state_machine.last_user_utterance == ""
assert state_machine.confidence_history == []
Expand Down
Loading