First check
Bug summary
I encountered an error while working with complex types - it seems that using nested types with lists will break the schema. Including the ComplexType causes an error response "Invalid schema for function".
Reproduction
from pydantic import BaseModel
from typing import List
class SimpleType(BaseModel):
name: str
value: str
class ComplexType(BaseModel):
name: str
value: List[SimpleType]
class MarvinParseResult(BaseModel):
simple_type: SimpleType
complex_type: ComplexType # Comment this out and it passes
Error
'Error code: 400 - {\'error\': {\'message\': "Invalid schema for function \'FormatResponse\'. Please ensure it is a valid JSON Schema.", \'type\': \'invalid_request_error\', \'param\': \'tools[0].function.parameters\', \'code\': \'invalid_function_parameters\'}}
Versions
Version: 2.3.3
Python version: 3.10.12
OS/Arch: linux/x86_64
Additional context
No response
First check
Bug summary
I encountered an error while working with complex types - it seems that using nested types with lists will break the schema. Including the ComplexType causes an error response "Invalid schema for function".
Reproduction
Error
'Error code: 400 - {\'error\': {\'message\': "Invalid schema for function \'FormatResponse\'. Please ensure it is a valid JSON Schema.", \'type\': \'invalid_request_error\', \'param\': \'tools[0].function.parameters\', \'code\': \'invalid_function_parameters\'}}Versions
Additional context
No response