yzbtdiy

yzbtdiy

github
bilibili

Langflow の簡単な使い方

インストール#

uv pip install langflow -U

実行#

uv run langflow run --env-file .env

.env 設定

LANGFLOW_AUTO_LOGIN=False
LANGFLOW_SUPERUSER=admin
LANGFLOW_SUPERUSER_PASSWORD=password
LANGFLOW_SECRET_KEY=secret_key
LANGFLOW_NEW_USER_IS_ACTIVE=False
LANGFLOW_CONFIG_DIR=./config

カスタム Python コードコンポーネント#

# from langflow.field_typing import Data
from langflow.custom import Component
from langflow.io import MessageTextInput, Output
from langflow.schema import Data


class CustomComponent(Component):
    display_name = "ParseChatResponse"
    description = "自分のコンポーネントを作成するためのテンプレートとして使用します。"
    documentation: str = "https://dmentx.github.io/law-langflow/components-custom-components"
    icon = "custom_components"
    name = "CustomComponent"

    inputs = [
        MessageTextInput(name="input_value", display_name="入力値", value="Hello, World!"),
    ]

    outputs = [
        Output(display_name="出力", name="output", method="build_output"),
    ]

    def build_output(self) -> Data:
        data = Data(text=self.input_value, character="vtuber")
        self.status = data
        return data
読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。