kyegomez / swarms

The Enterprise-Grade Production-Ready Multi-Agent Orchestration Framework Join our Community: https://discord.com/servers/agora-999382051935506503
https://docs.swarms.world
GNU Affero General Public License v3.0
1.81k stars 248 forks source link

Colored output + structured output fix #543

Open nicorne opened 4 months ago

nicorne commented 4 months ago

Description:

Coloured output: specifies the agent's name in capital letters in pink and the response text in blue.

Structured output fix:

Here is the prompt we're sending with the current implementation: Pydantic class WITH doc string: {'function_call': 'auto', 'functions': [{'name': 'Schema', 'description': 'This class defines the output format of our agent', 'parameters': {'properties': {'name': {'type': 'string'}, 'agent': {'type': 'integer'}, 'is_student': {'type': 'boolean'}, 'courses': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'agent', 'is_student', 'courses'], 'type': 'object'}}]}

Pydantic class WITHOUT doc string: {'function_call': 'auto', 'functions': [{'name': 'Schema', 'description': "Strictly adhere to Schema's format with all the required parameters using the correct types", 'parameters': {'properties': {'name': {'type': 'string'}, 'agent': {'type': 'integer'}, 'is_student': {'type': 'boolean'}, 'courses': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['name', 'agent', 'is_student', 'courses'], 'type': 'object'}}]}

Test agent_with_basemodel_output_type.py

Tag maintainer: @kyegomez


📚 Documentation preview 📚: https://swarms--543.org.readthedocs.build/en/543/

nicorne commented 4 months ago

Screenshot 2024-07-19 at 22 38 21 Colored output

nicorne commented 4 months ago

Couldn't change the colour of the "System: " string

nicorne commented 4 months ago

Screenshot 2024-07-27 at 23 49 15

nicorne commented 3 months ago

Screenshot 2024-07-29 at 18 38 50