-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Chain Runnables
Triggered when the chain(s) is selected -> ChainsAPI
(See Context below before proceeding)
Note: A configuration must now represent the chain runnable-attribute pairs as well as their specific configurable_params
I. Create a Configuration extraction engine
When a Chain is selected:
- Identifies all the Runnables (and the attribute names for those runnables) in the chain that are using "configurable_fields" or "configurable_alternatives" or "ConfigurableField" functions.
- Identifies the specific Fields/Constants(can be defined seperately in the beginning) defined for each Runnable in the chain that is using the functions above.
II. Change the select-chains endpoint in ChainsAPI
- POST
select-chainsendpoint: The user selects a chain. This triggers the engine in the backend which extracts the configuration mentioned above. - (POST) extracted configuration at the
Configurationsentity in the DB: The extracted config (with the default vals). See the newConfigurationsschema for the data to send.
Context
A chain can have multiple instances of the same Runnable type. For example:
# This model exposes only the temperature as configurable
model1 = ChatOpenAI(
model="gpt-4o-mini", temperature=0.5
).configurable_alternatives(
ConfigurableField(
id="llm",
name="LLM",
description=(
"Decide whether to use a high or a low temperature parameter for the LLM."
),
),
high_temp=ChatOpenAI(temperature=0.9),
low_temp=ChatOpenAI(temperature=0.1),
default_key="medium_temp",
)
# Similarly these "model2", "retrieval" and "ranking" runnables also have some specific params that should be exposed.
model2 = ....
retrieval = ....
ranking = ....
chain = prompt | model1 | retrieval | ranking | model2 | StrOutputParser()Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels