Skip to content
Merged
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 @@ -108,7 +108,7 @@ def format_examples(examples: list[tuple[Document, float]]) -> str:

for i, (doc, _) in enumerate(examples):
messages_data = doc.metadata.get('full_conversation', '')
messages = converter.structure(messages_data, list[Message])
messages = converter.loads(messages_data, list[Message])
conversation_text = indexing_and_retrieval.format_conversation(messages)

outcome_info = doc.metadata.get('outcome', 'No outcome information available')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ async def get_similar_finished_conversations(
# Sort by similarity score (highest first)
retrieved_docs.sort(key=lambda x: x[1], reverse=True)

# 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(conversation.messages)
]

return retrieved_docs


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ async def run_simulation(
"""Run the conversation simulation."""

# 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


# Initialize models with logging callbacks
agent_model = ChatOpenAI(**config['agent_model_kwargs'], callbacks=callbacks)
Expand Down