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

Fix race conditions of defaults and schemas #251

Merged
merged 2 commits into from
Nov 21, 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
23 changes: 22 additions & 1 deletion examples/configurable_chain/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,28 @@


###############################################################################
# EXAMPLE 2: Configure fields based on Request metadata #
# EXAMPLE 2: Configure prompt based on RunnableConfig #
###############################################################################
configurable_prompt = PromptTemplate.from_template(
"tell me a joke about {topic}."
).configurable_alternatives(
ConfigurableField(
id="prompt",
name="Prompt",
description="The prompt to use. Must contain {topic}.",
),
default_key="joke",
fact=PromptTemplate.from_template(
"tell me a fact about {topic} in {language} language."
),
)
prompt_chain = configurable_prompt | model | StrOutputParser()

add_routes(app, prompt_chain, path="/configurable_prompt")


###############################################################################
# EXAMPLE 3: Configure fields based on Request metadata #
###############################################################################


Expand Down
247 changes: 0 additions & 247 deletions langserve/playground/dist/assets/index-32c8d712.js

This file was deleted.

255 changes: 255 additions & 0 deletions langserve/playground/dist/assets/index-849f2582.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions langserve/playground/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" href="/____LANGSERVE_BASE_URL/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Playground</title>
<script type="module" crossorigin src="/____LANGSERVE_BASE_URL/assets/index-32c8d712.js"></script>
<link rel="stylesheet" href="/____LANGSERVE_BASE_URL/assets/index-c6cde0dd.css">
<script type="module" crossorigin src="/____LANGSERVE_BASE_URL/assets/index-849f2582.js"></script>
<link rel="stylesheet" href="/____LANGSERVE_BASE_URL/assets/index-8968db79.css">
</head>
<body>
<div id="root"></div>
Expand Down
1 change: 1 addition & 0 deletions langserve/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"lz-string": "^1.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"swr": "^2.2.4",
"tailwind-merge": "^1.14.0",
"use-debounce": "^9.0.4",
"vaul": "^0.7.3"
Expand Down
Loading