AI assist admin half: field actions with streaming, and usage (A-38)

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
ai, api, full-stack, testing

調査の方向性

Start with docs/planning/admin-technical-spec.md, sections 5.1, 5.5 and 10.7, then read the A-51 admin stub and the AI plugin endpoints /ai/actions/{action}, /ai/fields and /ai/usage. The issue describes work across the admin form, streaming action panel, usage page, settings and tests, with dependencies on A-51 and A-34. Done means the acceptance criteria pass, including the sample field action, OpenAPI checks and an end-to-end accepted suggestion.

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

説明

area:admin type:feature

Problem

Rows 9.14 and 9.15 ask that an editor runs AI actions on the fields a site opted in, and sees the usage. The AI assist plugin has /ai/actions/{action}, /ai/fields and /ai/usage, and its admin half is the stub of A-51. The form has no place for a field action either: FieldActionBase and [FieldAction] are in the contract and the manifest since A-18, and nothing draws, gates or loads one.

Proposal

The form's side, in FluentCMS.Admin (5.1). A field whose type a field action of an enabled half names gets a menu of those actions, for a caller who holds the action's permission. The half loads when the menu is first opened. An action answers a FieldActionResult that leaves the draft or replaces the field's value as an unsaved change; it never saves or publishes.

The half FluentCMS.Plugins.AiAssist.Admin (5.5):

  • The actions (rewrite, shorten, expand, fix grammar, title, summary, SEO, translate) on the fields that GET /ai/fields names for the site, for a caller who holds ai.use. The suggestion streams into a panel (text/event-stream) and goes into the draft only when the user accepts it.
  • A refusal before the provider is a problem as any other; one after the stream began is its error event. Both are shown in the panel, and the draft is left as it was.
  • The daily budget of the site (FCMS1693, a 429) is shown with the problem's own text, and is not sent again as the client sends another 429 again.
  • Alt text: the server takes altText for an opted-in text field with options.mediaId, so the action is offered on such a field with the images of the entry's media fields to choose from. Alt text of the asset itself waits for #3418.
  • /ai/usage, for ai.usage.read: the usage read in pages, with filters by principal, action and time, and the totals of the filter. A principal shows by its id until #3418.
  • The settings of ai are the generated page of A-34, with the key as a secret.
  • The half's records are checked against the OpenAPI document.

Acceptance

  • On an opted-in field an editor runs an action, sees the suggestion arrive in parts, accepts it and finds it in the draft as an unsaved change; declined, the draft is unchanged
  • A field that is not opted in, a site with AI assist off and a caller without ai.use show no action, and the half is not fetched
  • A refusal before the stream, an error within it and the daily budget each show their reason and leave the draft as it was
  • Alt text is suggested for an image of the entry on an opted-in text field
  • The usage page lists and filters the usage of the site
  • The sample half's field action shows in the form through the same seam
  • Component tests cover the menu, the panel and the stream against a fake; the API tests check the records against the OpenAPI document and run an action against a stand-in of the provider; an end-to-end case accepts a suggestion

Design: docs/planning/admin-technical-spec.md, sections 5.1, 5.5 and 10.7 (A-38). Rows 9.14, 9.15. Needs A-51, and A-34 for the settings page; #3101, #3103 and #3104 are merged; #3418 for alt text of an asset and for names in the usage. Size: M.

主要言語
C#
スター
567
フォーク
107
平均マージ
1時間 19分
マージ済み PR(30日)
353

環境構築

はじめの一歩

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

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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