[genui] get-started says the system prompt is 3-5K tokens, it's closer to 14K

未关闭
#14,019 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
dart, flutter
领域
documentation

调研方向

Start with the GenUI get-started page at https://docs.flutter.dev/ai/genui/get-started and check how it describes the PromptBuilder.chat() prompt size. Verify the reported size for the basic catalog, then look into how to make a catalog with only the components an app uses. Done when the page gives a representative basic-catalog number and shows how to trim the catalog.

由索引模型根据 Issue 内容生成。

描述

p2-medium

Page: https://docs.flutter.dev/ai/genui/get-started

The page says the PromptBuilder.chat() prompt might be 3,000 to 5,000+ tokens. I measured it and it's a lot bigger, about 3x:

final cat = BasicCatalogItems.asNoAssetCatalog();
final p = PromptBuilder.chat(
  catalog: cat,
  systemPromptFragments: ['You are a helpful assistant.'],
).systemPromptJoined();
print(p.length); // ~55K chars

With the basic catalog, two small custom items and a one-line fragment I got 55,247 chars, so roughly 13,800 tokens.

That matters because people will read "3-5K" and assume it fits small or on-device models. It doesn't.

Would be great if the page gave a real number for the basic catalog and showed how to trim it down (like a catalog with just the components your app uses).

genui 0.10.4, Flutter 3.47.9, Dart 3.13.7.

主要语言
Dart
星标
3.1k
派生
3.5k
平均合并
2 天 12 小时
30 天内合并 PR
37

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

flutter/website 的其他 Issue

查看 flutter/website 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。