mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-03 18:24:10 +00:00
fix: correct spelling mistakes of "seperate, intialise, pre-defined" (#14647)
fix spellings **seperate -> separate**: found more occurrences, see https://github.com/langchain-ai/langchain/pull/14602 **initialise -> intialize**: the latter is more common in the repo **pre-defined > predefined**: adding a comma after a prefix is a delicate matter, but this is a generally accepted word also, another word that appears in the repo is "fs" (stands for filesystem), e.g., in `libs/core/langchain_core/prompts/loading.py` ` """Unified method for loading a prompt from LangChainHub or local fs."""` Isn't "filesystem" better?
This commit is contained in:
parent
86d27fd684
commit
c3f8733aef
@ -46,7 +46,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"---\n",
|
"---\n",
|
||||||
"\n",
|
"\n",
|
||||||
"A seperate cookbook highlights `Option 1` [here](https://github.com/langchain-ai/langchain/blob/master/cookbook/multi_modal_RAG_chroma.ipynb).\n",
|
"A separate cookbook highlights `Option 1` [here](https://github.com/langchain-ai/langchain/blob/master/cookbook/multi_modal_RAG_chroma.ipynb).\n",
|
||||||
"\n",
|
"\n",
|
||||||
"And option `Option 2` is appropriate for cases when a multi-modal LLM cannot be used for answer synthesis (e.g., cost, etc).\n",
|
"And option `Option 2` is appropriate for cases when a multi-modal LLM cannot be used for answer synthesis (e.g., cost, etc).\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
"id": "2d98412d-fc53-42c1-aed8-f1f8eb9ada58",
|
"id": "2d98412d-fc53-42c1-aed8-f1f8eb9ada58",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"Prompt templates are pre-defined recipes for generating prompts for language models.\n",
|
"Prompt templates are predefined recipes for generating prompts for language models.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"A template may include instructions, few-shot examples, and specific context and\n",
|
"A template may include instructions, few-shot examples, and specific context and\n",
|
||||||
"questions appropriate for a given task.\n",
|
"questions appropriate for a given task.\n",
|
||||||
|
@ -58,7 +58,7 @@ class GCSFileLoader(BaseLoader):
|
|||||||
"Please install it with `pip install google-cloud-storage`."
|
"Please install it with `pip install google-cloud-storage`."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Initialise a client
|
# initialize a client
|
||||||
storage_client = storage.Client(
|
storage_client = storage.Client(
|
||||||
self.project_name, client_info=get_client_info("google-cloud-storage")
|
self.project_name, client_info=get_client_info("google-cloud-storage")
|
||||||
)
|
)
|
||||||
|
@ -18,7 +18,7 @@ class BSHTMLLoader(BaseLoader):
|
|||||||
bs_kwargs: Union[dict, None] = None,
|
bs_kwargs: Union[dict, None] = None,
|
||||||
get_text_separator: str = "",
|
get_text_separator: str = "",
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialise with path, and optionally, file encoding to use, and any kwargs
|
"""initialize with path, and optionally, file encoding to use, and any kwargs
|
||||||
to pass to the BeautifulSoup object.
|
to pass to the BeautifulSoup object.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -19,7 +19,7 @@ class MHTMLLoader(BaseLoader):
|
|||||||
bs_kwargs: Union[dict, None] = None,
|
bs_kwargs: Union[dict, None] = None,
|
||||||
get_text_separator: str = "",
|
get_text_separator: str = "",
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialise with path, and optionally, file encoding to use, and any kwargs
|
"""initialize with path, and optionally, file encoding to use, and any kwargs
|
||||||
to pass to the BeautifulSoup object.
|
to pass to the BeautifulSoup object.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -66,7 +66,7 @@ class RSpaceLoader(BaseLoader):
|
|||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Unable to initialise client - is url {self.url} or "
|
f"Unable to initialize client - is url {self.url} or "
|
||||||
f"api key correct?"
|
f"api key correct?"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class TencentCOSFileLoader(BaseLoader):
|
|||||||
"Please install it with `pip install cos-python-sdk-v5`."
|
"Please install it with `pip install cos-python-sdk-v5`."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Initialise a client
|
# initialize a client
|
||||||
client = CosS3Client(self.conf)
|
client = CosS3Client(self.conf)
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
file_path = f"{temp_dir}/{self.bucket}/{self.key}"
|
file_path = f"{temp_dir}/{self.bucket}/{self.key}"
|
||||||
|
@ -30,11 +30,11 @@ class EmbaasEmbeddings(BaseModel, Embeddings):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# Initialise with default model and instruction
|
# initialize with default model and instruction
|
||||||
from langchain_community.embeddings import EmbaasEmbeddings
|
from langchain_community.embeddings import EmbaasEmbeddings
|
||||||
emb = EmbaasEmbeddings()
|
emb = EmbaasEmbeddings()
|
||||||
|
|
||||||
# Initialise with custom model and instruction
|
# initialize with custom model and instruction
|
||||||
from langchain_community.embeddings import EmbaasEmbeddings
|
from langchain_community.embeddings import EmbaasEmbeddings
|
||||||
emb_model = "instructor-large"
|
emb_model = "instructor-large"
|
||||||
emb_inst = "Represent the Wikipedia document for retrieval"
|
emb_inst = "Represent the Wikipedia document for retrieval"
|
||||||
|
@ -36,7 +36,7 @@ class SemaDB(VectorStore):
|
|||||||
distance_strategy: DistanceStrategy = DistanceStrategy.EUCLIDEAN_DISTANCE,
|
distance_strategy: DistanceStrategy = DistanceStrategy.EUCLIDEAN_DISTANCE,
|
||||||
api_key: str = "",
|
api_key: str = "",
|
||||||
):
|
):
|
||||||
"""Initialise the SemaDB vector store."""
|
"""initialize the SemaDB vector store."""
|
||||||
self.collection_name = collection_name
|
self.collection_name = collection_name
|
||||||
self.vector_size = vector_size
|
self.vector_size = vector_size
|
||||||
self.api_key = api_key or get_from_env("api_key", "SEMADB_API_KEY")
|
self.api_key = api_key or get_from_env("api_key", "SEMADB_API_KEY")
|
||||||
|
@ -210,7 +210,7 @@ class AgentExecutorIterator:
|
|||||||
|
|
||||||
async def __aiter__(self) -> AsyncIterator[AddableDict]:
|
async def __aiter__(self) -> AsyncIterator[AddableDict]:
|
||||||
"""
|
"""
|
||||||
N.B. __aiter__ must be a normal method, so need to initialise async run manager
|
N.B. __aiter__ must be a normal method, so need to initialize async run manager
|
||||||
on first __anext__ call where we can await it
|
on first __anext__ call where we can await it
|
||||||
"""
|
"""
|
||||||
logger.debug("Initialising AgentExecutorIterator (async)")
|
logger.debug("Initialising AgentExecutorIterator (async)")
|
||||||
|
@ -10,7 +10,7 @@ Request parameters
|
|||||||
|
|
||||||
country | The 2-letter ISO 3166-1 code of the country you want to get headlines for. Possible options: ae ar at au be bg br ca ch cn co cu cz de eg fr gb gr hk hu id ie il in it jp kr lt lv ma mx my ng nl no nz ph pl pt ro rs ru sa se sg si sk th tr tw ua us ve za. Note: you can't mix this param with the sources param.
|
country | The 2-letter ISO 3166-1 code of the country you want to get headlines for. Possible options: ae ar at au be bg br ca ch cn co cu cz de eg fr gb gr hk hu id ie il in it jp kr lt lv ma mx my ng nl no nz ph pl pt ro rs ru sa se sg si sk th tr tw ua us ve za. Note: you can't mix this param with the sources param.
|
||||||
category | The category you want to get headlines for. Possible options: business entertainment general health science sports technology. Note: you can't mix this param with the sources param.
|
category | The category you want to get headlines for. Possible options: business entertainment general health science sports technology. Note: you can't mix this param with the sources param.
|
||||||
sources | A comma-seperated string of identifiers for the news sources or blogs you want headlines from. Use the /top-headlines/sources endpoint to locate these programmatically or look at the sources index. Note: you can't mix this param with the country or category params.
|
sources | A comma-separated string of identifiers for the news sources or blogs you want headlines from. Use the /top-headlines/sources endpoint to locate these programmatically or look at the sources index. Note: you can't mix this param with the country or category params.
|
||||||
q | Keywords or a phrase to search for.
|
q | Keywords or a phrase to search for.
|
||||||
pageSize | int | The number of results to return per page (request). 20 is the default, 100 is the maximum.
|
pageSize | int | The number of results to return per page (request). 20 is the default, 100 is the maximum.
|
||||||
page | int | Use this to page through the results if the total results found is greater than the page size.
|
page | int | Use this to page through the results if the total results found is greater than the page size.
|
||||||
|
@ -11,7 +11,7 @@ chain against specified criteria.
|
|||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
Using a pre-defined criterion:
|
Using a predefined criterion:
|
||||||
>>> from langchain.llms import OpenAI
|
>>> from langchain.llms import OpenAI
|
||||||
>>> from langchain.evaluation.criteria import CriteriaEvalChain
|
>>> from langchain.evaluation.criteria import CriteriaEvalChain
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Make sure to always enclose the YAML output in triple backticks (```)"""
|
|||||||
|
|
||||||
PANDAS_DATAFRAME_FORMAT_INSTRUCTIONS = """The output should be formatted as a string as the operation, followed by a colon, followed by the column or row to be queried on, followed by optional array parameters.
|
PANDAS_DATAFRAME_FORMAT_INSTRUCTIONS = """The output should be formatted as a string as the operation, followed by a colon, followed by the column or row to be queried on, followed by optional array parameters.
|
||||||
1. The column names are limited to the possible columns below.
|
1. The column names are limited to the possible columns below.
|
||||||
2. Arrays must either be a comma-seperated list of numbers formatted as [1,3,5], or it must be in range of numbers formatted as [0..4].
|
2. Arrays must either be a comma-separated list of numbers formatted as [1,3,5], or it must be in range of numbers formatted as [0..4].
|
||||||
3. Remember that arrays are optional and not necessarily required.
|
3. Remember that arrays are optional and not necessarily required.
|
||||||
4. If the column is not in the possible columns or the operation is not a valid Pandas DataFrame operation, return why it is invalid as a sentence starting with either "Invalid column" or "Invalid operation".
|
4. If the column is not in the possible columns or the operation is not a valid Pandas DataFrame operation, return why it is invalid as a sentence starting with either "Invalid column" or "Invalid operation".
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ def test_agent_iterator_failing_tool() -> None:
|
|||||||
|
|
||||||
agent_iter = agent.iter(inputs="when was langchain made")
|
agent_iter = agent.iter(inputs="when was langchain made")
|
||||||
assert isinstance(agent_iter, AgentExecutorIterator)
|
assert isinstance(agent_iter, AgentExecutorIterator)
|
||||||
# initialise iterator
|
# initialize iterator
|
||||||
iterator = iter(agent_iter)
|
iterator = iter(agent_iter)
|
||||||
|
|
||||||
with pytest.raises(ZeroDivisionError):
|
with pytest.raises(ZeroDivisionError):
|
||||||
|
Loading…
Reference in New Issue
Block a user