File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from swarms .structs .batched_grid_workflow import BatchedGridWorkflow
1010from swarms .structs .concurrent_workflow import ConcurrentWorkflow
1111from swarms .structs .conversation import Conversation
12- from swarms .structs .social_algorithms import SocialAlgorithms
1312from swarms .structs .council_as_judge import CouncilAsAJudge
1413from swarms .structs .cron_job import CronJob
1514from swarms .structs .graph_workflow import (
6261from swarms .structs .round_robin import RoundRobinSwarm
6362from swarms .structs .self_moa_seq import SelfMoASeq
6463from swarms .structs .sequential_workflow import SequentialWorkflow
64+ from swarms .structs .social_algorithms import SocialAlgorithms
6565from swarms .structs .spreadsheet_swarm import SpreadSheetSwarm
6666from swarms .structs .stopping_conditions import (
6767 check_cancelled ,
Original file line number Diff line number Diff line change @@ -562,14 +562,11 @@ def save_as_json(self, force: bool = True):
562562 )
563563 return
564564
565- # Get the full data including metadata and conversation history
566- data = self .get_init_params ()
567-
568565 # Ensure we have a valid save path
569566 if not self .save_filepath :
570567 self .save_filepath = os .path .join (
571568 self .conversations_dir or os .getcwd (),
572- f"conversation_{ self .name } .json" ,
569+ f"conversation_{ self .id } .json" ,
573570 )
574571
575572 # Create directory if it doesn't exist
@@ -579,7 +576,12 @@ def save_as_json(self, force: bool = True):
579576
580577 # Save with proper formatting
581578 with open (self .save_filepath , "w" , encoding = "utf-8" ) as f :
582- json .dump (data , f , indent = 4 , default = str )
579+ json .dump (
580+ self .conversation_history ,
581+ f ,
582+ indent = 4 ,
583+ default = str ,
584+ )
583585
584586 logger .info (f"Conversation saved to { self .save_filepath } " )
585587
You can’t perform that action at this time.
0 commit comments