एक Langflow फ़्लो इम्पोर्ट करें
यह वॉकथ्रू Langflow से एक्सपोर्ट किए गए एक फ़्लो को — Basic Prompting, वह स्टार्टर प्रोजेक्ट जो Langflow 1.6.0 के साथ आता है — एक Aggregate, एक Release और एक Manifest में इम्पोर्ट करता है, जो जैसे लिखे गए हैं वैसे ही, Docker Compose के लिए फ़्लो वहन करने वाले Langflow को बिल्ड करते हैं, फिर उन्हें बिल्ड करता है और परिणाम को चलाता है। नीचे की हर फ़ाइल और आउटपुट का हर ब्लॉक एक वास्तविक रन से आता है; फ़्लो और वॉकथ्रू का हर चरण import-langflow उदाहरण में है, जहाँ एक जाँच स्क्रिप्ट इम्पोर्ट को फिर से चलाती है, वह जो लिखता है, जो प्रिंट करता है और इस पेज में उद्धृत ब्लॉकों की तुलना वहाँ रखी फ़ाइलों से करती है, और इम्पोर्ट ने जो लिखा उसे वैलिडेट और बिल्ड करती है।
उदाहरण ड्राफ़्ट करें
आप यह इम्पोर्ट इस पेज के कमांडों से चला सकते हैं, या इसे अपने AI असिस्टेंट से चलवा सकते हैं।
उदाहरण को उसी के नाम वाले एक नए फ़ोल्डर में लिखें:
aggrega draft --example import-langflowइसके बाद वह आगे चलाने के लिए कमांड प्रिंट करता है। पहला कमांड नए फ़ोल्डर में ले जाता है; उसके बाद वाला, नीचे, उसके source फ़ोल्डर में ले जाता है, जहाँ इम्पोर्ट चलता है। उस फ़ोल्डर में फ़्लो फ़ाइल basic-prompting.json है, जिसका यह पेज उद्धरण देने के बजाय वर्णन करता है:
cd import-langflow
फ़्लो
Basic Prompting चार नोड्स को श्रृंखला में जोड़ता है: एक Chat Input, एक Prompt, एक Language Model जो OpenAI के gpt-4.1 को कॉल करता है, और एक Chat Output। जैसा Langflow इसे देता है, यह एक JSON फ़ाइल है, basic-prompting.json, लगभग 54 KB की, जो फ़्लो के साथ-साथ हर घटक का सोर्स कोड भी वहन करती है। इसका Language Model नोड अपनी कुंजी ग्लोबल वेरिएबल OPENAI_API_KEY से पढ़ता है, जिसे Langflow अपने एनवायरनमेंट से पढ़ता है जहाँ उस नाम का कोई वेरिएबल संग्रहीत नहीं होता।
फ़्लो के बगल में, एक .aggrega-config.yaml फ़ोल्डर को वर्कस्पेस बनाता है:
# The workspace key marks this directory as the workspace root, so an import run# here writes its drafts beside basic-prompting.json.workspace: {}# The registry the importer is fetched from the first time an import needs it.default_registry: hub.aggrega.aiऔर import-answers.yaml उन चीज़ों के उत्तर रखती है जिन्हें कोई फ़्लो नहीं रख सकता। Docker Compose के लिए इम्पोर्ट को इनमें से किसी की ज़रूरत नहीं होती: वह हर सीक्रेट को एक वेरिएबल संदर्भ से अटैच करता है जिसे Docker Compose आपके शेल से भरता है। Kubernetes के लिए इम्पोर्ट हर सीक्रेट को एक 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: # 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.langflow.features.admin_password.infra.origin: "langflow-admin" # 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.langflow.uses.model.languagemodelcomponent-kboja.features.credential.infra.origin: "openai-api-key"हर उत्तर किसी Secret का नाम है, कभी स्वयं सीक्रेट नहीं, इसलिए फ़ाइल को फ़्लो के साथ रखा जा सकता है। इम्पोर्ट उत्तर फ़ाइल फ़ाइल का पूरा वर्णन करती है।
इम्पोर्ट हर नोड को वर्कस्पेस के कैटलॉग के Components के सामने तौलता है, और --target उसके Recipes से एक Manifest ड्राफ़्ट करता है। वर्कस्पेस किसी कैटलॉग फ़ोल्डर का नाम नहीं देता, इसलिए इम्पोर्ट स्टैंडर्ड लाइब्रेरी का कैटलॉग उसी रजिस्ट्री से पढ़ता है जिससे वह अपना इम्पोर्टर लाता है: प्रकाशित कैटलॉग का एक हस्ताक्षरित स्नैपशॉट, जिसे पहला इम्पोर्ट लाता है, सत्यापित करता है और वर्कस्पेस के कंटेंट कैश में रखता है, और जिसका नाम उसके डाइजेस्ट से उस रिकॉर्ड में दिया जाता है जिसे इम्पोर्ट अपने ड्राफ़्ट के बगल में लिखता है। जो वर्कस्पेस अपने स्वयं के कैटलॉग फ़ोल्डरों का नाम देता है — AGGREGA_CATALOG_DIRS में, या workspace.catalog_dirs के अंतर्गत — वह इसके बजाय उनके विरुद्ध इम्पोर्ट करता है। source में जाएँ:
cd sourceइम्पोर्ट चलाएं
aggrega import basic-prompting.json --target composeस्टैंडर्ड आउटपुट पर यह सूची देता है कि इसने क्या लिखा:
wrote aggregate.yamlwrote release.yamlwrote manifest.yamlwrote .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 langflow format, with drafted paths relative to <workspace>warn: the flow is carried in values.flow_definition with the handles of all 3 of its edges written as Langflow's editor writes them — the same handles, their keys in order with no space between them — since the editor compares an edge's handles with the ones it writes for the nodes the edge joins, character for character, when it opens the flow, and drops every edge whose handles differwarn: node LanguageModelComponent-kBOja reaches languagemodelcomponent-kboja through the model connection languagemodelcomponent-kboja of core/ai-agent/langflow: its field api_key names the variable OPENAI_API_KEY, which the platform delivers for this connection and Langflow reads as a global variable; no field of it gives its API's address, so the OpenAI client it runs takes OPENAI_BASE_URL, the address the platform delivers for this connection, from the environmentmade no choice for ChatInput-SzjnT (ChatInput)made no choice for Prompt-tOH5D (Prompt)made no choice for ChatOutput-8ZWWB (ChatOutput)mapped LanguageModelComponent-kBOja (LanguageModelComponent) to core/ai-model/openai as a reference, HIGH at 0.9 warning: node "langflow" (provider "compose"): artifact "langflow-flow/langflow-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)
mappedपंक्ति बताती है कि Language Model नोड क्या बना: स्टैंडर्ड लाइब्रेरी का OpenAI मॉडल,core/ai-model/openai, जिसका ड्राफ़्ट करने के बजाय संदर्भ दिया गया, क्योंकि वह उच्च स्तर में, 0.9 पर, मैच हुआ। यह अपने आप में एक अलग घटक है, जो प्लेटफ़ॉर्म केmodelसॉकेट से वायर किया गया है। डिफ़ॉल्ट रूप से ड्राफ़्ट पूरे फ़्लो को उस प्लेटफ़ॉर्म पर चलाता है जो Langflow चलाता है, और अलग घटक केवल उस नोड को देता है जिसे उस प्लेटफ़ॉर्म का कोई सॉकेट लेता है — एक मॉडल, एक टूल, एक वेक्टर स्टोर — जहाँ नोड को वैसा पहचाना जाता है।- पहली
warnपंक्ति बताती है कि फ़्लो को हर एज के हैंडल उसी तरह लिखकर वहन किया जाता है जैसे Langflow का एडिटर उन्हें लिखता है। Langflow अपने स्टार्टर प्रोजेक्ट्स में किसी एज के हैंडल के हर कोलन और कॉमा के बाद एक स्पेस रखता है; उसका एडिटर, कोई फ़्लो खोलते समय, हर उस एज को हटा देता है जिसके हैंडल ठीक वैसे नहीं लिखे हैं जैसे वह उन्हें लिखता है, फिर फ़्लो को उसके बिना सहेज देता है। इस तरह लिखे जाने पर, फ़्लो अपने तीन कनेक्शनों के साथ खुलता है, और उन्हीं के साथ चलता है। - नोड का नाम देने वाली
warnपंक्ति बताती है कि फ़्लो उस मॉडल तक कैसे पहुँचता है। नोड अपनी कुंजी वेरिएबलOPENAI_API_KEYसे पढ़ता है, और अपना पताOPENAI_BASE_URLसे, और प्लेटफ़ॉर्म मॉडल कनेक्शन के लिए दोनों देता है, इसलिए फ़्लो में किसी संपादन की ज़रूरत नहीं होती। made no choiceपंक्तियाँ उन नोड्स के नाम देती हैं जिन्हें प्लेटफ़ॉर्म का कोई सॉकेट नहीं लेता: वे फ़्लो के भीतर रहते हैं, जिसे Langflow एक्सपोर्ट किए गए रूप में ही चलाता है।- अंतिम दो पंक्तियाँ पुल हैं। उत्तर देने के लिए कुछ नहीं बचा था, इसलिए इम्पोर्ट ने ड्राफ़्ट किए गए Release की डिपेंडेंसी पुल कीं, जैसा
aggrega pullकरता है, औरrelease.lockलिखी; नीचे के बिल्ड को और कुछ नहीं चाहिए।warningपंक्ति ऐसी है जिसे बिल्ड भी प्रिंट करता है, और वैलिडेट और बिल्ड करें उसे समझाता है।
उत्तर फ़ाइल दो ऐसे Secrets के नाम देती है जिनके बारे में यह इम्पोर्ट नहीं पूछता: यह उनके लिए कुछ भी खाली नहीं छोड़ता, इसलिए यह दोनों में से किसी को लागू नहीं करता और फ़ाइल को जैसी है वैसी छोड़ देता है।
यह क्या लिखता है
Aggregate, Release और Manifest का नाम imported/basic-prompting रखा जाता है, फ़्लो के अपने नाम, Basic Prompting, के आधार पर, जिसे घटाकर basic-prompting किया जाता है — बिना नाम वाले फ़्लो का नाम उसकी फ़ाइल के नाम पर रखा जाता है — उस नेमस्पेस के अंतर्गत जिसे इम्पोर्टर की target_namespace सेटिंग तय करती है, जो imported है जब तक आप कोई और सेट न करें (सेटिंग्स)।
aggregate.yaml — स्टैंडर्ड लाइब्रेरी के Langflow प्लेटफ़ॉर्म, core/ai-agent/langflow, का एक इंस्टेंस, जो फ़्लो को वैसे ही वहन करता है जैसे वह एक्सपोर्ट किया गया था, सिवाय उसके एज के हैंडल के, जो वैसे लिखे गए हैं जैसे Langflow का एडिटर उन्हें लिखता है, और जिसकी एक हज़ार से अधिक पंक्तियाँ यहाँ छोड़ दी गई हैं, और वह मॉडल जिस तक वह पहुँचता है:
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: imported/basic-prompting version: 0.1.0 description: Draft Aggregate imported from a source in the langflow format.spec: components: langflow: type: core/ai-agent/langflow features: # For the compose target, the lines below declare admin_password on langflow: 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. admin_password: type: core/secret-value values: key: LANGFLOW_SUPERUSER_PASSWORD values: flow_id: '0dbee653-41ae-4e51-af2e-55757fb24be3' flow_definition: |- { "data": { "edges": [ [… omitted: the rest of the flow] } uses: model: languagemodelcomponent-kboja: target: languagemodelcomponent-kboja # For the compose target, the lines below declare credential on languagemodelcomponent-kboja: 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 languagemodelcomponent-kboja: type: core/ai-model/openai values: model: |- gpt-4.1- मॉडल
core/ai-model/openaiहै, उस मॉडल के साथ जिसे फ़्लो का नोड चुनता है,gpt-4.1। उसके ऊपर की टिप्पणी कैटलॉग के एक अन्य Component का नाम देती है जिससे नोड मिलता-जुलता है, उसके स्कोर के साथ, उस पाठक के लिए जो वह चाहता है। - दो सीक्रेट — एडमिनिस्ट्रेटर का पासवर्ड जो Langflow का एडिटर माँगता है, और OpenAI कुंजी जिसे प्लेटफ़ॉर्म मॉडल के सामने प्रस्तुत करता है — यहाँ उस वेरिएबल के साथ घोषित किए गए हैं जिसके अंतर्गत हर एक Langflow के एनवायरनमेंट में पहुँचता है,
LANGFLOW_SUPERUSER_PASSWORDऔरOPENAI_API_KEY। Docker Compose पर, केवल Release द्वारा अटैच किया गया सीक्रेटvalueकुंजी के अंतर्गत पहुँचता, और दोनों आपस में टकरा जाते; यहाँ घोषित होने से हर एक की अपनी अलग कुंजी होती है। Release बताता है कि हर एक कहाँ से आता है। flow_idवह पहचानकर्ता है जो एक्सपोर्ट फ़्लो को देता है।
release.yaml — Release, जो Aggregate को Manifest के साथ डिप्लॉय करता है:
apiVersion: aggrega.ai/v1beta1kind: Releasemetadata: name: imported/basic-prompting # 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 langflow format.spec: aggregate: imported/basic-prompting manifest: imported/basic-prompting components: langflow: infra: # The image running core/ai-agent/langflow, 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. The source states version "1.5.0" of the platform. image: "langflowai/langflow:1.6.0" # 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: 7860 features: admin_password: type: core/secret-value infra: # Attached by reference, never as a value: the administrator's password, read while values.require_authentication stays true, read from the variable LANGFLOW_ADMIN_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: "${LANGFLOW_ADMIN_PASSWORD}" uses: model: languagemodelcomponent-kboja: features: credential: type: core/secret-value infra: # Attached by reference, never as a value: the credential langflow presents to languagemodelcomponent-kboja 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}" languagemodelcomponent-kboja: {}environmentdevelopmentहै, एक डिफ़ॉल्ट जिसे, उसके ऊपर की टिप्पणी के अनुसार, उस एनवायरनमेंट में बदलना है जिसमें Release डिप्लॉय होता है।- इमेज Langflow 1.6.0 है, वह संस्करण जिसे कैटलॉग के Langflow के लिए Recipes चलाते हैं। जैसा कि टिप्पणी कहती है, फ़्लो को आख़िरी बार Langflow 1.5.0 पर परखा गया था; इम्पोर्ट फ़्लो के संस्करण का अनुसरण करने के बजाय वह संस्करण रखता है जिसे Recipes चलाते हैं।
published_port7860 है, वह पोर्ट जिस पर Langflow सर्व करता है, इसलिए एडिटर आपकी मशीन परhttp://127.0.0.1:7860पर उत्तर देता है। जैसा कि उसकी टिप्पणी कहती है, इस मशीन की कोई भी प्रोसेस वहाँ उस तक पहुँच सकती है और कोई अन्य नहीं; Langflow को केवल स्टैक के नेटवर्क पर रखने के लिए यह पंक्ति हटा दें।- दो सीक्रेट वेरिएबल संदर्भ हैं,
${LANGFLOW_ADMIN_PASSWORD}और${OPENAI_API_KEY}, जिन्हें Docker Compose स्टैक शुरू होने पर आपके शेल से भरता है, इसलिए कोई भी फ़ाइल दोनों में से कोई मान नहीं रखती।
manifest.yaml — प्लेटफ़ॉर्म और मॉडल के Compose Recipes, और वह रियलाइज़ेशन जो किसी सीक्रेट के वेरिएबल संदर्भ को Compose फ़ाइल में जैसा लिखा है वैसा ही लिखता है:
apiVersion: aggrega.ai/v1beta1kind: Manifestmetadata: name: imported/basic-prompting version: 0.1.0spec: mappings: components: type: core/ai-agent/langflow: compose/langflow core/ai-model/openai: compose/openai features: type: core/secret-value: compose/dotenv-secret.aggrega-import.json इस बात का रिकॉर्ड है कि इम्पोर्ट ने क्या लिखा, जिसे बाद में कोई aggrega import --sync पढ़ता है, और release.lock हर उस कैटलॉग एंटिटी को, संस्करण और डाइजेस्ट के साथ, पिन करती है जिस पर Release रिज़ॉल्व होता है।
वैलिडेट और बिल्ड करें
aggrega validate --release release.yamlaggrega build --release release.yaml

