You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some case, Ollama send response containing Illegal unquoted character in a field of a json document:
2024-06-03 14:50:02,861 ERROR [io.qua.lan.run.ais.AiServiceMethodImplementationSupport] (executor-thread-1) Execution of com.cqc.syndifun.celia.ai.CeliaService#chat failed: java.io.UncheckedIOException: com.fasterxml.jackson.databind.JsonMappingException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 2, column: 105] (through reference chain: com.cqc.syndifun.celia.ai.ChatResponse["answer"])
Workaround, configure the object mapper in your application.
@Singleton
@SuppressWarnings("unused")
public class ObjectMapperConfiguration implements ObjectMapperCustomizer {
public void customize(ObjectMapper mapper) {
// Avoid Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
// Needed for AI
mapper.configure(
JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(),
true
);
}
}
Perhaps if this is the way to go, we can integrate this configuration directly in quarkus-langchain4j ?
The text was updated successfully, but these errors were encountered:
In some case, Ollama send response containing Illegal unquoted character in a field of a json document:
Workaround, configure the object mapper in your application.
Perhaps if this is the way to go, we can integrate this configuration directly in quarkus-langchain4j ?
The text was updated successfully, but these errors were encountered: