File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
from dotenv import load_dotenv
3
3
from langchain_community .document_loaders import DirectoryLoader , UnstructuredPDFLoader
4
- from langchain_community . embeddings import OpenAIEmbeddings
4
+ from langchain_openai import OpenAIEmbeddings
5
5
from langchain_community .vectorstores import PGVector
6
6
from langchain_experimental .text_splitter import SemanticChunker
7
7
15
15
use_multithreading = True ,
16
16
show_progress = True ,
17
17
max_concurrency = 50 ,
18
- loader_cls = UnstructuredPDFLoader
18
+ loader_cls = UnstructuredPDFLoader ,
19
19
)
20
20
21
21
docs = loader .load ()
31
31
collection_name = PG_COLLECTION_NAME ,
32
32
connection_string = os .getenv ("POSTGRES_URL" ),
33
33
pre_delete_collection = True ,
34
+ use_jsonb = True ,
34
35
)
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ def predict(inputs: dict) -> dict:
18
18
19
19
20
20
def format_evaluator_inputs (run : Run , example : Example ):
21
+ # return StringEvaluatorInput(
22
+ # input=example.inputs["inputs"],
23
+ # prediction=run.outputs.values(),
24
+ # reference=example.outputs["expected"],
25
+ # )
21
26
return {
22
27
"input" : example .inputs ["inputs" ],
23
28
"prediction" : next (iter (run .outputs .values ())),
Original file line number Diff line number Diff line change 10
10
collection_name = PG_COLLECTION_NAME ,
11
11
connection_string = os .getenv ("POSTGRES_URL" ),
12
12
embedding_function = OpenAIEmbeddings (model = EMBEDDING_MODEL ),
13
+ use_jsonb = True ,
13
14
)
You can’t perform that action at this time.
0 commit comments