Skip to content

Conversation

@ErikLagerSB
Copy link
Contributor

Fix outcome detection after converter change.
Remove dependency.

What does this PR do?

Adjust the outcome detection to new converter handling.

Changes

Related Issues

Fixes #<issue_number>

@ErikLagerSB ErikLagerSB requested a review from Copilot July 23, 2025 11:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes outcome detection functionality after changes to the converter handling and removes a dependency on session names. The changes update method calls to use the new converter API and adjust function signatures to support improved outcome detection.

  • Updates converter method call from structure to loads for message parsing
  • Adds instance parameter to outcome detection functions for better duplicate filtering
  • Removes session name dependency from callback initialization

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
agentune_simulate/tests/simulate/rag/test_indexing_retrieval.py Adds required instance parameter to test function call
agentune_simulate/streamlit/pages/Agentune_Simulate_Runner.py Removes session_name parameter from callback initialization
agentune_simulate/agentune/simulate/rag/indexing_and_retrieval.py Adds instance parameter and duplicate filtering logic
agentune_simulate/agentune/simulate/outcome_detection/rag/rag.py Updates function call to pass instance parameter
agentune_simulate/agentune/simulate/outcome_detection/rag/prompt.py Updates converter method call from structure to loads

conversation=query_conversation,
k=k
k=k,
instance=OutcomeDetectionTest(query_conversation, intent=Intent(role=ParticipantRole.CUSTOMER, description="No description")) # No specific intent for this test,
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment has a trailing comma and inconsistent spacing. It should end with a period instead of a comma.

Suggested change
instance=OutcomeDetectionTest(query_conversation, intent=Intent(role=ParticipantRole.CUSTOMER, description="No description")) # No specific intent for this test,
instance=OutcomeDetectionTest(query_conversation, intent=Intent(role=ParticipantRole.CUSTOMER, description="No description")) # No specific intent for this test.

Copilot uses AI. Check for mistakes.
# If there is an exact match between the current conversation and one of the examples, remove it
retrieved_docs = [
(doc, score) for doc, score in retrieved_docs
if doc.metadata.get('conversation_hash') != hash(instance.conversation.messages)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already pass conversation here, there is no need to pass OutcomeDetectionTest instance, also, it creates a circular dependency on outcome detection.

remove it, and just use the conversation to calculate the hash


# Get logging callback tracer
callbacks = get_llm_callbacks(config['session_name'])
callbacks = get_llm_callbacks()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to remove this

conversation=query_conversation,
k=k
k=k,
instance=OutcomeDetectionTest(query_conversation, intent=Intent(role=ParticipantRole.CUSTOMER, description="No description")) # No specific intent for this test,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for changes, other than check then maybe check that all conversations are different from the original conversation

vector_store: The vector store to search for similar conversations
conversation: Current conversation to find examples for
k: Number of similar conversations to retrieve
instance: Optional instance to exclude exact matches (if provided)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

@leonidb leonidb merged commit d7e357a into main Jul 23, 2025
1 check passed
@leonidb leonidb deleted the outcome_detection_fix branch July 23, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants