Skip to content

Commit d9244ef

Browse files
committedMay 20, 2024
updating to use jsonb
1 parent 9dababd commit d9244ef

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
 

‎importer/load_and_process.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from dotenv import load_dotenv
33
from langchain_community.document_loaders import DirectoryLoader, UnstructuredPDFLoader
4-
from langchain_community.embeddings import OpenAIEmbeddings
4+
from langchain_openai import OpenAIEmbeddings
55
from langchain_community.vectorstores import PGVector
66
from langchain_experimental.text_splitter import SemanticChunker
77

@@ -15,7 +15,7 @@
1515
use_multithreading=True,
1616
show_progress=True,
1717
max_concurrency=50,
18-
loader_cls=UnstructuredPDFLoader
18+
loader_cls=UnstructuredPDFLoader,
1919
)
2020

2121
docs = loader.load()
@@ -31,4 +31,5 @@
3131
collection_name=PG_COLLECTION_NAME,
3232
connection_string=os.getenv("POSTGRES_URL"),
3333
pre_delete_collection=True,
34+
use_jsonb=True,
3435
)

‎langsmith_testing/dataset_evaluation.py

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ def predict(inputs: dict) -> dict:
1818

1919

2020
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+
# )
2126
return {
2227
"input": example.inputs["inputs"],
2328
"prediction": next(iter(run.outputs.values())),

‎modules/vector_store.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
collection_name=PG_COLLECTION_NAME,
1111
connection_string=os.getenv("POSTGRES_URL"),
1212
embedding_function=OpenAIEmbeddings(model=EMBEDDING_MODEL),
13+
use_jsonb=True,
1314
)

0 commit comments

Comments
 (0)
Please sign in to comment.