File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ def evaluate(
7777 except ImportError :
7878 raise ImportError (
7979 "llama_index must be installed to use this function. "
80- "Install it with `pip install llama_index`."
80+ "Please, install it with `pip install llama_index`."
8181 )
8282
8383 # TODO: rate limit, error handling, retries
Original file line number Diff line number Diff line change 1010if t .TYPE_CHECKING :
1111 from langchain .callbacks .base import Callbacks
1212 from langchain .prompts import ChatPromptTemplate
13- from llama_index .llms .base import LLM as LiLLM
13+ try :
14+ from llama_index .llms .base import LLM as LiLLM
15+ except ImportError :
16+ raise ImportError (
17+ "llama_index must be installed to use this function. "
18+ "Please, install it with `pip install llama_index`."
19+ )
1420
1521
1622class LlamaIndexLLM (RagasLLM ):
Original file line number Diff line number Diff line change 55from collections import defaultdict , namedtuple
66from dataclasses import dataclass
77
8+ try :
9+ from llama_index .indices .query .embedding_utils import get_top_k_embeddings
10+ from llama_index .node_parser import SimpleNodeParser
11+ from llama_index .readers .schema import Document as LlamaindexDocument
12+ from llama_index .schema import BaseNode
13+ except ImportError :
14+ raise ImportError (
15+ "llama_index must be installed to use this function. "
16+ "Please, install it with `pip install llama_index`."
17+ )
18+
819import numpy as np
920import numpy .testing as npt
1021import pandas as pd
1122from langchain .embeddings import OpenAIEmbeddings
1223from langchain .embeddings .base import Embeddings
1324from langchain .prompts import ChatPromptTemplate
1425from langchain .schema .document import Document as LangchainDocument
15- from llama_index .indices .query .embedding_utils import get_top_k_embeddings
16- from llama_index .node_parser import SimpleNodeParser
17- from llama_index .readers .schema import Document as LlamaindexDocument
18- from llama_index .schema import BaseNode
1926from numpy .random import default_rng
2027from tqdm import tqdm
2128
You can’t perform that action at this time.
0 commit comments