langchain4j / langchain4j

Java version of LangChain
https://docs.langchain4j.dev
Apache License 2.0
4.92k stars 979 forks source link

[FEATURE] Improve reliability of structured outputs in AI Services #859

Open langchain4j opened 8 months ago

langchain4j commented 8 months ago
ruizrube commented 7 months ago

Hi,

The templates for parsing outputs were developed and tested using ChatGPT, isn't?. Open LLMs, such as Llama, are very more verbose in their answers.

kind regards. Thank you for such a stunning project.

langchain4j commented 7 months ago

@ruizrube yes, most of the high-level features were developed with at least gpt-3.5-turbo-level LLM in mind.

But now when we have llama3/mixtral/etc and json mode in Ollama, it should work as good for most of the use cases.

But we need to implement this PR anyway to ensure that a long tail of corner cases is handled well.

langchain4j commented 6 months ago

Related: https://github.com/langchain4j/langchain4j/issues/1087

langchain4j commented 6 months ago

Related: https://github.com/langchain4j/langchain4j/discussions/786

abbas-gadhia commented 6 months ago

In case anyone is stuck with this, just enable the json mode of the LLM for the time being.