Changed code to show how it is used.
This commit is contained in:
parent
eb0883231b
commit
aeb7b91446
1 changed files with 15 additions and 11 deletions
|
|
@ -397,16 +397,20 @@ export function getWidgetCode(flow: FlowType, tabsState?: TabsState): string {
|
||||||
const flowName = flow.name;
|
const flowName = flow.name;
|
||||||
const inputs = buildInputs(tabsState, flow.id);
|
const inputs = buildInputs(tabsState, flow.id);
|
||||||
|
|
||||||
return `<script src="https://cdn.jsdelivr.net/gh/logspace-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"></script>
|
return `<!-- Insert this code anywhere in your <body> tag. To use with react, check our docs. -->
|
||||||
|
|
||||||
<langflow-chat window_title="${flowName}"
|
<script src="https://cdn.jsdelivr.net/gh/logspace-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"></script>
|
||||||
flow_id="${flowId}"
|
<langflow-chat
|
||||||
${
|
window_title="${flowName}"
|
||||||
tabsState[flow.id] && tabsState[flow.id].formKeysData
|
flow_id="${flowId}"
|
||||||
? `chat_inputs='${inputs}'
|
${
|
||||||
chat_input_field="${Object.keys(tabsState[flow.id].formKeysData.input_keys)[0]}"
|
tabsState[flow.id] && tabsState[flow.id].formKeysData
|
||||||
`
|
? `chat_inputs='${inputs}'
|
||||||
: ""
|
chat_input_field="${
|
||||||
}host_url="http://localhost:7860"
|
Object.keys(tabsState[flow.id].formKeysData.input_keys)[0]
|
||||||
|
}"
|
||||||
|
`
|
||||||
|
: ""
|
||||||
|
}host_url="http://localhost:7860"
|
||||||
></langflow-chat>`;
|
></langflow-chat>`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue