Skip to content

Commit

Permalink
Template Readmes and Standardization (langchain-ai#12819)
Browse files Browse the repository at this point in the history
Co-authored-by: Erick Friis <[email protected]>
  • Loading branch information
hwchase17 and efriis authored Nov 3, 2023
1 parent 6c23771 commit 83cee2c
Show file tree
Hide file tree
Showing 116 changed files with 14,938 additions and 5,862 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
from langchain.schema.runnable import ConfigurableField

from .chain import chain
from .retriever_agent import executor

final_chain = chain.configurable_alternatives(
ConfigurableField(id="chain"),
default_key="response",
# This adds a new option, with name `openai` that is equal to `ChatOpenAI()`
retrieve=executor,
)
__all__ = ["chain"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from langchain.prompts import ChatPromptTemplate
from langchain.pydantic_v1 import BaseModel
from langchain.schema.output_parser import StrOutputParser
from langchain.schema.runnable import ConfigurableField

from .prompts import answer_prompt
from .retriever_agent import executor
Expand All @@ -25,3 +26,10 @@ class Inputs(BaseModel):


chain = chain.with_types(input_type=Inputs)

chain = chain.configurable_alternatives(
ConfigurableField(id="chain"),
default_key="response",
# This adds a new option, with name `openai` that is equal to `ChatOpenAI()`
retrieve=executor,
)
467 changes: 333 additions & 134 deletions templates/anthropic-iterative-search/poetry.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion templates/anthropic-iterative-search/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ langchain = ">=0.0.325"
anthropic = "^0.5.0"
wikipedia = "^1.4.0"

[tool.poetry.group.dev.dependencies]
langchain-cli = {extras = ["serve"], version = "^0.0.13"}

[tool.langserve]
export_module = "anthropic_iterative_search"
export_attr = "final_chain"
export_attr = "chain"

[build-system]
requires = [
Expand Down
506 changes: 372 additions & 134 deletions templates/cassandra-entomology-rag/poetry.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions templates/cassandra-entomology-rag/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ openai = "^0.28.1"
tiktoken = "^0.5.1"
cassio = "^0.1.3"

[tool.poetry.group.dev.dependencies]
langchain-cli = ">=0.0.15"

[tool.langserve]
export_module = "cassandra_entomology_rag"
export_attr = "chain"
Expand Down
506 changes: 372 additions & 134 deletions templates/cassandra-synonym-caching/poetry.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions templates/cassandra-synonym-caching/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ openai = "^0.28.1"
tiktoken = "^0.5.1"
cassio = "^0.1.3"

[tool.poetry.group.dev.dependencies]
langchain-cli = ">=0.0.15"

[tool.langserve]
export_module = "cassandra_synonym_caching"
export_attr = "chain"
Expand Down
279 changes: 129 additions & 150 deletions templates/chat-bot-feedback/poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions templates/chat-bot-feedback/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[tool.poetry]
name = "chat_bot_feedback"
name = "chat-bot-feedback"
version = "0.0.1"
description = ""
authors = []
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = ">=0.0.325"
langchain = ">=0.0.329"
openai = "^0.28.1"
langsmith = ">=0.0.54"
langchainhub = ">=0.1.13"

[tool.poetry.group.dev.dependencies]
langchain-cli = ">=0.0.4"
langchain-cli = ">=0.0.15"
fastapi = "^0.104.0"
sse-starlette = "^1.6.5"

Expand Down
2 changes: 1 addition & 1 deletion templates/csv-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ langchain app add csv-agent

And add the following code to your `server.py` file:
```python
from csv_agent.agent import chain as csv_agent_chain
from csv_agent.agent import agent_executor as csv_agent_chain

add_routes(app, csv_agent_chain, path="/csv-agent")
```
Expand Down
3 changes: 3 additions & 0 deletions templates/csv-agent/csv_agent/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from csv_agent.agent import agent_executor

__all__ = ["agent_executor"]
Loading

0 comments on commit 83cee2c

Please sign in to comment.