from llama_index.core.chat_engine.types import BaseChatEngine from llama_index.core.llms import ChatMessage, MessageRole
ChatMessage
and MessageRole
is as follows:from llama_index.core.llms import ChatMessage, MessageRole
BaseChatEngine
in the provided knowledge sources. Therefore, I cannot confirm if the import statement for BaseChatEngine
is correct. Please refer to the official LlamaIndex documentation or source code for more information.ValidationError Traceback (most recent call last) <ipython-input-27-7a35c6086b8b> in <cell line: 3>() 1 from llama_parse import LlamaParse 2 ----> 3 parser = LlamaParse(verbose=True) 4 json_objs = parser.get_json_result("./uber_10q_march_2022.pdf") 5 json_list = json_objs[0]["pages"] /usr/local/lib/python3.10/dist-packages/pydantic/v1/main.py in __init__(__pydantic_self__, **data) 339 values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data) 340 if validation_error: --> 341 raise validation_error 342 try: 343 object_setattr(__pydantic_self__, '__dict__', values) ValidationError: 1 validation error for LlamaParse api_key The API key is required. (type=value_error)
LlamaParse
object requires an API key to be instantiated. You can obtain this API key from <https://cloud.llamaindex.ai
.>LlamaParse
with an API key:from llama_parse import LlamaParse parser = LlamaParse( api_key="llx-...", # replace with your actual API key verbose=True, )
"llx-..."
with your actual API key. You can also set the API key in your environment variables as LLAMA_CLOUD_API_KEY
.