Skip to content

Commit

Permalink
updating docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfeil committed Dec 18, 2023
1 parent a8f2c1e commit a0df7c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/community/langchain_community/embeddings/gradient_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class GradientEmbeddings(BaseModel, Embeddings):
gradient_api_url: Optional[str] = None
"""Endpoint URL to use."""

query_for_retrieval: Optional[str] = None
"""Endpoint URL to use."""
query_prompt_for_retrieval: Optional[str] = None
"""Query pre-prompt"""

client: Any = None #: :meta private:
"""Gradient client."""
Expand Down Expand Up @@ -130,7 +130,7 @@ def embed_query(self, text: str) -> List[float]:
Embeddings for the text.
"""
query = (
f"{self.query_for_retrieval} {text}" if self.query_for_retrieval else text
f"{self.query_prompt_for_retrieval} {text}" if self.query_prompt_for_retrieval else text

Check failure on line 133 in libs/community/langchain_community/embeddings/gradient_ai.py

View workflow job for this annotation

GitHub Actions / ci (libs/community) / lint / build (3.8)

Ruff (E501)

langchain_community/embeddings/gradient_ai.py:133:89: E501 Line too long (100 > 88)

Check failure on line 133 in libs/community/langchain_community/embeddings/gradient_ai.py

View workflow job for this annotation

GitHub Actions / ci (libs/community) / lint / build (3.11)

Ruff (E501)

langchain_community/embeddings/gradient_ai.py:133:89: E501 Line too long (100 > 88)
)
return self.embed_documents([query])[0]

Expand All @@ -144,7 +144,7 @@ async def aembed_query(self, text: str) -> List[float]:
Embeddings for the text.
"""
query = (
f"{self.query_for_retrieval} {text}" if self.query_for_retrieval else text
f"{self.query_prompt_for_retrieval} {text}" if self.query_prompt_for_retrieval else text

Check failure on line 147 in libs/community/langchain_community/embeddings/gradient_ai.py

View workflow job for this annotation

GitHub Actions / ci (libs/community) / lint / build (3.8)

Ruff (E501)

langchain_community/embeddings/gradient_ai.py:147:89: E501 Line too long (100 > 88)

Check failure on line 147 in libs/community/langchain_community/embeddings/gradient_ai.py

View workflow job for this annotation

GitHub Actions / ci (libs/community) / lint / build (3.11)

Ruff (E501)

langchain_community/embeddings/gradient_ai.py:147:89: E501 Line too long (100 > 88)
)
embeddings = await self.aembed_documents([query])
return embeddings[0]

0 comments on commit a0df7c6

Please sign in to comment.