Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bundling Actions Together

オープン
#461 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

AppBuilder と GraphBuilder から始め、actions、transitions、subgraphs、MappedStates がどのように表現されているかを追跡します。提案されている MultiAction と ActionChain のエントリポイントを、with_subgraph の代替案を含む既存の builder API と比較します。プロジェクトで、入力/出力の再マッピングと検証動作を含む、合意された再利用可能な action-graph 設計ができていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area/core kind/feature priority/medium

Is your feature request related to a problem? Please describe.

@gamarin2 asks:

Hey! While working with class-based actions, I ended up creating state transitions that must logically be split in two separate actions, but where the second one must always be preceded by the first one.

In my case, it's a FormatSummarizer action that formats messages before transitioning to a Summarizer action. These two actions form what I would call an "action bundle": the second one can't be separated from the first one. For now, I have documented that requirement in my class docstring, but it would be nice to have it more strictly enforced. 

I'm sure there are various ways we could achieve this, but perhaps the easiest would be to add a property to the action class where you could specify preceding/following action classes. The AppBuilder would then fail to build if you haven't added the proper transitions.

@mdrideout also suggests:

I would say that I have a very large number of use cases for this, and creating an entire sub-graph for it is painful.

To piggyback on this, I also have a very large number of use cases for running actions with high concurrency, and have been creating sub-graphs simply for the purpose of running a single action for ~10 items. 
but I may be doing this as a workaround because I had a some issues trying to use MappedStates (?) with either pydantic or async.

Describe the solution you'd like
A way to have an action represent a graph.

class MultiAction:
    @abc.abstractmethod
    def get_graph() -> Graph:
        ...

class ActionChain(MultiAction):
    @abc.abstractmethod
    def get_actions() -> List[[Tuple[str, Union[Action, Callable]]]:
        ...

    def get_graph() -> Graph:
        named_actions = self.get_actions()
        action_names = [name for name, _ in named_actions]
        return GraphBuilder().with_actions(**dict(actions)).with_transitions(zip(action_name, action_names[1:]))

Describe alternatives you've considered
Could also have with_subgraph in builder, similar thing. This allows for packaging at the action level for reusability. Might also want the ability to remap inputs/outputs:

def state_maps() -> Tuple[dict, dict]:
    ....

Additional context
Add any other context or screenshots about the feature request here.

主要言語
Python
スター
2.6k
フォーク
199
平均マージ
3日 10時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/burr のほかの issue

apache/burr の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。