इसे छोड़कर कंटेंट पर जाएं
AggregaAggregaAggregaAggrega
भाषा चुने: हिन्दी
इस पेज का मशीन अनुवाद किया गया है। मूल अंग्रेज़ी पढ़ें।

Flowise चैटफ़्लो इम्पोर्ट करें

यह वॉकथ्रू Flowise से एक्सपोर्ट किए गए एक चैटफ़्लो — एक चैट मॉडल और एक मेमोरी वाली कन्वर्सेशन चेन — को एक Aggregate, एक Release और एक Manifest में इम्पोर्ट करता है, जो चैटफ़्लो को साथ लिए हुए Flowise को Docker Compose के लिए, जैसे वे लिखे गए हैं वैसे ही, बिल्ड करते हैं, फिर उन्हें बिल्ड करता है और परिणाम चलाता है। नीचे की हर फ़ाइल और आउटपुट का हर ब्लॉक एक वास्तविक रन से आता है; चैटफ़्लो और वॉकथ्रू का हर चरण import-flowise उदाहरण में है, जहाँ एक चेक स्क्रिप्ट इम्पोर्ट को फिर से चलाती है, वह जो लिखता है, जो प्रिंट करता है और यह पेज जिन ब्लॉकों को उद्धृत करता है, उनकी तुलना वहाँ रखी फ़ाइलों से करती है, और इम्पोर्ट द्वारा लिखी गई चीज़ों को वैलिडेट और बिल्ड करती है।

उदाहरण ड्राफ़्ट करें

आप यह इम्पोर्ट इस पेज के कमांडों से चला सकते हैं, या इसे अपने AI असिस्टेंट से चलवा सकते हैं।

उदाहरण को उसी के नाम वाले एक नए फ़ोल्डर में लिखें:

Terminal window
aggrega draft --example import-flowise

फिर यह आगे चलाने के लिए कमांड प्रिंट करता है। पहला कमांड नए फ़ोल्डर में ले जाता है; उसके बाद वाला, नीचे दिया गया, उसके source फ़ोल्डर में ले जाता है, जहाँ इम्पोर्ट चलता है। उस फ़ोल्डर में चैटफ़्लो फ़ाइल, support-chat.json, है, जिसका यह पेज उद्धरण देने के बजाय वर्णन करता है:

Terminal window
cd import-flowise

ड्राफ़्ट किए गए उदाहरण का source फ़ोल्डर Visual Studio Code में खुला है, जिसमें एक सपोर्ट चैट का Flowise चैटफ़्लो एक्सपोर्ट दिख रहा है, जो उसके ChatOpenAI नोड पर खुलता है।

चैटफ़्लो

support-chat.json, जो इस वॉकथ्रू के लिए उस आकार में लिखा गया है जिसमें Flowise का एडिटर किसी चैटफ़्लो को एक्सपोर्ट करता है, तीन नोड और उनके बीच के दो एज रखता है: gpt-4o-mini चुनने वाला एक ChatOpenAI नोड, एक Buffer Memory नोड, और एक Conversation Chain नोड जो दोनों को लेता है और एक छोटे सिस्टम संदेश के साथ उत्तर देता है। ChatOpenAI नोड कोई संग्रहीत क्रेडेंशियल नहीं चुनता और अपना Base Path खाली छोड़ता है, इसलिए जिस OpenAI क्लाइंट पर Flowise उसे चलाता है वह अपना पता और अपनी कुंजी Flowise के एनवायरनमेंट से पढ़ता है।

चैटफ़्लो के बगल में एक .aggrega-config.yaml फ़ोल्डर को वर्कस्पेस बनाती है:

# The workspace key marks this directory as the workspace root, so an import run
# here writes its drafts beside support-chat.json.
workspace: {}
# The registry the importer is fetched from the first time an import needs it.
default_registry: hub.aggrega.ai

और import-answers.yaml उन चीज़ों के उत्तर रखती है जिन्हें कोई चैटफ़्लो नहीं रख सकता। Flowise शुरू होते समय किसी फ़ाइल से कोई चैटफ़्लो लोड नहीं करता, इसलिए बिल्ड उसे Flowise के अपने API के माध्यम से एक ओनर खाते के अंतर्गत सीड करता है, और कोई एक्सपोर्ट उस खाते का नाम नहीं देता: उसका ईमेल वह एकमात्र उत्तर है जिसकी Docker Compose के लिए इम्पोर्ट को आवश्यकता है। Kubernetes के लिए इम्पोर्ट को हर सीक्रेट — ओनर का पासवर्ड और OpenAI कुंजी — रखने वाले Kubernetes Secret का नाम भी चाहिए, इसलिए फ़ाइल उन दो Secrets का नाम भी देती है (Kubernetes पर देखें):

