langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Get the conversation logs in ConversationalRetrievalChain

Open CreationLee opened this issue 1 year ago • 2 comments

How to get the conversation logs in ConversationalRetrievalChain

such as the condensed standalone question

CreationLee avatar Apr 13 '23 07:04 CreationLee

Suppose you are trying out https://github.com/hwchase17/chat-langchain

  • Run your langchain-server locally its api port will be 8000, its default ui is http://localhost:4173/
  • Enable tracing=true in get_chain() in main.py
  • Start service like this
$ LANGCHAIN_HANDLER=langchain LANGCHAIN_ENDPOINT=http://localhost:8000  uvicorn main:app --port 9000 --reload
  • Do some chats at http://localhost:9000
  • Look up tracing (explore) at http://localhost:4173, there will be some child runs that contain standalone question

You can read more about tracing here: https://python.langchain.com/en/latest/tracing.html

HTH,

anh avatar Apr 14 '23 02:04 anh

Suppose you are trying out https://github.com/hwchase17/chat-langchain

  • Run your langchain-server locally its api port will be 8000, its default ui is http://localhost:4173/
  • Enable tracing=true in get_chain() in main.py
  • Start service like this
$ LANGCHAIN_HANDLER=langchain LANGCHAIN_ENDPOINT=http://localhost:8000  uvicorn main:app --port 9000 --reload
  • Do some chats at http://localhost:9000
  • Look up tracing (explore) at http://localhost:4173, there will be some child runs that contain standalone question

You can read more about tracing here: https://python.langchain.com/en/latest/tracing.html

HTH,

TKS!

I need to record some inputs and outputs to our own log system, so is three any way to get the inputs and outputs during the ConversationalRetrievalChain, especially, the condensed question from chat history, i have tried lots of ways, but they all didn't work for me, what i tried:

  • call back manager, didn't work with the AzureChatOpenAI

CreationLee avatar Apr 14 '23 03:04 CreationLee

Hi, @CreationLee! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you were looking for a way to retrieve conversation logs in the ConversationalRetrievalChain, specifically the condensed standalone question. Anh suggested trying out a specific repository and provided instructions on how to enable tracing to retrieve the desired information. You mentioned that you have tried various methods, including the callback manager, but none of them have worked.

Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your understanding!

dosubot[bot] avatar Sep 07 '23 16:09 dosubot[bot]

I'm sorry, but tracing the network doesn't seem to be the proper way of logging in this case

alex-stellar avatar Jan 04 '24 17:01 alex-stellar