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

[Test Case Failure]: for the test GeminiSchemaConverter_test.test_convert #113

Closed
RafaelJohn9 opened this issue Aug 19, 2024 · 4 comments
Closed

Comments

@RafaelJohn9
Copy link
Contributor

Test Case

tests/schema_converters/GeminiSchemaConverter_test.py

Root Cause

The test is likely failing due to a TypeError

raise TypeError(f'Object of type {o.__class__.__name__} '
                        f'is not JSON serializable')
E       TypeError: Object of type FunctionDeclaration is not JSON serializable

Potential Solutions

Check the return type inside / swarmauri/standard/schema_converters/concrete/GeminiSchemaConverter.GeminiSchemaConverter

Additional Context (optional)

No response

Type of Test Case

Unit

@cobycloud cobycloud added this to the v0.4.1 milestone Aug 19, 2024
@cobycloud cobycloud assigned RafaelJohn9 and unassigned RafaelJohn9 Aug 19, 2024
@cobycloud
Copy link
Contributor

https://github.com/swarmauri/swarmauri-sdk/blob/master/swarmauri/standard/schema_converters/concrete/GeminiSchemaConverter.py includes non-serializable objects.

GeminiToolModel uses the GeminiSchemaConverter successfully right now.

If we refactor the GeminiSchemaConverter to make it JSON serializable, then we must update the GeminiToolModel to handle this change also.

@cobycloud
Copy link
Contributor

@cobycloud
Copy link
Contributor

After merging #159 we are seeing the following error messages:

tests/schema_converters/GeminiSchemaConverter_test.py::test_convert 
-------------------------------- live log call ---------------------------------
[{'name': 'AdditionTool', 'description': 'This tool has two numbers together', 'parameters': {'type': <Type.OBJECT: 6>, 'properties': {'y': {'type': <Type.INTEGER: 3>, 'description': 'The right operand'}, 'x': {'type': <Type.INTEGER: 3>, 'description': 'The left operand'}}, 'required': ['x', 'y']}}]
FAILED    
FAILED tests/llms/GeminiToolModel_test.py::test_agent_exec - ValueError: Protocol message Schema has no "type" field.
FAILED tests/schema_converters/GeminiSchemaConverter_test.py::test_convert - TypeError: Object of type Repeated is not JSON serializable

@cobycloud
Copy link
Contributor

#163 this resolved the GeminiSchemaConverter failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants