embabel-agent icon indicating copy to clipboard operation
embabel-agent copied to clipboard

LlmOptions: Mark criteria as read-only for Java Jackson compatibility

Open zhuyouxiang opened this issue 10 months ago • 0 comments

The LlmOptions guide suggests that the class is JSON serializable for use in application.yml and application configuration files.

However, persisting LlmOptions to a database JSON column leads to a UnrecognizedPropertyException: Unrecognized field "criteria" during deserialization. Suggested Fix: Annotate criteria with @get:JsonIgnore or @get:JsonProperty(access = JsonProperty.Access.READ_ONLY) to ensure Jackson skips this field during the deserialization phase.

	@JdbcTypeCode(SqlTypes.JSON)
	@Column(name = "llm_options")
	private LlmOptions llmOptions;

zhuyouxiang avatar Feb 04 '26 09:02 zhuyouxiang