# Values the import could not draft from the source, keyed by the drafted file and the key path inside
# it. Write each one beside its key; an import of the same source, and a sync, read them from here and
# ask nothing. A secret is never written here: its key asks where the secret comes from — a variable
# name, ${NAME}, or the name of a Kubernetes Secret.
release.yaml:
# Email address of the platform's owner account, read only when values.flow_definition is set. The
# step that seeds the chatflow registers this account when the instance has no owner yet, which makes
# it the owner, and signs in as it; on an instance that already has one, it names an account allowed
# to import chatflows, and the password attached to the owner_password slot is that account's.
# Required when values.flow_definition is set: the build halts when it is empty. It has no default.
spec.components.flowise.infra.owner_email: "owner@example.com"
# The origin of the secret value, written by the operator in the Release. Read exactly as
# values.origin is. Write it here or in values.origin, never in both. A secret: name where it comes
# from, never the value.
spec.components.flowise.features.owner_password.infra.origin: "flowise-owner"
# The origin of the secret value, written by the operator in the Release. Read exactly as
# values.origin is. Write it here or in values.origin, never in both. A secret: name where it comes
# from, never the value.
spec.components.flowise.uses.model.chatopenai-0.features.credential.infra.origin: "openai-api-key"

owner@example.com आपके अपने किसी ईमेल के स्थान पर है। फ़ाइल के बिना, किसी टर्मिनल पर इम्पोर्ट हर मान के लिए पूछता है, एक समय में एक प्रश्न, जिसकी शब्दावली उसकी कुंजी के ऊपर के विवरण से ली जाती है, और आपके उत्तरों को एक नई उत्तर फ़ाइल में लिखता है; जहाँ कुछ भी नहीं पूछा जा सकता, वहाँ यह उस फ़ाइल को कुंजियों और खाली उत्तरों के साथ लिखता है, उन्हें सूचीबद्ध करता है, और स्टेटस 1 के साथ बाहर निकलता है। इम्पोर्ट उत्तर फ़ाइल फ़ाइल का पूरा वर्णन करती है।

इम्पोर्ट हर नोड को वर्कस्पेस के कैटलॉग के Components के सामने तौलता है, और --target उसके Recipes से एक Manifest ड्राफ़्ट करता है। वर्कस्पेस किसी कैटलॉग फ़ोल्डर का नाम नहीं देता, इसलिए इम्पोर्ट स्टैंडर्ड लाइब्रेरी का कैटलॉग उसी रजिस्ट्री से पढ़ता है जिससे वह अपना इम्पोर्टर लाता है: प्रकाशित कैटलॉग का एक हस्ताक्षरित स्नैपशॉट, जिसे पहला इम्पोर्ट लाता है, सत्यापित करता है और वर्कस्पेस के कंटेंट कैश में रखता है, और जिसका नाम उसके डाइजेस्ट से उस रिकॉर्ड में दिया जाता है जिसे इम्पोर्ट अपने ड्राफ़्ट के बगल में लिखता है। जो वर्कस्पेस अपने स्वयं के कैटलॉग फ़ोल्डरों का नाम देता है — AGGREGA_CATALOG_DIRS में, या workspace.catalog_dirs के अंतर्गत — वह इसके बजाय उनके विरुद्ध इम्पोर्ट करता है। source में जाएँ:

Terminal window
cd source

इम्पोर्ट चलाएं

Terminal window
aggrega import support-chat.json --target compose

स्टैंडर्ड आउटपुट पर यह सूची देता है कि इसने क्या लिखा:

wrote aggregate.yaml
wrote release.yaml
wrote manifest.yaml
wrote .aggrega-import.json

स्टैंडर्ड एरर पर, जहाँ <workspace> उस फ़ोल्डर के स्थान पर है जिसमें आपने इसे चलाया:

[… omitted: a warning that the importer runs unverified, printed where its module is read from beside its Plugin entity in a catalog folder rather than fetched]
read as the flowise format, with drafted paths relative to <workspace>
warn: node chatOpenAI_0 reaches chatopenai-0 through the model connection chatopenai-0 of core/ai-agent/flowise: its Base Path is empty, so the OpenAI client Flowise runs it on reads the address the platform delivers for this connection, OPENAI_BASE_URL, and, since it selects no credential, the key delivered as OPENAI_API_KEY
info: the answers file <workspace>/import-answers.yaml also answers spec.components.flowise.features.owner_password.infra.origin in release.yaml, spec.components.flowise.uses.model.chatopenai-0.features.credential.infra.origin in release.yaml, which these drafts do not leave empty; those answers are kept there and not applied
mapped chatOpenAI_0 (chatOpenAI) to core/ai-model/openai as a reference, HIGH at 0.9
made no choice for bufferMemory_0 (bufferMemory)
made no choice for conversationChain_0 (conversationChain)
warning: node "flowise" (provider "compose"): artifact "flowise-flow/flowise-flow.yaml": skipped provenance label injection — the fragment declares no compose service. Compose carries build provenance as service labels, so a fragment contributing only top-level networks, volumes or configs carries none; the services this component emits elsewhere carry the full set.
Pull complete: <workspace>/release.lock (entities=8, source_artifacts=0, external_inputs=0)

एडिटर से चलाया गया इम्पोर्ट: ड्राफ़्ट किए गए Aggregate, Release और Manifest चैटफ़्लो एक्सपोर्ट के बगल में दिखते हैं, Aggrega आउटपुट सूची देता है कि हर नोड कैसे मैप किया गया और कौन-सी फ़ाइलें लिखी गईं, और एक नोटिफ़िकेशन बताता है कि इम्पोर्ट ने 3 फ़ाइलें ड्राफ़्ट कीं, जिन्हें flowise के रूप में पहचाना गया।

  • mapped पंक्ति बताती है कि ChatOpenAI नोड स्टैंडर्ड लाइब्रेरी का OpenAI मॉडल, core/ai-model/openai, बन गया, जिसे ड्राफ़्ट करने के बजाय संदर्भित किया गया, क्योंकि उसने उच्च स्तर में, 0.9 पर, मैच किया: एक अलग घटक, जो प्लेटफ़ॉर्म के model सॉकेट से वायर किया गया है।
  • warn पंक्ति बताती है कि चैटफ़्लो उस मॉडल तक कैसे पहुँचता है: नोड वह पता और कुंजी पढ़ता है जिन्हें प्लेटफ़ॉर्म मॉडल कनेक्शन के लिए पहुँचाता है, इसलिए Release जिस कुंजी को कनेक्शन से अटैच करता है, वही कुंजी चैटफ़्लो उपयोग करता है।
  • info पंक्ति उत्तर फ़ाइल के बारे में है। उसने ओनर के ईमेल का उत्तर दिया, जिसे ड्राफ़्ट ने खाली छोड़ा था; उसके दो Secret नाम उसका उत्तर देते हैं जो केवल Kubernetes के लिए इम्पोर्ट खाली छोड़ता है, इसलिए वे फ़ाइल में रहते हैं, यहाँ अप्रयुक्त।
  • made no choice पंक्तियाँ बताती हैं कि मेमोरी और चेन चैटफ़्लो के अंदर ही रहते हैं: प्लेटफ़ॉर्म का कोई सॉकेट उन्हें नहीं लेता।
  • अंतिम दो पंक्तियाँ पुल हैं। हर मान का उत्तर मिल जाने पर, इम्पोर्ट ने ड्राफ़्ट किए गए Release की निर्भरताएँ पुल कीं, जैसे aggrega pull करता है, और release.lock लिखी; नीचे के बिल्ड को और कुछ नहीं चाहिए। warning पंक्ति वह है जिसे बिल्ड भी प्रिंट करता है, और वैलिडेट और बिल्ड करें उसे समझाता है।

यह क्या लिखता है

Aggregate, Release और Manifest का नाम imported/support-chat रखा जाता है, फ़ाइल, support-chat.json, के अनुसार, क्योंकि Flowise एक्सपोर्ट का अपना कोई नाम नहीं होता, उस नेमस्पेस के अंतर्गत जिसे इम्पोर्टर की target_namespace सेटिंग निर्धारित करती है, जो imported है जब तक आप कोई दूसरा निर्धारित न करें (सेटिंग्स)।

