[BUGFIX][Conversation][Initialization parameters in the output]

pull/1155/head
Kye Gomez 3 days ago
parent 5e35bda4b3
commit db53d349a3

@ -9,7 +9,6 @@ from swarms.structs.batch_agent_execution import batch_agent_execution
from swarms.structs.batched_grid_workflow import BatchedGridWorkflow
from swarms.structs.concurrent_workflow import ConcurrentWorkflow
from swarms.structs.conversation import Conversation
from swarms.structs.social_algorithms import SocialAlgorithms
from swarms.structs.council_as_judge import CouncilAsAJudge
from swarms.structs.cron_job import CronJob
from swarms.structs.graph_workflow import (
@ -62,6 +61,7 @@ from swarms.structs.multi_agent_router import MultiAgentRouter
from swarms.structs.round_robin import RoundRobinSwarm
from swarms.structs.self_moa_seq import SelfMoASeq
from swarms.structs.sequential_workflow import SequentialWorkflow
from swarms.structs.social_algorithms import SocialAlgorithms
from swarms.structs.spreadsheet_swarm import SpreadSheetSwarm
from swarms.structs.stopping_conditions import (
check_cancelled,

@ -562,14 +562,11 @@ class Conversation:
)
return
# Get the full data including metadata and conversation history
data = self.get_init_params()
# Ensure we have a valid save path
if not self.save_filepath:
self.save_filepath = os.path.join(
self.conversations_dir or os.getcwd(),
f"conversation_{self.name}.json",
f"conversation_{self.id}.json",
)
# Create directory if it doesn't exist
@ -579,7 +576,12 @@ class Conversation:
# Save with proper formatting
with open(self.save_filepath, "w", encoding="utf-8") as f:
json.dump(data, f, indent=4, default=str)
json.dump(
self.conversation_history,
f,
indent=4,
default=str,
)
logger.info(f"Conversation saved to {self.save_filepath}")

Loading…
Cancel
Save