josh-ashkinaze / plurals

0 stars 1 forks source link

improve unit tests in a few ways #20

Open josh-ashkinaze opened 4 days ago

josh-ashkinaze commented 4 days ago

I made these changes for test_moderator_default; we want everything to be like this.

    def test_moderator_default(self):
        a2 = Agent(ideology='neutral', model=self.model)
        a3 = Agent(ideology='liberal', model=self.model)
        a4 = Agent(ideology='conservative', model=self.model)
        mod = Moderator()
        mixed = Chain([a2, a3, a4], task_description=self.task, moderator=mod)
        mixed.process()
        formatted_responses = mixed.responses[:-1]

        print("Mixed", mixed.moderator.persona)

        expected_persona = SmartString(DEFAULTS['moderator']['persona']['default']).format(task=self.task)
        expected_combination_instructions = SmartString(DEFAULTS['moderator']['combination_instructions']['default']).format(previous_responses=format_previous_responses(formatted_responses))

        # Assertions
        self.assertIsNotNone(mixed.final_response)
        self.assertEqual(expected_persona, mixed.moderator.persona)
        self.assertEqual(expected_combination_instructions, mixed.moderator.combination_instructions)
josh-ashkinaze commented 1 day ago

due to the changes I made def pull from main before working on this!

josh-ashkinaze commented 4 hours ago

@narenedara I updated debate with a fix. So use updated branch

https://github.com/josh-ashkinaze/plurals/commit/667f48131eeeb896fadc05dee79704a453a67df9