aggregate.yaml — स्टैंडर्ड लाइब्रेरी के Flowise प्लेटफ़ॉर्म, core/ai-agent/flowise, का एक इंस्टेंस, जो चैटफ़्लो को वैसे ही ले जाता है जैसे वह एक्सपोर्ट किया गया था, जिसका अधिकांश भाग यहाँ छोड़ दिया गया है, और उसके model सॉकेट से वायर किया गया मॉडल:

apiVersion: aggrega.ai/v1beta1
kind: Aggregate
metadata:
name: imported/support-chat
version: 0.1.0
description: Draft Aggregate imported from a source in the flowise format.
spec:
components:
flowise:
type: core/ai-agent/flowise
features:
# For the compose target, the lines below declare owner_password on flowise: a secret the Release alone attaches arrives under the key value, so each is declared with a key of its own and no two arrive under one; the Release attaches its origin, naming this type or none.
owner_password:
type: core/secret-value
values:
key: OWNER_PASSWORD
values:
# chatflow_id is derived from the exported flow, which gives no identifier of its own.
chatflow_id: '40d9f5c5-5187-54c1-a9f5-a8dac92f88bb'
flow_definition: |
{
"nodes": [
[… omitted: the chatflow's nodes, as exported, up to the Conversation Chain's inputs]
"inputs": {
"model": "{{"{{"}}chatOpenAI_0.data.instance}}",
"memory": "{{"{{"}}bufferMemory_0.data.instance}}",
[… omitted: the rest of the chatflow, as exported]
}
uses:
model:
chatopenai-0:
target: chatopenai-0
# For the compose target, the lines below declare credential on chatopenai-0: a secret the Release alone attaches arrives under the key value, so each is declared with a key of its own and no two arrive under one; the Release attaches its origin, naming this type or none.
features:
credential:
type: core/secret-value
values:
key: OPENAI_API_KEY
# swap to core/ai-model/azure-openai (score 0.4000) by setting type: core/ai-model/azure-openai
chatopenai-0:
type: core/ai-model/openai
values:
model: |-
gpt-4o-mini
  • मॉडल core/ai-model/openai है, उस मॉडल के साथ जिसे नोड चुनता है, gpt-4o-mini। उसके ऊपर की टिप्पणी कैटलॉग के एक दूसरे Component का नाम उसके स्कोर के साथ देती है, जिससे नोड मिलता-जुलता है।
  • दोनों सीक्रेट — उस ओनर खाते का पासवर्ड जिसके अंतर्गत चैटफ़्लो सीड किया जाता है, और वह OpenAI कुंजी जिसे प्लेटफ़ॉर्म मॉडल को प्रस्तुत करता है — यहाँ उस वेरिएबल के साथ घोषित किए जाते हैं जिसके अंतर्गत हर एक Flowise के एनवायरनमेंट में पहुँचता है, OWNER_PASSWORD और OPENAI_API_KEY। Docker Compose पर, जो सीक्रेट केवल Release अटैच करता, वह कुंजी value के अंतर्गत पहुँचता, और दोनों टकरा जाते; यहाँ घोषित होने पर, हर एक की अपनी कुंजी होती है। Release बताता है कि हर एक कहाँ से आता है।
  • chatflow_id चैटफ़्लो से व्युत्पन्न होता है, क्योंकि Flowise के एडिटर से हुए एक्सपोर्ट का अपना कोई पहचानकर्ता नहीं होता, इसलिए एक चैटफ़्लो से हमेशा एक ही पहचानकर्ता बनता है। Flowise चैटफ़्लो दो नोड के बीच हर कनेक्शन के लिए {{<node id>.data.instance}} लिखता है, और किसी Aggregate का टेक्स्ट एक टेम्पलेट के रूप में पढ़ा जाता है, इसलिए ड्राफ़्ट हर {{ को {{"{{"}} के रूप में लिखता है, जिसे बिल्ड वापस दो ब्रेस में बदल देता है।

release.yaml — Release, जो Aggregate को Manifest के साथ डिप्लॉय करता है:

apiVersion: aggrega.ai/v1beta1
kind: Release
metadata:
name: imported/support-chat
# environment is a drafted default, since no source names the environment this Release deploys to; change it to name the one it deploys to.
environment: development
version: 0.1.0
description: Draft Release imported from a source in the flowise format.
spec:
aggregate: imported/support-chat
manifest: imported/support-chat
components:
flowise:
infra:
# The image running core/ai-agent/flowise, at the version this importer drafts, which the catalog's Recipes for it are known to run; the import does not raise or lower it to follow the source.
image: "flowiseai/flowise:3.1.3"
# Left for the Release, since the source cannot supply it: infra.owner_email, the email address of the platform's owner account, required while values.flow_definition is set
owner_email: "owner@example.com"
# Published on this machine's loopback address, 127.0.0.1: reachable from this machine only, by any process running on it. Delete this line to keep the service internal.
published_port: 3000
features:
owner_password:
type: core/secret-value
infra:
# Attached by reference, never as a value: the owner account's password, required while values.flow_definition is set, read from the variable FLOWISE_OWNER_PASSWORD, which a target substituting variable references, as Docker Compose does when the stack starts, reads from the environment, so no file carries the value.
origin: "${FLOWISE_OWNER_PASSWORD}"
uses:
model:
chatopenai-0:
features:
credential:
type: core/secret-value
infra:
# Attached by reference, never as a value: the credential flowise presents to chatopenai-0 on its model connection, read from the variable OPENAI_API_KEY, which a target substituting variable references, as Docker Compose does when the stack starts, reads from the environment, so no file carries the value.
origin: "${OPENAI_API_KEY}"
chatopenai-0: {}
  • environment development है, एक डिफ़ॉल्ट जिसे, उसके ऊपर की टिप्पणी के अनुसार, उस एनवायरनमेंट में बदलना है जिसमें Release डिप्लॉय होता है।
  • इमेज Flowise 3.1.3 है, वह संस्करण जिसे Flowise के लिए कैटलॉग के Recipes चलाते हैं।
  • published_port 3000 है, वह पोर्ट जिस पर Flowise सेवा देता है, इसलिए वह आपकी मशीन पर http://127.0.0.1:3000 पर उत्तर देता है। जैसा उसकी टिप्पणी कहती है, इस मशीन का कोई भी प्रोसेस वहाँ उस तक पहुँच सकता है और कोई और नहीं पहुँच सकता; Flowise को केवल स्टैक के नेटवर्क पर रखने के लिए पंक्ति हटा दें।
  • owner_email उत्तर फ़ाइल से आया उत्तर है। उसके ऊपर की टिप्पणी बताती है कि इम्पोर्ट उसे ड्राफ़्ट क्यों नहीं कर सका।
  • दोनों सीक्रेट वेरिएबल संदर्भ हैं, ${FLOWISE_OWNER_PASSWORD} और ${OPENAI_API_KEY}, जिन्हें Docker Compose स्टैक शुरू होने पर आपके शेल से भरता है, इसलिए कोई फ़ाइल दोनों में से कोई मान नहीं रखती।

manifest.yaml — प्लेटफ़ॉर्म और मॉडल के Compose Recipes, और वह रियलाइज़ेशन जो किसी सीक्रेट के वेरिएबल संदर्भ को Compose फ़ाइल में जैसा लिखा है वैसा ही लिखता है:

apiVersion: aggrega.ai/v1beta1
kind: Manifest
metadata:
name: imported/support-chat
version: 0.1.0
spec:
mappings:
components:
type:
core/ai-agent/flowise: compose/flowise
core/ai-model/openai: compose/openai
features:
type:
core/secret-value: compose/dotenv-secret

.aggrega-import.json इस बात का रिकॉर्ड है कि इम्पोर्ट ने क्या लिखा, जिसे बाद में कोई aggrega import --sync पढ़ता है, और release.lock हर उस कैटलॉग एंटिटी को, संस्करण और डाइजेस्ट के साथ, पिन करती है जिस पर Release रिज़ॉल्व होता है।

वैलिडेट और बिल्ड करें

Terminal window
aggrega validate --release release.yaml
aggrega build --release release.yaml

वैलिडेट करने के बाद एडिटर में खुला ड्राफ़्ट किया गया Release, जिसमें Aggrega आउटपुट और एक नोटिफ़िकेशन दोनों बताते हैं कि कोई समस्या नहीं मिली।

ड्राफ़्ट किए गए Release का बिल्ड: Explorer में एक dist फ़ोल्डर दिखता है, Aggrega आउटपुट लिखी गई Docker Compose फ़ाइल की सूची देता है, और एक नोटिफ़िकेशन बताता है कि 1 फ़ाइल लिखी गई।

वैलिडेशन प्रिंट करता है:

notice: LINT: Feature "core/secret-value" at core/secret-value:1.0.0 declares property "origin" in both values: and infra: pillars (path: origin)
release dependency validation passed: release.yaml (schema-pillar + dependency pillars)

और बिल्ड, जहाँ <workspace> उस फ़ोल्डर के स्थान पर है जिसमें ड्राफ़्ट हैं:

warning: node "flowise" (provider "compose"): artifact "flowise-flow/flowise-flow.yaml": skipped provenance label injection — the fragment declares no compose service. Compose carries build provenance as service labels, so a fragment contributing only top-level networks, volumes or configs carries none; the services this component emits elsewhere carry the full set.
notice: LINT: Feature "core/secret-value" at core/secret-value:1.0.0 declares property "origin" in both values: and infra: pillars (path: origin)
[… omitted: a total build time, which differs per run]
Build completed: 1 file written to <workspace>/dist

warning पंक्ति Compose फ़ाइल के उस भाग के बारे में है जो चैटफ़्लो रखता है, एक शीर्ष-स्तरीय configs प्रविष्टि, जिसके पास ऐसी कोई सेवा नहीं है जिस पर बिल्ड के लेबल लगाए जा सकें। notice पंक्ति सलाहकारी है: सीक्रेट Feature अपना origin Aggregate के values से या Release के infra से स्वीकार करता है, और नोटिस बताता है कि एक लीफ़ दोनों में घोषित है। दोनों में से कोई भी निर्णय नहीं बदलती।

dist/compose/docker-compose.yaml में दो सेवाएँ हैं। स्वयं Flowise:

flowise:
image: flowiseai/flowise:3.1.3
environment:
DATABASE_PATH: /home/node/.flowise
SECRETKEY_PATH: /home/node/.flowise
OPENAI_BASE_URL: https://api.openai.com/v1
OPENAI_API_KEY: ${OPENAI_API_KEY}
ports:
- 127.0.0.1:3000:3000
[… omitted: the labels the build writes on every service, naming the Aggregate, the component, the environment and the compiler's version]
volumes:
- type: volume
source: flowise--data
target: /home/node
networks:
- compose
[… omitted: the service's health check]

और वह सेवा जो Flowise के स्वस्थ होने की सूचना देते ही चैटफ़्लो को सीड करती है, फिर बाहर निकल जाती है:

flowise-flow-seed:
image: flowiseai/flowise:3.1.3
entrypoint:
- node
- /seed/seed.js
environment:
FLOWISE_URL: http://127.0.0.1:3000
OWNER_EMAIL: owner@example.com
OWNER_PASSWORD: ${FLOWISE_OWNER_PASSWORD}
CHATFLOW_ID: 40d9f5c5-5187-54c1-a9f5-a8dac92f88bb
CHATFLOW_NAME: 40d9f5c5-5187-54c1-a9f5-a8dac92f88bb
[… omitted: the labels the build writes on every service]
network_mode: service:flowise
depends_on:
flowise:
condition: service_healthy
restart: "no"
configs:
- source: flowise-flow
target: /seed/flow.json
- source: flowise-flow-seed
target: /seed/seed.js

यह किसी नए Flowise पर ओनर खाता पंजीकृत करती है, या उसके रूप में साइन इन करती है, और चैटफ़्लो को chatflow_id पर लिखती है। कुंजी और पासवर्ड वेरिएबल संदर्भ हैं, जो स्टैक शुरू होने पर आपके शेल से भरे जाते हैं। Flowise का Compose Recipe आपकी मशीन पर कोई पोर्ट केवल तभी प्रकाशित करता है जब Release Flowise के infra में published_port सेट करता है, और तब भी केवल लूपबैक पते, 127.0.0.1, पर; इसके बिना, सेवा तक केवल स्टैक के नेटवर्क पर पहुँचा जाता है।

AI असिस्टेंट के साथ

Aggrega के टूल के साथ सेट अप किया गया AI असिस्टेंट भी यही कर सकता है: यह प्रॉम्प्ट उसमें पेस्ट करें।

केवल Aggrega टूल का उपयोग करें, और स्वयं कोई फ़ोल्डर न बनाएं। यदि Workspace फ़ोल्डर में अभी कोई `import-flowise` फ़ोल्डर नहीं है, तो `draft` टूल को एक बार कॉल करें, `example` को `import-flowise` पर सेट करके और बिना `dir` के: यह उदाहरण को एक नए `import-flowise` फ़ोल्डर में लिखता है, जिसके `source` फ़ोल्डर में वह है जिसे यह पेज इम्पोर्ट करता है। फिर `import` टूल को कॉल करें, `workspace_root` को `import-flowise/source` पर, `source` को `support-chat.json` पर और `target` को `compose` पर सेट करके: यह जिन उत्तरों की आवश्यकता है उन्हें `support-chat.json` के बगल में `import-answers.yaml` से पढ़ता है, अपने ड्राफ़्ट `import-flowise/source` में लिखता है और जो उन्हें चाहिए उसे पुल करता है। फिर `validate` टूल को कॉल करें, `workspace_root` को `import-flowise/source` पर और `release` को `release.yaml` पर सेट करके, और `build` टूल को, `workspace_root` को `import-flowise/source` पर, `release` को `release.yaml` पर और `write` को true पर सेट करके। मुझे बताएं कि बिल्ड ने कौन-सी फ़ाइलें लिखीं; वे `import-flowise/source/dist/` के अंतर्गत हैं।

इसे VS Code में खोलें

Visual Studio Code के लिए Aggrega एक्सटेंशन इंस्टॉल होने पर, VS Code में फ़ोल्डर import-flowise/source खोलें, जहाँ इम्पोर्ट ने अपने ड्राफ़्ट लिखे। फ़ोल्डर में एक Release है, ड्राफ़्ट किया गया release.yaml, इसलिए एडिटर उसे आपके लिए चुन लेता है, और जब आप ड्राफ़्ट संपादित करते हैं तो वह उन्हें उस Release के विरुद्ध जाँचता है, और जो कुछ उसे मिलता है उसे फ़ाइल में और Problems पैनल में चिह्नित करता है। कमांड पैलेट में Aggrega: Show topology graph Release के घटकों और उनके बीच के कनेक्शनों को बनाता है। Aggrega: Build, Aggrega: Preview build और Aggrega: Pull उसी Release पर काम करते हैं, और हर एक एक्टिविटी बार में Aggrega व्यू के Commands पैनल पर एक बटन भी है; Build अपनी फ़ाइलें फ़ोल्डर के dist/ में लिखता है। बाकी सब Visual Studio Code में Aggrega का उपयोग करें में है।

इसे चलाएं

कुंजी और ओनर का पासवर्ड अपने शेल में सेट करें, Flowise शुरू करें, फिर सीड चलाएं:

Terminal window
export OPENAI_API_KEY='your OpenAI key'
export FLOWISE_OWNER_PASSWORD='a password of your own'
docker compose -p support-chat -f dist/compose/docker-compose.yaml up -d --wait flowise
docker compose -p support-chat -f dist/compose/docker-compose.yaml up flowise-flow-seed

-p प्रोजेक्ट का नाम देता है, जैसा इम्पोर्ट कैसे चलता है का रन चरण बताता है। --wait Flowise के स्वस्थ होने की सूचना देते ही लौट आता है; यह केवल flowise का नाम देता है क्योंकि यह बाहर निकल चुके किसी भी कंटेनर को विफलता मानता है, और सीड डिज़ाइन के अनुसार बाहर निकलता है। दूसरा कमांड सीड चलाता है, उसका लॉग प्रिंट करता है और उसके बाहर निकलने पर लौट आता है:

flowise-flow-seed-1 | registered the owner account owner@example.com
flowise-flow-seed-1 | imported chatflow 40d9f5c5-5187-54c1-a9f5-a8dac92f88bb as "40d9f5c5-5187-54c1-a9f5-a8dac92f88bb"
flowise-flow-seed-1 exited with code 0

जहाँ आपकी मशीन पर कोई दूसरा प्रोग्राम पहले से 127.0.0.1:3000 पर सुन रहा है, वहाँ पहला कमांड failed to bind host port 127.0.0.1:3000/tcp: address already in use के साथ रुक जाता है: published_port को किसी खाली पोर्ट पर सेट करें और फिर से बिल्ड करें। नीचे के रन ने यही किया, 3002 के साथ, और 3000 के स्थान पर उस पोर्ट का उपयोग किया।

इसे जाँचें

http://127.0.0.1:3000 खोलें, वह पता जिसे published_port प्रकाशित करता है, और ओनर के ईमेल और पासवर्ड से साइन इन करें: सीड का चैटफ़्लो Flowise में है।

जो चैटफ़्लो अपनी कोई API कुंजी सेट नहीं करता, वह अपने प्रेडिक्शन एंडपॉइंट का उत्तर बिना कुंजी के देता है। उससे एक प्रश्न पूछें:

Terminal window
curl -sS -X POST http://127.0.0.1:3000/api/v1/prediction/40d9f5c5-5187-54c1-a9f5-a8dac92f88bb \
-H 'Content-Type: application/json' -d '{"question": "In one short sentence: what is Docker Compose?"}'

रन ने OpenAI कुंजी के लिए एक प्लेसहोल्डर का उपयोग किया, इसलिए उत्तर OpenAI द्वारा उसका अस्वीकार है, जो दिखाता है कि चैटफ़्लो मॉडल को कॉल करने तक चला:

{"statusCode":500,"success":false,"message":"401 Unauthorized – check your API key and ensure it has access to the requested model.","stack":{}}

आपकी कुंजी के साथ, जवाब text पर उत्तर रखता है।

Kubernetes पर, जब Kubernetes पर में वर्णित बिल्ड लागू हो चुका हो और उसका सीड Job पूरा हो चुका हो, तो जिस नेमस्पेस में आपने लागू किया उसमें Flowise की Service, flowise-default, पर एक लोकल पोर्ट फ़ॉरवर्ड करें, और कमांड को चलता छोड़ दें:

Terminal window
kubectl port-forward -n <namespace> svc/flowise-default 3000:3000

किसी दूसरे टर्मिनल से, ऊपर का प्रश्न चैटफ़्लो तक उसी पते पर, बिना बदले, पहुँचता है; रन को प्लेसहोल्डर कुंजी का वही अस्वीकार मिला।

नीचे के कमांड से स्टैक रोकें। -v Flowise का डेटा वॉल्यूम भी हटाता है, और उसके साथ ओनर खाता और वह चैटफ़्लो भी जिसे सीड ने लिखा था:

Terminal window
docker compose -p support-chat -f dist/compose/docker-compose.yaml down -v

Kubernetes पर

वही चैटफ़्लो helm लक्ष्य के साथ Kubernetes के लिए इम्पोर्ट होता है। Docker Compose के लिए ड्राफ़्ट पहले से source में हैं, और इम्पोर्ट वहाँ किसी Aggregate को कभी अधिलेखित नहीं करता, इसलिए इन्हें --output-dir के साथ एक अलग फ़ोल्डर में ड्राफ़्ट करें, फिर उसी से वैलिडेट और बिल्ड करें:

Terminal window
aggrega import support-chat.json --target helm --output-dir helm
cd helm
aggrega validate --release release.yaml
aggrega build --release release.yaml

ड्राफ़्ट वहीं भिन्न होते हैं जहाँ लक्ष्य भिन्न होता है। Manifest प्लेटफ़ॉर्म को helm/flowise पर, मॉडल को helm/openai पर, और हर सीक्रेट को helm/k8s-existing-secret पर मैप करता है, जो उसे नेमस्पेस में पहले से मौजूद किसी Secret से पढ़ता है। Release ओनर के पासवर्ड और OpenAI कुंजी को core/referenced-secret के रूप में अटैच करता है, हर एक अपने Secret का नाम देते हुए, और तीनों उत्तर उत्तर फ़ाइल से लेता है: ओनर का ईमेल, flowise-owner और openai-api-key।

बिल्ड सामान्य Kubernetes मैनिफ़ेस्ट वर्कस्पेस रूट, source, पर dist/helm/ के अंतर्गत लिखता है, जो helm से ../dist/helm/ है, और उनमें चैटफ़्लो का सीड एक Job के रूप में है। जिस नेमस्पेस में आप लागू करते हैं उसमें दोनों Secrets बनाएं, हर एक अपना मान डेटा कुंजी value के अंतर्गत रखे, फिर फ़ोल्डर को वैसे लागू करें जैसा इम्पोर्ट कैसे चलता है का रन चरण बताता है।