Find answers from the community

Updated last year

https gpt index readthedocs io en latest

At a glance
https://gpt-index.readthedocs.io/en/latest/examples/agent/openai_agent.html#our-slightly-better-openaiagent-implementation
Hey guys, in this document I'm reading, how can I combine the agent with index context and my chat history?
L
T
5 comments
I think you possibly mean this?

https://gpt-index.readthedocs.io/en/latest/examples/agent/openai_agent_context_retrieval.html

If not, can you explain what you are looking for?
thank you for the quick reply, that does solve the index context part.However, I want to enter my own chat history too, like openai api's
Attachment
image.png
You can provide the chat history as an optional kwarg when you call chat

Plain Text
from llama_index.llms import ChatMessage

agent.chat("Hello!", chat_history=[ChatMessage(content="Never say hello", role="system")])
This kwarg will override the memory of the current chat session
thanks alot, I'll try it out!
Add a reply
Sign up and join the conversation on Discord