Skip to content

Commit

Permalink
Use black to lint notebooks and docs for now. (langchain-ai#12679)
Browse files Browse the repository at this point in the history
Due to langchain-ai#12677 having lots of errors for the time being.
  • Loading branch information
obi1kenobi committed Oct 31, 2023
1 parent bd668fc commit f7f35a9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ spell_fix:

lint:
poetry run ruff docs templates cookbook
poetry run ruff format docs templates cookbook --diff
poetry run black docs templates cookbook --diff

format format_diff:
poetry run ruff format docs templates cookbook
poetry run black docs templates cookbook
poetry run ruff --select I --fix docs templates cookbook

######################
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ nbdoc = "^0.0.82"

[tool.poetry.group.lint.dependencies]
ruff = "^0.1.3"
black = { version = "23.10.1", extras = ["jupyter"] }

[tool.poetry.group.codespell.dependencies]
codespell = "^2.2.0"
Expand Down
5 changes: 3 additions & 2 deletions templates/chat-bot-feedback/chat_bot_feedback/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ def format_chat_history(chain_input: dict) -> dict:
# if you update the name of this, you MUST also update ../pyproject.toml
# with the new `tool.langserve.export_attr`
chain = (
(format_chat_history | _prompt | _model | StrOutputParser())
.with_types(input_type=ChainInput)
(format_chat_history | _prompt | _model | StrOutputParser()).with_types(
input_type=ChainInput
)
# This is to add the evaluators as "listeners"
# and to customize the name of the chain.
# Any chain that accepts a compatible input type works here.
Expand Down

0 comments on commit f7f35a9

Please sign in to comment.