Skip to content

Commit

Permalink
Refactor schema loading to deal with race conditions, get rid of embe…
Browse files Browse the repository at this point in the history
…dding for now
  • Loading branch information
dqbd committed Nov 21, 2023
1 parent d4e7f36 commit 9f0b6a4
Show file tree
Hide file tree
Showing 14 changed files with 591 additions and 512 deletions.
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
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

0 comments on commit 9f0b6a4

Please sign in to comment.