-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Let recipes use the model loaded in Chat #4840
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
Changes from all commits
aa438ce
0beffea
19d657a
694d3c4
b4e9ff6
8028495
754eb54
b351ffa
c83b3db
b3ae2dd
100ba0b
4c997e9
1b19db5
10f1fea
1259ebd
1cbc8a3
d21b077
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ import { | |
| Position, | ||
| useUpdateNodeInternals, | ||
| } from "@xyflow/react"; | ||
| import { type ReactElement, memo, useEffect } from "react"; | ||
| import { type ReactElement, memo, useEffect, useMemo } from "react"; | ||
| import { | ||
| MAX_NODE_WIDTH, | ||
| MAX_NOTE_NODE_WIDTH, | ||
|
|
@@ -287,6 +287,7 @@ function renderNodeBody( | |
| config: NodeConfig | undefined, | ||
| summary: string, | ||
| updateConfig: (id: string, patch: Partial<NodeConfig>) => void, | ||
| localProviderNames: Set<string>, | ||
| ): ReactElement { | ||
| if (config?.kind === "markdown_note") { | ||
| return <MarkdownPreview markdown={config.markdown} />; | ||
|
|
@@ -300,7 +301,13 @@ function renderNodeBody( | |
| return <InlineSampler config={config} onUpdate={onUpdate} />; | ||
| } | ||
| if (config.kind === "model_provider" || config.kind === "model_config") { | ||
| return <InlineModel config={config} onUpdate={onUpdate} />; | ||
| return ( | ||
| <InlineModel | ||
| config={config} | ||
| localProviderNames={localProviderNames} | ||
| onUpdate={onUpdate} | ||
| /> | ||
| ); | ||
| } | ||
| if (config.kind === "llm") { | ||
| return <InlineLlm config={config} onUpdate={onUpdate} />; | ||
|
|
@@ -355,6 +362,16 @@ function RecipeGraphNodeBase({ | |
| const config = useRecipeStudioStore((state) => state.configs[id]); | ||
| const openConfig = useRecipeStudioStore((state) => state.openConfig); | ||
| const updateConfig = useRecipeStudioStore((state) => state.updateConfig); | ||
| const allConfigs = useRecipeStudioStore((state) => state.configs); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This selector makes every Useful? React with 👍 / 👎. |
||
| const localProviderNames = useMemo(() => { | ||
| const names = new Set<string>(); | ||
| for (const cfg of Object.values(allConfigs)) { | ||
| if (cfg.kind === "model_provider" && cfg.is_local === true) { | ||
| names.add(cfg.name); | ||
| } | ||
| } | ||
| return names; | ||
| }, [allConfigs]); | ||
| const llmAuxVisible = useRecipeStudioStore( | ||
| (state) => state.llmAuxVisibility[id] ?? false, | ||
| ); | ||
|
|
@@ -418,7 +435,12 @@ function RecipeGraphNodeBase({ | |
| data.kind === "tool_config" || | ||
| data.kind === "validator"; | ||
| const summary = getConfigSummary(config); | ||
| const nodeBody = renderNodeBody(config, summary, updateConfig); | ||
| const nodeBody = renderNodeBody( | ||
| config, | ||
| summary, | ||
| updateConfig, | ||
| localProviderNames, | ||
| ); | ||
| const canShowLlmAux = | ||
| config?.kind === "llm" && | ||
| (Boolean(config.prompt.trim()) || | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation path only rewrites local providers to
endpoint="http://127.0.0.1", but it does not apply the same local-mode mutations used increate_job(JWT injection andskip_health_checkon linked model configs). Becausevalidate()still callsvalidate_recipe(recipe), local recipes that use placeholder model IDs like"local"can fail preflight model/provider checks during “Check recipe” even though the run path succeeds after_inject_local_providersmutates the payload.Useful? React with 👍 / 👎.