ChatMessage(role=<MessageRole.SYSTEM: 'system'>, content='\nYou are designed to help with a variety of tasks, from answering questions...
File "/app/./index_server.py", line 197, in query_index chat_engine = index.as_chat_engine(chat_mode='react', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/llama_index/indices/base.py", line 383, in as_chat_engine return ReActAgent.from_tools( ^^^^^^^^^^^^^^^^^^^^^^ TypeError: ReActAgent.from_tools() got an unexpected keyword argument 'similarity_top_k'
token_counter = TokenCountingHandler( tokenizer=tiktoken.encoding_for_model("gpt-3.5-turbo-16k").encode ) callback_manager = CallbackManager([token_counter]) llm_predictor = LLMPredictor( llm=ChatOpenAI(model_name='gpt-3.5-turbo-16k', temperature=0) )
documents = SimpleDirectoryReader(documents_dir, recursive='true', filename_as_id=True, num_files_limit=10).load_data()
document = SimpleDirectoryReader(input_files=[doc_text]).load_data()[0]
raise ValueError(f"Unknown chat mode: {chat_mode}") ValueError: Unknown chat mode: <llama_index.chat_engine.condense_question.CondenseQuestionChatEngine object... >
index = GPTVectorStoreIndex([], service_context=service_context) document = SimpleDirectoryReader(input_files=[doc_text]).load_data()[0] index.insert(document)
chat_engine = index.as_chat_engine( chat_mode="context", system_prompt="You are a chatbot with access to extra context information about dogs. Only answer questions if you can find the answer in the context, otherwise, kindly inform the user that you cannot find the answer.", chat_history=custom_chat_history )
chat_engine = index.as_chat_engine( chat_mode='react', chat_history=custom_chat_history, similarity_top_k=max_top_k, refine_template=DEFAULT_REFINE_PROMPT, text_qa_template=custom_prompt)
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo", max_tokens=2048)) service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, chunk_size=1024)
# Load documents with filenames as document IDs documents = SimpleDirectoryReader('path/to/your/data', use_filename_as_id=True).load_data()
GPTVectorStoreIndex.from_documents
index.delete(<id>)
source_nodes.node.doc_id
source_nodes.node.relationships.1