Eric Deandrea
Eric Deandrea
I've debugged upstream a bit. All the magic happens in `dev.langchain4j.service.tool.DefaultToolExecutor`.   Seems for object type arguments...
> One more reason to not use this solution :) Or we can see it as an opportunity to improve what we do :) Let me debug what we're doing...
`2024-11-06 09:00:33,642 ERROR [io.qua.lan.run.too.QuarkusToolExecutor] (executor-thread-1) com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.time.LocalDate` from Object value (token `JsonToken.START_OBJECT`) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 18] (through reference chain: org.vaadin.marcus.langchain4j.LangChain4jTools$$QuarkusToolArgumentMapper$changeBooking_c316268f90f72bed55786b9940800e8671df667d["newFlightDate"])`
Here's the magic that makes it work in upstream.... https://github.com/langchain4j/langchain4j/blob/69a0a154548900bade4db3f36ab9c6a28a7314ce/langchain4j-core/src/main/java/dev/langchain4j/internal/GsonJsonCodec.java#L35-L48 ```java private static final Gson GSON = new GsonBuilder() .setPrettyPrinting() .registerTypeAdapter( LocalDate.class, (JsonSerializer) (localDate, type, context) -> new JsonPrimitive(localDate.format(ISO_LOCAL_DATE)) )...
I can just change my tool to be ```java @Tool(""" Modifies an existing booking. This includes making changes to the flight date, and the departure and arrival airports. """) public...
Any thoughts on this one? Definitely weird, but still an issue nonetheless. Its preventing our CI from being able to run.
Should I post this to upstream Langchain4j and see what they say?
Seems to have resolved itself after updating some dependency versions (NOT Quarkus or langchain versions). Very odd. I'll close for now and reopen if it appears again.
I'm going to reopen this since we are seeing this error again on our CI: https://github.com/rh-rad-ai-roadshow/parasol-insurance/actions/runs/11071951311/job/30765006606#step:5:4379 ``` Error: Tests run: 2, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 20.42...
Thanks for that @jmartisk ! To clarify, is it that I would just need to create the EmbeddingModel class directly in the `@BeforeAll` method, even if I don't use it...