Skip to content

Code-derived inputs and outputs should be serialized as raw strings #775

Description

@eb8680

Currently we use small Pydantic models (e.g. handlers.llm.harness.synthesis.body.SynthesizedFunction) as the model-side representation of code-derived objects, e.g. function-valued Skill outputs. Complying with the schemas associated with these is surprisingly hard for LLMs/providers like ds4 that don't implement exact structured output decoding, because then the LLM itself is forced to deal with escape characters in JSON. After #771 #770 we should generalize the pattern in handlers.llm.harness.synthesis.snippet and just use bare str plus PlainSerializer/BeforeValidator annotations for all of these types.

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions