Missing schema descriptions in prod
When running in prod, I'm getting different results than when running in dev. After digging, it seems that the @doc description from my schema is missing in prod.
E.g. in prod:
iex> Instructor.JSONSchema.from_ecto_schema(DSS.ProductSuggestion)
"{\"type\":\"object\",\"description\":\"\",\"title\":\"DSS.ProductSuggestion\",\"required\":[\"product_description\",\"product_name\",\"relative_description\"],\"properties\":{\"product_description\":{\"type\":\"string\",\"title\":\"product_description\"},\"product_name\":{\"type\":\"string\",\"title\":\"product_name\"},\"relative_description\":{\"type\":\"string\",\"title\":\"relative_description\"}}}"
Notice that the description field is empty, which is not the case when calling the same function in dev.
Are you deploying with Mix releases? Releases strip out docs by default, but you can configure them to be kept with:
# mix.exs
def project do
# ...
releases: [
myappname: [
strip_beams: [keep: ["Docs"]]
]
]
end
Aah, yes I am. Didn't know about that option to keep the docs, thanks!
Related to #35.
Solved in the latest release, {:instructor, "~> 0.1.0"}
We've migrated to using @llm_doc for this exact reason