/Users/ahsan/Desktop/SageByte/lloyed/lloyed-aidev/load_vector.py:203: DeprecationWarning: Call to deprecated function (or staticmethod) download_loader. (
download_loader() is deprecated. Please install tool using pip install directly instead.)
loader = PagedCSVReader(encoding="utf-8")
The model text-divinchi-003 has been deprecated
with llama-index version 0.7.7. system_messages = [
ChatMessage(role=MessageRole('system'),
content="🌟 Welcome to our chat!"),
ChatMessage(role=MessageRole(
'system'), content="🤖 I'm your friendly bot assistant. Ask me anything and let's explore together!"),
]
messages = custom_chat_history
messages.extend(system_messages)
memory = ChatMemoryBuffer.from_defaults(chat_history=messages)
agent = OpenAIAgent.from_tools(
query_engine_tools, verbose=True, memory=memory)
response = agent.chat(text)
policies_storage_context = StorageContext.from_defaults(
persist_dir="./custom-knowledge-base")
policies_index = load_index_from_storage(policies_storage_context)
policies_engine = policies_index.as_query_engine(similarity_top_k=10)
memory = ChatMemoryBuffer.from_defaults(token_limit=1500)
chat_engine = policies_index.as_chat_engine(
memory=memory,
chat_mode="condense_question",
)
response = chat_engine.chat(text)
What was my previous question
it reply back with apology message.def get_file_metadata(filename: str) -> Dict:
file_name = os.path.basename(filename)
file_name_without_extension = os.path.splitext(file_name)[0]
metadata = {"file_name": file_name_without_extension}
return metadata
chatbot_data = SimpleDirectoryReader("data/", file_metadata=get_file_metadata).load_data()