Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples #239

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions examples/configurable_chain/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@
)
chain = prompt | model | StrOutputParser()

# Add routes requires you to specify which config keys are accepted
# specifically, you must accept `configurable` as a config key.
add_routes(app, chain, path="/configurable_temp", config_keys=["configurable"])
add_routes(app, chain, path="/configurable_temp")


###############################################################################
Expand Down Expand Up @@ -96,7 +94,6 @@ def fetch_api_key_from_header(config: Dict[str, Any], req: Request) -> Dict[str,
app,
dynamic_auth_chain,
path="/auth_from_header",
config_keys=["configurable"],
per_req_config_modifier=fetch_api_key_from_header,
)

Expand Down
2 changes: 1 addition & 1 deletion examples/conversational_retrieval_chain/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from langchain.schema.output_parser import StrOutputParser
from langchain.schema.runnable import RunnableMap, RunnablePassthrough
from langchain.vectorstores import FAISS
from pydantic.v1 import BaseModel, Field

from langserve import add_routes
from langserve.pydantic_v1 import BaseModel, Field

_TEMPLATE = """Given the following conversation and a follow up question, rephrase the
follow up question to be a standalone question, in its original language.
Expand Down