Find answers from the community

Updated 5 months ago

i have a chat engine based on a rag framework, how do i extract the reference that the bot

@kapa.ai i have a chat engine based on a rag framework, how do i extract the reference that the bot responded thru
k
a
5 comments
Please stand by @akvn as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
To extract the reference that the chatbot responded through, you can use the chat method of the CondensePlusContextChatEngine class. This method takes a user's message as input and returns a response. The response object should contain the information you need.

Here is an example of how to use the chat method:

Plain Text
response = chat_engine.chat("Tell me about the songs Drake released in the beef.")
print(str(response))


In this example, the chat method is called with a user's message asking about the songs Drake released. The method returns a response, which is then printed.

Please note that the exact structure and content of the response object may vary depending on the specific implementation of the CondensePlusContextChatEngine class and the configuration of the chat engine.

For more information, you can refer to the LlamaIndex documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Im using a condense question chat engine, how to extract the reference? @kapa.ai
Let me check the knowledge base for you. One moment! :books:
----------------------
To extract the reference from a response using the CondenseQuestionChatEngine, you can use the chat method of this class. This method takes a user's message and an optional chat history as input and returns an AgentChatResponse.

Here is an example of how to use the chat method:

Plain Text
response = chat_engine.chat("What is the capital of France?")
print(str(response))


In this example, the chat method is called with a user's message asking about the capital of France. The method returns a response, which is then printed.

The AgentChatResponse object should contain the information you need. However, the exact structure and content of the AgentChatResponse object may vary depending on the specific implementation of the CondenseQuestionChatEngine class and the configuration of the chat engine.

For more information, you can refer to the LlamaIndex documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord