Skip to content

Commit 9e4555a

Browse files
authored
Merge pull request #9 from lpm0073/next
style: lint and reorganize imports
2 parents 78327f6 + 1f5df34 commit 9e4555a

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

models/ssm.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@
77
https://python.langchain.com/docs/integrations/retrievers/pinecone_hybrid_search
88
"""
99

10+
# document loading
1011
import glob
1112
import os
1213
import textwrap
13-
from typing import List # ClassVar
14+
from typing import List
1415

1516
# pinecone integration
1617
import pinecone
1718
from langchain.cache import InMemoryCache
18-
19-
# prompting and chat
2019
from langchain.chat_models import ChatOpenAI
21-
22-
# document loading
2320
from langchain.document_loaders import PyPDFLoader
2421

2522
# embedding
2623
from langchain.embeddings import OpenAIEmbeddings
27-
28-
# vector database
2924
from langchain.globals import set_llm_cache
25+
26+
# prompting and chat
3027
from langchain.llms.openai import OpenAI
3128
from langchain.prompts import PromptTemplate
29+
30+
# hybrid search capability
3231
from langchain.retrievers import PineconeHybridSearchRetriever
3332
from langchain.schema import HumanMessage, SystemMessage
3433
from langchain.text_splitter import Document
@@ -39,9 +38,6 @@
3938
from models.const import Credentials
4039

4140

42-
# from pydantic import BaseModel, ConfigDict, Field
43-
44-
4541
###############################################################################
4642
# initializations
4743
###############################################################################
@@ -107,11 +103,6 @@ def prompt_with_template(self, prompt: PromptTemplate, concept: str, model: str
107103
retval = llm(prompt.format(concept=concept))
108104
return retval
109105

110-
def split_text(self, text: str) -> List[Document]:
111-
"""Split text. Leaving this here for now, since it exposes the return type."""
112-
retval = self.text_splitter.create_documents([text])
113-
return retval
114-
115106
def fit_tf_idf_values(self, corpus: List[str]):
116107
"""Fit TF-IDF values.
117108
1. Fit the BM25 encoder on the corpus

0 commit comments

Comments
 (0)