langchain4j / langchain4j

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

[FEATURE] UX: Observability: minimalistic logging #988

Open langchain4j opened 1 month ago

langchain4j commented 1 month ago

When debugging requests/responses to/from ChatLanguageModel, it is too noisy. It would be nicer to have an option ot enable minimalistic loggic instead, something that is much easier to parse/debug with eyes:

----------------------------------->
[System]: You are a helpful assistant
[User  ]: Hello
[AI    ]: Hi, how can I help you?
[User  ]: Tell me a joke
----------------------------------->
<-----------------------------------
[AI    ]: Why did the math book look sad? Because it had too many problems.
<-----------------------------------

If the request contains tools, they should be formatted nicely:

----------------------------------->
[System]: You are a helpful assistant
[User  ]: What's the weather in Munich?
--------
[Tools ]: getWeather(location)
----------------------------------->

If there are tool execution request(s) in the response, they should be formatted nicely:

<-----------------------------------
[AI    ]: [Tools]: getWeather("Munich")
<-----------------------------------
langchain4j commented 1 month ago

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