Skip to content

Commit

Permalink
fix: correct spelling mistakes of "seperate, intialise, pre-defined" (l…
Browse files Browse the repository at this point in the history
…angchain-ai#14647)

fix spellings

**seperate -> separate**: found more occurrences, see
langchain-ai#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?
  • Loading branch information
rancomp authored Dec 22, 2023
1 parent 86d27fd commit c3f8733
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cookbook/Multi_modal_RAG.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"\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",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"id": "2d98412d-fc53-42c1-aed8-f1f8eb9ada58",
"metadata": {},
"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",
"A template may include instructions, few-shot examples, and specific context and\n",
"questions appropriate for a given task.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def load(self) -> List[Document]:
"Please install it with `pip install google-cloud-storage`."
)

# Initialise a client
# initialize a client
storage_client = storage.Client(
self.project_name, client_info=get_client_info("google-cloud-storage")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(
bs_kwargs: Union[dict, None] = None,
get_text_separator: str = "",
) -> 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.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(
bs_kwargs: Union[dict, None] = None,
get_text_separator: str = "",
) -> 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.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _create_rspace_client(self) -> Any:

except 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?"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def lazy_load(self) -> Iterator[Document]:
"Please install it with `pip install cos-python-sdk-v5`."
)

# Initialise a client
# initialize a client
client = CosS3Client(self.conf)
with tempfile.TemporaryDirectory() as temp_dir:
file_path = f"{temp_dir}/{self.bucket}/{self.key}"
Expand Down
4 changes: 2 additions & 2 deletions libs/community/langchain_community/embeddings/embaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class EmbaasEmbeddings(BaseModel, Embeddings):
Example:
.. code-block:: python
# Initialise with default model and instruction
# initialize with default model and instruction
from langchain_community.embeddings import EmbaasEmbeddings
emb = EmbaasEmbeddings()
# Initialise with custom model and instruction
# initialize with custom model and instruction
from langchain_community.embeddings import EmbaasEmbeddings
emb_model = "instructor-large"
emb_inst = "Represent the Wikipedia document for retrieval"
Expand Down
2 changes: 1 addition & 1 deletion libs/community/langchain_community/vectorstores/semadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
distance_strategy: DistanceStrategy = DistanceStrategy.EUCLIDEAN_DISTANCE,
api_key: str = "",
):
"""Initialise the SemaDB vector store."""
"""initialize the SemaDB vector store."""
self.collection_name = collection_name
self.vector_size = vector_size
self.api_key = api_key or get_from_env("api_key", "SEMADB_API_KEY")
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain/langchain/agents/agent_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __iter__(self: "AgentExecutorIterator") -> Iterator[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
"""
logger.debug("Initialising AgentExecutorIterator (async)")
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain/langchain/chains/api/news_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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.
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.
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.
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain/langchain/evaluation/criteria/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Examples
--------
Using a pre-defined criterion:
Using a predefined criterion:
>>> from langchain.llms import OpenAI
>>> from langchain.evaluation.criteria import CriteriaEvalChain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

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.
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.
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".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def test_agent_iterator_failing_tool() -> None:

agent_iter = agent.iter(inputs="when was langchain made")
assert isinstance(agent_iter, AgentExecutorIterator)
# initialise iterator
# initialize iterator
iterator = iter(agent_iter)

with pytest.raises(ZeroDivisionError):
Expand Down

0 comments on commit c3f8733

Please sign in to comment.