वैलिडेशन प्रिंट करता है:
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 "langflow" (provider "compose"): artifact "langflow-flow/langflow-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>/distwarning पंक्ति Compose फ़ाइल के उस हिस्से के बारे में है जो फ़्लो को वहन करता है, एक टॉप-लेवल configs प्रविष्टि, जिसके पास बिल्ड के लेबल लगाने के लिए कोई सेवा नहीं है। notice पंक्ति सलाहकारी है: सीक्रेट Feature अपना origin Aggregate के values से या Release के infra से स्वीकार करता है, और नोटिस बताता है कि एक लीफ़ दोनों में घोषित है। दोनों में से कोई भी निर्णय नहीं बदलता।
dist/compose/docker-compose.yaml में Langflow और एक सेवा है जो उससे पहले एक बार चलती है:
services: langflow: image: langflowai/langflow:1.6.0 environment: LANGFLOW_CONFIG_DIR: /app/langflow LANGFLOW_SAVE_DB_IN_CONFIG_DIR: "true" LANGFLOW_AUTO_LOGIN: "false" LANGFLOW_SUPERUSER: admin LANGFLOW_SUPERUSER_PASSWORD: ${LANGFLOW_ADMIN_PASSWORD} OPENAI_BASE_URL: https://api.openai.com/v1 OPENAI_API_KEY: ${OPENAI_API_KEY} LANGFLOW_LOAD_FLOWS_PATH: /app/flows ports: - 127.0.0.1:7860:7860 [… 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: langflow--data target: /app/langflow networks: - compose depends_on: langflow--data-owner: condition: service_completed_successfully [… omitted: the service's health check] configs: - source: langflow-flow target: /app/flows/flow.json langflow--data-owner: image: langflowai/langflow:1.6.0 entrypoint: - chown - "1000:0" - /app/langflow [… omitted: the labels the build writes on every service] volumes: - type: volume source: langflow--data target: /app/langflow networks: - compose restart: "no" user: "0"फ़्लो Langflow तक /app/flows/flow.json के रूप में पहुँचता है, एक configs प्रविष्टि से जिसमें वह फ़्लो है जिसे Aggregate वहन करता है, और Langflow उसे हर शुरुआत पर LANGFLOW_LOAD_FLOWS_PATH से लोड करता है। कुंजी और पासवर्ड वेरिएबल संदर्भ हैं, जो स्टैक शुरू होने पर आपके शेल से भरे जाते हैं। Langflow का Compose Recipe आपकी मशीन पर पोर्ट केवल वहीं प्रकाशित करता है जहाँ Release Langflow के infra में published_port सेट करता है, और तब भी केवल लूपबैक पते, 127.0.0.1, पर; इसके बिना, सेवा तक केवल स्टैक के नेटवर्क पर पहुँचा जाता है।
langflow--data-owner Langflow की इमेज को root के रूप में चलाता है, डेटा वॉल्यूम को उपयोगकर्ता 1000, समूह 0 को सौंपता है, जो वह आइडेंटिटी है जिसके रूप में Langflow की इमेज चलती है, और बाहर निकल जाता है। इसके पूरा होने पर Langflow शुरू होता है: Docker वॉल्यूम को root के स्वामित्व में बनाता है, और अन्यथा Langflow वहाँ अपना डेटा नहीं लिख पाता।
AI असिस्टेंट के साथ
Aggrega के टूल के साथ सेट अप किया गया AI असिस्टेंट भी यही कर सकता है: यह प्रॉम्प्ट उसमें पेस्ट करें।
केवल Aggrega टूल का उपयोग करें, और स्वयं कोई फ़ोल्डर न बनाएं। यदि Workspace फ़ोल्डर में अभी कोई `import-langflow` फ़ोल्डर नहीं है, तो `draft` टूल को एक बार कॉल करें, `example` को `import-langflow` पर सेट करके और बिना `dir` के: यह उदाहरण को एक नए `import-langflow` फ़ोल्डर में लिखता है, जिसका `source` फ़ोल्डर वह रखता है जिसे यह पेज इम्पोर्ट करता है। फिर `import` टूल को कॉल करें, `workspace_root` को `import-langflow/source` पर, `source` को `basic-prompting.json` पर और `target` को `compose` पर सेट करके: यह जिन उत्तरों की उसे ज़रूरत है उन्हें `basic-prompting.json` के बगल में `import-answers.yaml` से पढ़ता है, अपने ड्राफ़्ट `import-langflow/source` में लिखता है और उनकी ज़रूरत की चीज़ें पुल करता है। फिर `validate` टूल को कॉल करें, `workspace_root` को `import-langflow/source` पर और `release` को `release.yaml` पर सेट करके, और `build` टूल को, `workspace_root` को `import-langflow/source` पर, `release` को `release.yaml` पर और `write` को true पर सेट करके। मुझे बताएं कि बिल्ड ने कौन-सी फ़ाइलें लिखीं; वे `import-langflow/source/dist/` के अंतर्गत हैं।इसे VS Code में खोलें
Visual Studio Code के लिए Aggrega एक्सटेंशन इंस्टॉल होने पर, VS Code में import-langflow/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 का उपयोग करें में है।
इसे चलाएं
अपने शेल में कुंजी और एडमिनिस्ट्रेटर का पासवर्ड सेट करें, फिर स्टैक शुरू करें:
export OPENAI_API_KEY='your OpenAI key'export LANGFLOW_ADMIN_PASSWORD='a password of your own'docker compose -p basic-prompting -f dist/compose/docker-compose.yaml up -d --wait-p प्रोजेक्ट का नाम देता है, जैसा कि इम्पोर्ट कैसे चलता है का रन चरण समझाता है। --wait तब लौटता है जब langflow--data-owner पूरा हो चुका होता है और Langflow स्वस्थ होने की सूचना देता है।
इसे जाँचें
http://127.0.0.1:7860 खोलें, वह पता जिसे published_port प्रकाशित करता है, और आपके द्वारा सेट किए गए पासवर्ड के साथ admin के रूप में साइन इन करें: Basic Prompting एडिटर में अपने तीन कनेक्शनों के साथ मौजूद है।
Langflow अपने API के ज़रिए कोई फ़्लो केवल एक API कुंजी के लिए चलाता है, जिसे एडमिनिस्ट्रेटर साइन इन करने के बाद बनाता है। साइन इन करें:
curl -sS -X POST http://127.0.0.1:7860/api/v1/login \ -d username=admin --data-urlencode "password=$LANGFLOW_ADMIN_PASSWORD"{"access_token":"[… omitted: the access token]","refresh_token":"[… omitted: the refresh token]","token_type":"bearer"}एक्सेस टोकन से एक कुंजी बनाएं:
curl -sS -X POST http://127.0.0.1:7860/api/v1/api_key/ \ -H 'Authorization: Bearer <access_token>' -H 'Content-Type: application/json' -d '{"name": "test-it"}'{"name":"test-it","last_used_at":null,"total_uses":0,"is_active":true,"id":"[… omitted: the key's identifier]","api_key":"[… omitted: the key]","user_id":"[… omitted: the owner's identifier]"}और कुंजी के साथ फ़्लो चलाएं:
curl -sS -X POST 'http://127.0.0.1:7860/api/v1/run/0dbee653-41ae-4e51-af2e-55757fb24be3?stream=false' \ -H 'x-api-key: <api_key>' -H 'Content-Type: application/json' \ -d '{"input_value": "In one short sentence: what is Docker Compose?", "input_type": "chat", "output_type": "chat"}'रन में OpenAI कुंजी के लिए एक प्लेसहोल्डर का उपयोग हुआ, इसलिए उत्तर OpenAI द्वारा कुंजी का अस्वीकरण है, जो दिखाता है कि फ़्लो मॉडल को कॉल करने तक चला:
{"detail":"{\"message\":\"Error running graph: Error building Component Language Model: \\n\\nError code: 401 - {'error': {'message': 'Incorrect API key provided: sk-place*****************-key. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'code': 'invalid_api_key', 'param': None}, 'status': 401}\",[… omitted: three empty fields, and a suggestion to update three of the flow's components]}"}आपकी कुंजी के साथ, उत्तर में मॉडल का जवाब outputs[0].outputs[0].results.message.text पर होता है।
Kubernetes पर, Kubernetes पर में वर्णित बिल्ड लागू होने के बाद, जिस नेमस्पेस में आपने लागू किया उसमें Langflow की Service, langflow-default, पर एक लोकल पोर्ट फ़ॉरवर्ड करें, और कमांड को चलता छोड़ दें:
kubectl port-forward -n <namespace> svc/langflow-default 7860:7860दूसरे टर्मिनल से, ऊपर के तीनों अनुरोध उसी पते पर, बिना बदलाव के, Langflow तक पहुँचते हैं; रन को प्लेसहोल्डर कुंजी का वही अस्वीकरण मिला।
नीचे दिए गए कमांड से स्टैक रोकें। -v Langflow का डेटा वॉल्यूम भी हटा देता है, और उसके साथ एडमिनिस्ट्रेटर का खाता, API कुंजी और फ़्लो का रन इतिहास:
docker compose -p basic-prompting -f dist/compose/docker-compose.yaml down -vKubernetes पर
यही फ़्लो helm टार्गेट के साथ Kubernetes के लिए इम्पोर्ट होता है। Docker Compose के लिए ड्राफ़्ट पहले से source में हैं, और इम्पोर्ट वहाँ किसी Aggregate को कभी अधिलेखित नहीं करता, इसलिए इन्हें --output-dir के साथ एक अलग फ़ोल्डर में ड्राफ़्ट करें, फिर उसी से वैलिडेट और बिल्ड करें:
aggrega import basic-prompting.json --target helm --output-dir helmcd helmaggrega validate --release release.yamlaggrega build --release release.yamlड्राफ़्ट वहीं भिन्न होते हैं जहाँ टार्गेट भिन्न होता है। Manifest प्लेटफ़ॉर्म को helm/langflow से, मॉडल को helm/openai से, और हर सीक्रेट को helm/k8s-existing-secret से मैप करता है, जो उसे नेमस्पेस में पहले से मौजूद एक Secret से पढ़ता है। Release दोनों सीक्रेट को core/referenced-secret के रूप में अटैच करता है, हर एक उस Secret का नाम देता है, और ये नाम वही हैं जो उत्तर फ़ाइल में हैं:
features: admin_password: type: core/referenced-secret infra: # Left for the Release, since the source cannot supply it: the name of a Kubernetes Secret already in the namespace holding, under the data key value, the administrator's password, read while values.require_authentication stays true. origin: "langflow-admin"उत्तर फ़ाइल के बिना, इम्पोर्ट टर्मिनल पर दोनों नाम पूछता है और आपके उत्तर एक नई उत्तर फ़ाइल में लिखता है। जहाँ कुछ भी पूछा नहीं जा सकता, वहाँ वह उस फ़ाइल को दोनों कुंजियों और खाली उत्तरों के साथ लिखता है, और स्टेटस 1 और इस पंक्ति के साथ समाप्त होता है, जिसमें <workspace> उस फ़ोल्डर के स्थान पर है जिसमें आपने इसे चलाया:
2 values the drafts leave empty are still owed, listed in the answers file <workspace>/import-answers.yaml: write each beside its key there, then run the import againबिल्ड सादे Kubernetes मैनिफ़ेस्ट वर्कस्पेस रूट, source, पर dist/helm/ के अंतर्गत लिखता है, जो helm से ../dist/helm/ है। जिस नेमस्पेस में आप लागू करते हैं उसमें दोनों Secrets बनाएं, हर एक अपना मान डेटा कुंजी value के अंतर्गत रखे, फिर फ़ोल्डर को वैसे लागू करें जैसा इम्पोर्ट कैसे चलता है का रन चरण समझाता है।