Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored output + structured output fix #543

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

nicorne
Copy link
Collaborator

@nicorne nicorne commented Jul 19, 2024

Description:

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

Structured output fix:

  • Fix the function name
  • Updating function description when Pydantic class has no docstring

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
Copy link
Collaborator Author

nicorne commented Jul 19, 2024

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

@nicorne
Copy link
Collaborator Author

nicorne commented Jul 27, 2024

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

@nicorne
Copy link
Collaborator Author

nicorne commented Jul 27, 2024

Screenshot 2024-07-27 at 23 49 15

@nicorne
Copy link
Collaborator Author

nicorne commented Jul 29, 2024

Screenshot 2024-07-29 at 18 38 50

@nicorne nicorne mentioned this pull request Jul 30, 2024
@kyegomez kyegomez force-pushed the master branch 2 times, most recently from 710b248 to e6d616b Compare November 27, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants