Find answers from the community

Updated 2 months ago

Hey, I am using RAG system with

Hey, I am using RAG system with llamaindex and I am on python 3.10 I am having this issue can anyone help me with this
Plain Text
from llama_index.llms.azure_openai import AzureOpenAI
from llama_index.llms.azure_openai import AzureOpenAI
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llama_index.vector_stores.chroma import ChromaVectorStore

from llama_index.core import StorageContext
import chromadb
import os
from llama_index.core import Settings



















 2 from llama_index.llms.azure_openai import AzureOpenAI
      3 from llama_index.llms.azure_openai import AzureOpenAI
      4 from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding

File c:\Chat-bot\venv\lib\site-packages\llama_index\llms\azure_openai\__init__.py:1
----> 1 from llama_index.llms.azure_openai.base import (
      2     AzureOpenAI,
      3     SyncAzureOpenAI,
      4     AsyncAzureOpenAI,
      5 )
      7 __all__ = ["AzureOpenAI", "SyncAzureOpenAI", "AsyncAzureOpenAI"]

File c:\Chat-bot\venv\lib\site-packages\llama_index\llms\azure_openai\base.py:4
      1 from typing import Any, Callable, Dict, Optional, Sequence
      3 import httpx
----> 4 from llama_index.core.base.llms.types import ChatMessage
      5 from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator
      6 from llama_index.core.callbacks import CallbackManager

File c:\Chat-bot\venv\lib\site-packages\llama_index\core\__init__.py:19
     15 from llama_index.core.embeddings.mock_embed_model import MockEmbedding
...
--> 169     raise TypeError(f"Plain {arg} is not valid as type argument")
    170 if isinstance(arg, (type, TypeVar, ForwardRef, types.UnionType, ParamSpec)):
    171     return arg

TypeError: Plain typing.TypeAlias is not valid as type argument
L
p
7 comments
Hmm, pip install typing-extensions==4.5.0 maybe?
I did, I just upgraded my python version and it doesnt seem to throw that error but I am having some packages error
What packages error?
Plain Text
File "C:\Chat-bot\venv\Lib\site-packages\llama_index\core\readers\file\base.py", line 52, in _try_loading_included_file_formats
    from llama_index.readers.file import (
  File "C:\Chat-bot\venv\Lib\site-packages\llama_index\readers\file\__init__.py", line 21, in <module>
    from llama_index.readers.file.unstructured import UnstructuredReader
  File "C:\Chat-bot\venv\Lib\site-packages\llama_index\readers\file\unstructured\__init__.py", line 3, in <module>
    from llama_index.readers.file.unstructured.base import (
  File "C:\Chat-bot\venv\Lib\site-packages\llama_index\readers\file\unstructured\base.py", line 14, in <module>
    from unstructured.documents.elements import Element
ModuleNotFoundError: No module named 'unstructured'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Chat-bot\chat.py", line 44, in <module>
    ).load_data()
      ^^^^^^^^^^^
  File "C:\Chat-bot\venv\Lib\site-packages\llama_index\core\readers\file\base.py", line 690, in load_data
    SimpleDirectoryReader.load_file(
  File "C:\Chat-bot\venv\Lib\site-packages\llama_index\core\readers\file\base.py", line 518, in load_file
    default_file_reader_cls = SimpleDirectoryReader.supported_suffix_fn()
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Chat-bot\venv\Lib\site-packages\llama_index\core\readers\file\base.py", line 67, in _try_loading_included_file_formats
    raise ImportError("`llama-index-readers-file` package not found")
ImportError: `llama-index-readers-file` package not found
`
I fixed it, i deleted the virtual env and made a new one and it fixed, thank you
Add a reply
Sign up and join the conversation on Discord