class APISpec(pydantic.BaseModel):
spec: str
class Code(pydantic.BaseModel):
code: str
class APISpecSignature(Signature):
template: APISpec = InputField(desription="API Specification")
language: str = InputField(description="Language of the generated code.")
code: Code = OutputField(desription="Code generated according to the api specification and the specified language.")
predictor = TypedPredictor(APISpecSignature)
prediction = predictor(
template=APISpec(spec=spec),
language='python'
)
it throws
ValueError: ('Too many retries trying to get the correct output format. Try simplifying the requirements.', {'code': "ValueError('json output should start and end with { and }')"})
I've tried several models, including GPT-4o, but all have failed. So, is there anything wrong with my code?
I wrote a demo, but it throws an exception.
it throws
I've tried several models, including GPT-4o, but all have failed. So, is there anything wrong with my code?