remove unnecc variables (#113)

i dont think either of these variables are used?
This commit is contained in:
Harrison Chase 2022-11-10 07:53:45 -08:00 committed by GitHub
parent da445e474d
commit 2179ea3103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 9 deletions

View File

@ -18,7 +18,6 @@ class OptimizedPrompt(BaseModel):
from langchain import DynamicPrompt
vectorstore = FAISS.from_texts(examples, OpenAIEmbeddings()
optimized_prompt = OptimizedPrompt(
examples=["Say hi. Hi", "Say ho. Ho"],
example_separator="\n\n",
prefix="",
suffix="\n\nSay {foo}"
@ -29,9 +28,6 @@ class OptimizedPrompt(BaseModel):
)
"""
examples: List[str]
"""A list of the examples that the prompt template expects."""
example_separator: str = "\n\n"
"""Example separator, e.g. \n\n, for the dynamic prompt creation."""
@ -162,7 +158,6 @@ class OptimizedPrompt(BaseModel):
examples, embeddings, **vectorstore_cls_kwargs
)
return cls(
examples=examples,
suffix=suffix,
input_variables=input_variables,
example_separator=example_separator,

View File

@ -39,7 +39,6 @@ class ElasticVectorSearch(VectorStore):
elastic_vector_search = ElasticVectorSearch(
"http://localhost:9200",
"embeddings",
mapping,
embedding_function
)
@ -49,7 +48,6 @@ class ElasticVectorSearch(VectorStore):
self,
elasticsearch_url: str,
index_name: str,
mapping: Dict,
embedding_function: Callable,
):
"""Initialize with necessary components."""
@ -69,7 +67,6 @@ class ElasticVectorSearch(VectorStore):
"Your elasticsearch client string is misformatted. " f"Got error: {e} "
)
self.client = es_client
self.mapping = mapping
def similarity_search(self, query: str, k: int = 4) -> List[Document]:
"""Return docs most similar to query.
@ -155,4 +152,4 @@ class ElasticVectorSearch(VectorStore):
requests.append(request)
bulk(client, requests)
client.indices.refresh(index=index_name)
return cls(elasticsearch_url, index_name, mapping, embedding.embed_query)
return cls(elasticsearch_url, index_name, embedding.embed_query)