[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BXSK15XHGVYSV8WN9S7JTX":3,"skill-same:01M6BXSK15XHGVYSV8WN9S7JTX":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":17,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6BXSK15XHGVYSV8WN9S7JTX","flutter-edge-ai-decisions","Flutter 端侧 AI 决策选择","Use when an on-device app must pick one of N options for an input — an intent, an action, a screen, a route, a label, or the few tools out of hundreds to offer a small function-calling model — and say \"none of these\" instead of guessing, with flutter_edge_ai's experimental Decider API (EmbeddingModel.createDecider, InferenceModel.createDecider, DeciderOption, EmbeddingDeciderCalibration, DeciderAnswer, Decider.chooseAll, toArtifact\u002FloadDecider). Also use for Jev Choice JSON on device, when DeciderSpaceMismatchException or DeciderUnsupportedException is thrown, when choose() always abstains or never does, when createDecider refuses a calibration, and when a decider stops working because the embedder was closed. For semantic search over documents, use flutter-edge-ai-rag.","当设备端应用需要对某一输入从 N 个选项中做出选择时——例如意图、动作、屏幕、路由、标签，或从数百个工具中挑选少数几个提供给小型函数调用模型——并使用 flutter_edge_ai 的实验性 Decider API（EmbeddingModel.createDecider、InferenceModel.createDecider、DeciderOption、EmbeddingDeciderCalibration、DeciderAnswer、Decider.chooseAll、toArtifact\u002FloadDecider）说出“这些都不是”而不是猜测。也适用于设备端 Jev Choice JSON，当抛出 DeciderSpaceMismatchException 或 DeciderUnsupportedException 时，当 choose() 总是不作选择或从不作选择时，当 createDecider 拒绝某个校准时，以及当某个 decider 因 embedder 被关闭而停止工作时。若要对文档进行语义搜索，请使用 flutter-edge-ai-rag。","DenisovAV\u002Fflutter_edge_ai","DenisovAV","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9622910?v=4","01M6BXRH02KTWK364FYEH4AECE","Sasha Denisov","01M6BXRH45KJKJ712H82EV47AS",662,"MIT",null,"https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai\u002Fskills\u002Fflutter-edge-ai-decisions\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C7TWSEQ7QTRNCZXZP1RXM5","AI 模型推理与服务部署","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"edge ai","flutter","flutter edge ai decisions","edge","decisions","options","intent","function-calling","route","when","embedder","never","app","api","documents","choice","pick","search","choose","model","2026-11-10 10:12:30",false,"---\nname: flutter-edge-ai-decisions\ndescription: Use when an on-device app must pick one of N options for an input — an intent, an action, a screen, a route, a label, or the few tools out of hundreds to offer a small function-calling model — and say \"none of these\" instead of guessing, with flutter_edge_ai's experimental Decider API (EmbeddingModel.createDecider, InferenceModel.createDecider, DeciderOption, EmbeddingDeciderCalibration, DeciderAnswer, Decider.chooseAll, toArtifact\u002FloadDecider). Also use for Jev Choice JSON on device, when DeciderSpaceMismatchException or DeciderUnsupportedException is thrown, when choose() always abstains or never does, when createDecider refuses a calibration, and when a decider stops working because the embedder was closed. For semantic search over documents, use flutter-edge-ai-rag.\n---\n\n# Deciders: pick one of N options on device\n\nExperimental since `flutter_edge_ai` 2.4.0: names may change in a minor release.\nEvery type and member is `@experimental`, so code using them gets the analyzer\nwarning `experimental_member_use`; add\n`\u002F\u002F ignore_for_file: experimental_member_use` to those files rather than let a\nCI that fails on warnings fail.\n\n## Rules\n\n1. A decider comes from a model: `EmbeddingModel.createDecider` works with every\n   embedding backend. `InferenceModel.createDecider(question:, options:,\n   calibration:)` needs a small LLM TRAINED on that one decision (a `.litertlm`\n   tuned by LiteTune, which writes the decision into the file), natively, on\n   the CPU (`flutter_edge_ai_litertlm` 1.16.0) or the GPU (1.19.1); the NPU,\n   any other model, and every model on the web throw\n   `DeciderUnsupportedException`. The file's calibration is fitted on the\n   CPU: load with `preferredBackend: PreferredBackend.cpu` to use it as\n   fitted (a load without it tries the GPU first). Its scoring self-check runs\n   in debug and profile builds only (litertlm 1.19.1; release scores in a\n   fixed mode): run the decider once in debug on the target hardware. Both return a `Decider` whose `DeciderAnswer` reads the same, so code\n   that reads answers (choice, ranked, abstainReason, provenance) needs no\n   change when one replaces the other; check `decider.capabilities`\n   (`supportsAmong`, `storable`, `calibratedProbabilities`, `modalities`, `questionType`)\n   before using what only one kind has.\n2. Options and requests are embedded with `TaskType.sentenceSimilarity`. Give\n   each option 5–30 example requests (`examples:`); a `description` alone is\n   zero-shot and much weaker (CLINC150, 150 options: 0.75 accuracy from label\n   names alone, 0.92–0.94 from 5–10 examples per option, centroid).\n3. Abstaining is the hard part, and a softmax cannot do it: with two options any\n   request looks confident. The abstain signal is the request's highest cosine\n   to an option centroid (`answer.provenance.abstainSignal`, of the kind\n   `AbstainSignalKind.topCosine`). The default\n   `EmbeddingDeciderCalibration.crossFit()` fits its threshold from the\n   options' own inputs and needs at least two inputs per option. A zero-shot\n   option set (descriptions only) cannot cross-fit: use\n   `EmbeddingDeciderCalibration.none()`, or\n   `EmbeddingDeciderCalibration.minSimilarity(t)` with a `t` you MEASURED for\n   your model file and prompt — never a guessed value.\n   With ~5 examples per option among many options the cross-fit's error on\n   answered requests can exceed a 5 % budget (CLINC150, 150 options: 6.0 %\n   with `DeciderMethod.linear`; not measured, and possibly higher, with the\n   default centroid);\n   there, calibrate with `fromLabelled` on held-out requests. It sees only\n   requests that belong to an option, so check that its threshold still\n   refuses the ones that fit none. An audio request against text options\n   scores lower than the same request typed (EmbeddingGemma 2 740m: 0.745\n   against 0.866 for about the same error), so give spoken requests a decider\n   of their own, calibrated on spoken requests. Always handle\n   `answer.choice == null`.\n4. A raw score is not a probability. `RankedOption.probability`,\n   `DeciderAnswer.probabilities` and `DeciderAnswer.confidence` are null unless\n   the decider was calibrated with `EmbeddingDeciderCalibration.fromLabelled`\n   on held-out labelled requests. `fromLabelled` refuses (`ArgumentError`)\n   rows it cannot calibrate on — all answered right with room to spare, or a\n   single row — so give it real, partly hard, requests. It also refuses rows\n   answered too poorly: it sorts them by their highest cosine to an option\n   centroid and looks for a cut that answers the rows above it with at most\n   `maxError` (default 0.05) of them wrong (top option not their label); when\n   no cut does, add examples per option, use the linear method, or raise\n   `maxError`.\n5. A decider borrows its embedder and never closes it. On an embedder\n   `FlutterEdgeAi.getActiveEmbedder()` returned, the decider follows core: when\n   that embedder is closed (core widened it for images or audio, another\n   backend, a re-install, a dead worker, or the app closed it), the next\n   `choose` takes core's active embedder and retries — or throws\n   `DeciderSpaceMismatchException` when that one is another embedding space.\n   On a custom `EmbeddingModel` it fails with `EmbedderClosedException` and\n   `decider.isClosed` turns true: `loadDecider(toArtifact())` on the new\n   embedder, no re-embedding.\n6. An artifact is pinned to an embedding space: the installed files (names and,\n   natively, sizes — not the bytes), dimension, backend, task prefix, and —\n   for a decider fitted on an image — the image budget (EG2: 140 or 70\n   tokens). A decider fitted on the CPU file is refused on an NPU bundle\n   (`DeciderSpaceMismatchException`); fit it again there. A model that reports\n   no backend (LiteRT.js and ONNX on web) and any custom `EmbeddingModel` need\n   `embedderId:`, which then names the space instead of the files.\n7. Inputs are never truncated: an over-long request fails with\n   `EmbeddingInputTooLongException`, naming the option and input when it is an\n   option's. `DeciderInput.context` must be empty for every decider in this\n   release, or `choose` throws `DeciderUnsupportedException`.\n8. `ScoreKind`, `AbstainReason`, `AbstainSignalKind`, `DeciderMethod` and\n   `DeciderQuestionType` are classes with constant values, not enums: a\n   `switch` over them needs a default branch. Describe an abstention from `abstainSignalKind`, not by\n   assuming a cosine: a language-model decider abstains on a probability\n   (`topProbability`) or with `AbstainReason.noneOption`.\n\n## Route requests to actions\n\n```dart\nimport 'package:flutter_edge_ai\u002Fflutter_edge_ai.dart';\nimport 'package:flutter_edge_ai_litertlm\u002Fflutter_edge_ai_litertlm.dart';\n\nconst eg2Revision = '9be6e8b90982095dc05c2bd162e4b954ee4dbac7';\n\nawait FlutterEdgeAi.initialize(\n  embeddingBackends: const [LiteRtEmbeddingBackend()],\n);\nawait FlutterEdgeAi.installEmbedder()\n    .modelFromNetwork(\n      'https:\u002F\u002Fhuggingface.co\u002Flitert-community\u002F'\n      'embeddinggemma-2-text-270m-litert-lm\u002Fresolve\u002F$eg2Revision\u002F'\n      'embeddinggemma-2-text-270m.litertlm',\n    )\n    .install();\nfinal embedder = await FlutterEdgeAi.getActiveEmbedder();\n\nfinal decider = await embedder.createDecider(\n  options: [\n    DeciderOption(\n      'set_timer',\n      description: 'Start a countdown timer',\n      examples: [\n        EmbeddingInput.text('set a timer for ten minutes'),\n        EmbeddingInput.text('wake me in half an hour'),\n        EmbeddingInput.text('countdown 5 minutes'),\n      ],\n      metadata: {'screen': '\u002Ftimer'},\n    ),\n    DeciderOption(\n      'call_contact',\n      description: 'Phone someone from the contacts',\n      examples: [\n        EmbeddingInput.text('call mum'),\n        EmbeddingInput.text('ring Alex on his mobile'),\n        EmbeddingInput.text('phone the office'),\n      ],\n    ),\n  ],\n);\n\nfinal answer = await decider.choose(\n  DeciderInput(EmbeddingInput.text('remind me in 20 minutes')),\n);\nswitch (answer.choice) {\n  case null:\n    \u002F\u002F \"None of these\": answer.abstainReason says why.\n    print('abstained: ${answer.abstainReason}');\n  case final id:\n    print('$id, margin ${answer.margin}, '\n        'cosine ${answer.provenance.abstainSignal}');\n}\n```\n\n`answer.ranked` lists the best `topK` candidates (default 5) with their raw\nscores; `answer.margin` is best minus runner-up. `choose(..., among: [...])`\nrestricts the candidates to some option ids; an empty `among` abstains with\n`AbstainReason.noCandidates`.\n\n## Narrow hundreds of tools for a small function-calling model\n\nFunctionGemma 270M has a 1024-token context: it cannot read hundreds of tool\ndeclarations. Let a decider pick the few likely tools, and give only those to\nthe chat. Keep each tool's declaration in the option's `metadata` or in a map\nkeyed by option id.\n\n```dart\nfinal toolDecider = await embedder.createDecider(\n  options: [\n    for (final tool in myTools)\n      DeciderOption(tool.name, description: tool.description),\n  ],\n  calibration: const EmbeddingDeciderCalibration.none(),\n);\nfinal picked = await toolDecider.choose(\n  DeciderInput(EmbeddingInput.text(prompt)),\n  topK: 3,\n);\nfinal shortlist = picked.choice == null\n    ? \u003CTool>[]\n    : [\n        for (final r in picked.ranked)\n          myTools.firstWhere((t) => t.name == r.id),\n      ];\nfinal toolChat = await model.openChat(\n  tools: shortlist,\n  supportsFunctionCalls: true,\n  modelType: ModelType.functionGemma,\n);\ntry {\n  \u002F\u002F Use toolChat for this request or screen.\n} finally {\n  await toolChat.close();\n}\n```\n\nDescriptions alone cannot cross-fit, so this router never abstains\n(`none()`): it always offers the three nearest tools. To let it say \"no tool\",\ngive each tool a few example requests and keep the default cross-fit; then\n`choice == null` means none fits, and the code above already offers no tool.\n\n## Several decisions over one request\n\n`Decider.chooseAll` answers several deciders for the same input; deciders made\nfrom one `EmbeddingModel` share one embedding of it.\n\n```dart\nfinal intent = await embedder.createDecider(options: [\n  DeciderOption('buy', examples: [\n    EmbeddingInput.text('I want to order this'),\n    EmbeddingInput.text('add it to my cart'),\n  ]),\n  DeciderOption('return', examples: [\n    EmbeddingInput.text('this arrived broken'),\n    EmbeddingInput.text('how do I send it back'),\n  ]),\n]);\nfinal tone = await embedder.createDecider(\n  options: [\n    DeciderOption('calm', description: 'calm, neutral wording'),\n    DeciderOption('upset', description: 'angry or upset wording'),\n  ],\n  calibration: const EmbeddingDeciderCalibration.none(),\n);\nfinal answers = await Decider.chooseAll(\n  DeciderInput(EmbeddingInput.text('the box was crushed, I am furious')),\n  [intent, tone],\n);\nprint('${answers[0].choice} \u002F ${answers[1].choice}');\n```\n\n## Methods and calibrations\n\n- `DeciderMethod.centroid` (default): cosine to each option's centroid. No\n  fitting.\n- `DeciderMethod.linear`: softmax regression on the frozen embeddings, weight\n  decay 1e-5, fitted when the decider is created. The most accurate with 5–30\n  examples per option. Fit time grows with options × inputs: about 0.3 s at\n  20 options × 10 examples and 50 s at 150 × 30 on an Apple M4 Pro, release\n  (AOT) build; memory about 2 · 20 · (dimension · options + options) · 8 bytes\n  (37 MB at 768 × 150, ~0.5 GB at 2000 options). Natively the fit runs on an\n  isolate of its own; on web it runs on the page's thread in 4 ms slices,\n  yielding to the event loop between them, so the page keeps drawing while it\n  fits (Chrome 155, M4 Pro, release build, 150 × 10 synthetic rows:\n  10.2–10.8 s dart2js \u002F 11.4–11.8 s wasm, longest 16 ms-timer gap 20–23 ms).\n  Scores are log-probabilities (`ScoreKind.logprob`).\n- `EmbeddingDeciderCalibration.crossFit({keep: 0.95})` (default),\n  `.minSimilarity(t)`, `.none()`, and `.fromLabelled(rows, maxError: 0.05)`,\n  which also fits a softmax temperature, so answers carry `probabilities` and\n  a Jev `confidence`.\n- `createDecider(cancelToken:, onProgress:)`: the token stops the embedding and\n  the fit (`DeciderCancelledException`, no decider); `onProgress(done,\n  total)` counts the embedded inputs for a progress bar, not the fit after\n  them. `choose(cancelToken:)` and `Decider.chooseAll(cancelToken:)` fail with\n  `DeciderCancelledException` too, as does a `choose` running when its\n  decider is closed.\n\n## Store and restore\n\n```dart\nfinal fitted = await embedder.createDecider(options: [\n  DeciderOption('yes', examples: [\n    EmbeddingInput.text('sure'),\n    EmbeddingInput.text('go ahead'),\n  ]),\n  DeciderOption('no', examples: [\n    EmbeddingInput.text('stop'),\n    EmbeddingInput.text('not now'),\n  ]),\n]);\nfinal artifact = fitted.toArtifact(); \u002F\u002F JSON-encodable, versioned\n\u002F\u002F …persist jsonEncode(artifact), later jsonDecode it…\nfinal restored = await embedder.loadDecider(artifact);\n```\n\n`loadDecider` embeds nothing. It throws `DeciderSpaceMismatchException` for\nanother embedding space and `FormatException` for an artifact this release\ncannot read or that contradicts itself. A model that\n`FlutterEdgeAi.getActiveEmbedder()` did not build (a custom subclass, a test\nfake) has no installed files to name its space, and a model that reports no\nbackend cannot tell WebGPU from WASM: pass `embedderId:` to both\n`createDecider` and `loadDecider` — an id that names the weights (and the\nbackend, when the model reports none). It replaces the installed-file check.\n\nA decider of your own (or a test fake) is a `final class … extends Decider`\n(or `base`; `Decider` is `abstract base`, so a plain `class` does not compile,\nand `implements Decider` does not compile outside core) and implements\n`decide(DeciderRequest request)` with `capabilities`, `options`, `isClosed`\nand `close()`; `toArtifact()` defaults to throwing\n`DeciderUnsupportedException`. Core does not check `isClosed` for you:\n`decide` throws `StateError` once the decider is closed, and fails with\n`DeciderCancelledException` when `close()` lands while it runs. Do not\noverride `choose`: it is core's\n(`@nonVirtual`), checks the request against `capabilities` (`among`, context,\ninput modalities, `topK`, the cancel token) and then calls `decide` with the\ncandidates as option ids. An input modality the decider does not take is a\n`DeciderUnsupportedException` for every decider.\n\n## Jev Choice JSON\n\n```dart\nfinal jevOptions = DeciderOption.fromJevChoice({\n  'type': 'choice',\n  'instructions': 'Which department should handle this?',\n  'criteria': {\n    'returns': 'Exchanges, wrong or damaged items',\n    'billing': null,\n  },\n});\n\u002F\u002F Criteria are descriptions only, so the default cross-fit does not apply.\n\u002F\u002F PLACEHOLDER — measure the threshold for your model file and prompt; this\n\u002F\u002F value is not one (0.875 was measured for EmbeddingGemma 2 int4 text 270m\n\u002F\u002F with 5–10 examples per option, not for descriptions alone). Without a\n\u002F\u002F measured value, use EmbeddingDeciderCalibration.none() and never abstain.\nconst measuredThreshold = 0.87;\nfinal jevDecider = await embedder.createDecider(\n  options: jevOptions,\n  calibration: EmbeddingDeciderCalibration.minSimilarity(measuredThreshold),\n);\nfinal jevAnswer = await jevDecider.choose(\n  DeciderInput(EmbeddingInput.text(question)),\n);\nfinal json = jevAnswer.toJevJson(); \u002F\u002F {type, choice, probabilities?, confidence?}\n```\n\n`fromJevChoice` reads Choice questions only; `noul` and `score` throw\n`ArgumentError`. A `null` criterion uses the option name as its description.\nAn abstained answer has `\"choice\": null`, which Jev itself never sends.\n`toJevJson()` writes the answer's own `questionType`: a language-model decider\ntrained on a Noul or Score question returns `{\"type\": \"noul\", \"noul\": p}` or\n`{\"type\": \"score\", \"score\": …, \"legend\": {…}, \"probabilities\": {…},\n\"confidence\": …}`.\n\n## A language model trained on the decision\n\nFor a few options that are a property of the text — a tone, an emotion, yes or\nno, a level — a small LLM tuned on exactly that question can decide by scoring\neach option's id as its reply. The model is an ordinary `.litertlm`; LiteTune\n(0.5.0 or later) writes the decision into it (a `litetune.decision` section:\nquestion, options, temperature, threshold). Pass the question and the trained\noptions; take the rest from the file with\n`InferenceDeciderCalibration.fromModel()`. LiteTune 0.5.0's `bundle` prints\nonly the `options:` part of the call; the question is in its `contract.json`.\nA file from LiteTune 0.6.0 records its scoring `method` and needs\n`flutter_edge_ai` 2.5.2; a `fresh_engine` one (LiteTune's Qwen 3.5 rule) is\nrefused by name.\n\n```dart\nimport 'package:flutter_edge_ai\u002Fflutter_edge_ai.dart';\nimport 'package:flutter_edge_ai_litertlm\u002Fflutter_edge_ai_litertlm.dart';\n\nawait FlutterEdgeAi.initialize(inferenceEngines: const [LiteRtLmEngine()]);\nawait FlutterEdgeAi.installModel(\n  modelType: ModelType.gemmaIt,\n  fileType: ModelFileType.litertlm,\n).fromFile(path).install();\n\u002F\u002F CPU or GPU; the NPU is refused. The file's temperature and threshold are\n\u002F\u002F fitted on CPU probabilities: on the GPU the top option matched the CPU's\n\u002F\u002F on 97-100 % of rows measured (Metal, Adreno 830, yes\u002Fno questions only);\n\u002F\u002F Mali, Linux and Windows GPUs and the abstain threshold on the GPU are not\n\u002F\u002F measured. The CPU keeps the calibration as fitted.\nfinal llm = await FlutterEdgeAi.getActiveModel(\n  preferredBackend: PreferredBackend.cpu,\n);\nfinal emotion = await llm.createDecider(\n  question: 'Which emotion does the text express?',\n  options: [\n    DeciderOption('sadness'), DeciderOption('joy'), DeciderOption('love'),\n    DeciderOption('anger'), DeciderOption('fear'), DeciderOption('surprise'),\n  ],\n  calibration: const InferenceDeciderCalibration.fromModel(),\n);\nconst userText = 'im feeling far more mellow than normal';\nfinal answer = await emotion.choose(DeciderInput(EmbeddingInput.text(userText)));\nswitch (answer.questionType) {\n  case DeciderQuestionType.noul:\n    print('P(yes) = ${answer.noul}');\n  case DeciderQuestionType.score:\n    print('level ${answer.expectedLevel} of ${answer.legend}');\n  default:\n    print(answer.choice ?? 'none of these (${answer.abstainReason})');\n}\n```\n\n- The call must be the trained one: another question, a missing or extra\n  option, or another description (one equal to the id is fine) throws\n  `ArgumentError` naming the trained value. Option order is free.\n- Prefer `fromModel()`: explicit temperature, threshold and `noneOption` must\n  equal the file's, which pins the app to one build of the model.\n- A model trained with a \"none of these\" option: with `fromModel()` it may be\n  left out of `options:` (the decider lists it last); when it ranks first the\n  answer abstains with `AbstainReason.noneOption`.\n- The decider borrows the active model: when core closes it (another model or\n  another `maxTokens` requested), the decider is closed too; create it again.\n  On a model from `FlutterEdgeAi.openModel`, closing that model closes it.\n- Options carry no `examples:`: a language-model decider refuses them with\n  `ArgumentError`.\n- A decision whose question and options alone exceed `maxTokens` fails\n  `createDecider` with `DeciderUnsupportedException`; load the model with a\n  larger `maxTokens`.\n- Noul (`no`\u002F`yes`) and Score (levels `0`…`K − 1`) questions never abstain.\n- Text input only, no `among`, no `context`. Input containing chat-template\n  control text (`\u003Cstart_of_turn>`, `\u003Cend_of_turn>`, `\u003Cbos>`, …), or whose\n  prompt does not fit `maxTokens`, throws `ArgumentError` — never truncated.\n- One decision costs one scoring pass per option (176 ms for 6 options on an\n  Apple M4 Pro CPU; LiteTune measured 5.0 s for 55 and 7.2 s for 151 on a server\n  CPU). Many options by topic belong to an embedding decider.\n","# Deciders: pick one of N options on device\n\nExperimental since `flutter_edge_ai` 2.4.0: names may change in a minor release.\nEvery type and member is `@experimental`, so code using them gets the analyzer\nwarning `experimental_member_use`; add\n`\u002F\u002F ignore_for_file: experimental_member_use` to those files rather than let a\nCI that fails on warnings fail.\n\n## Rules\n\n1. A decider comes from a model: `EmbeddingModel.createDecider` works with every\n   embedding backend. `InferenceModel.createDecider(question:, options:,\n   calibration:)` needs a small LLM TRAINED on that one decision (a `.litertlm`\n   tuned by LiteTune, which writes the decision into the file), natively, on\n   the CPU (`flutter_edge_ai_litertlm` 1.16.0) or the GPU (1.19.1); the NPU,\n   any other model, and every model on the web throw\n   `DeciderUnsupportedException`. The file's calibration is fitted on the\n   CPU: load with `preferredBackend: PreferredBackend.cpu` to use it as\n   fitted (a load without it tries the GPU first). Its scoring self-check runs\n   in debug and profile builds only (litertlm 1.19.1; release scores in a\n   fixed mode): run the decider once in debug on the target hardware. Both return a `Decider` whose `DeciderAnswer` reads the same, so code\n   that reads answers (choice, ranked, abstainReason, provenance) needs no\n   change when one replaces the other; check `decider.capabilities`\n   (`supportsAmong`, `storable`, `calibratedProbabilities`, `modalities`, `questionType`)\n   before using what only one kind has.\n2. Options and requests are embedded with `TaskType.sentenceSimilarity`. Give\n   each option 5–30 example requests (`examples:`); a `description` alone is\n   zero-shot and much weaker (CLINC150, 150 options: 0.75 accuracy from label\n   names alone, 0.92–0.94 from 5–10 examples per option, centroid).\n3. Abstaining is the hard part, and a softmax cannot do it: with two options any\n   request looks confident. The abstain signal is the request's highest cosine\n   to an option centroid (`answer.provenance.abstainSignal`, of the kind\n   `AbstainSignalKind.topCosine`). The default\n   `EmbeddingDeciderCalibration.crossFit()` fits its threshold from the\n   options' own inputs and needs at least two inputs per option. A zero-shot\n   option set (descriptions only) cannot cross-fit: use\n   `EmbeddingDeciderCalibration.none()`, or\n   `EmbeddingDeciderCalibration.minSimilarity(t)` with a `t` you MEASURED for\n   your model file and prompt — never a guessed value.\n   With ~5 examples per option among many options the cross-fit's error on\n   answered requests can exceed a 5 % budget (CLINC150, 150 options: 6.0 %\n   with `DeciderMethod.linear`; not measured, and possibly higher, with the\n   default centroid);\n   there, calibrate with `fromLabelled` on held-out requests. It sees only\n   requests that belong to an option, so check that its threshold still\n   refuses the ones that fit none. An audio request against text options\n   scores lower than the same request typed (EmbeddingGemma 2 740m: 0.745\n   against 0.866 for about the same error), so give spoken requests a decider\n   of their own, calibrated on spoken requests. Always handle\n   `answer.choice == null`.\n4. A raw score is not a probability. `RankedOption.probability`,\n   `DeciderAnswer.probabilities` and `DeciderAnswer.confidence` are null unless\n   the decider was calibrated with `EmbeddingDeciderCalibration.fromLabelled`\n   on held-out labelled requests. `fromLabelled` refuses (`ArgumentError`)\n   rows it cannot calibrate on — all answered right with room to spare, or a\n   single row — so give it real, partly hard, requests. It also refuses rows\n   answered too poorly: it sorts them by their highest cosine to an option\n   centroid and looks for a cut that answers the rows above it with at most\n   `maxError` (default 0.05) of them wrong (top option not their label); when\n   no cut does, add examples per option, use the linear method, or raise\n   `maxError`.\n5. A decider borrows its embedder and never closes it. On an embedder\n   `FlutterEdgeAi.getActiveEmbedder()` returned, the decider follows core: when\n   that embedder is closed (core widened it for images or audio, another\n   backend, a re-install, a dead worker, or the app closed it), the next\n   `choose` takes core's active embedder and retries — or throws\n   `DeciderSpaceMismatchException` when that one is another embedding space.\n   On a custom `EmbeddingModel` it fails with `EmbedderClosedException` and\n   `decider.isClosed` turns true: `loadDecider(toArtifact())` on the new\n   embedder, no re-embedding.\n6. An artifact is pinned to an embedding space: the installed files (names and,\n   natively, sizes — not the bytes), dimension, backend, task prefix, and —\n   for a decider fitted on an image — the image budget (EG2: 140 or 70\n   tokens). A decider fitted on the CPU file is refused on an NPU bundle\n   (`DeciderSpaceMismatchException`); fit it again there. A model that reports\n   no backend (LiteRT.js and ONNX on web) and any custom `EmbeddingModel` need\n   `embedderId:`, which then names the space instead of the files.\n7. Inputs are never truncated: an over-long request fails with\n   `EmbeddingInputTooLongException`, naming the option and input when it is an\n   option's. `DeciderInput.context` must be empty for every decider in this\n   release, or `choose` throws `DeciderUnsupportedException`.\n8. `ScoreKind`, `AbstainReason`, `AbstainSignalKind`, `DeciderMethod` and\n   `DeciderQuestionType` are classes with constant values, not enums: a\n   `switch` over them needs a default branch. Describe an abstention from `abstainSignalKind`, not by\n   assuming a cosine: a language-model decider abstains on a probability\n   (`topProbability`) or with `AbstainReason.noneOption`.\n\n## Route requests to actions\n\n```dart\nimport 'package:flutter_edge_ai\u002Fflutter_edge_ai.dart';\nimport 'package:flutter_edge_ai_litertlm\u002Fflutter_edge_ai_litertlm.dart';\n\nconst eg2Revision = '9be6e8b90982095dc05c2bd162e4b954ee4dbac7';\n\nawait FlutterEdgeAi.initialize(\n  embeddingBackends: const [LiteRtEmbeddingBackend()],\n);\nawait FlutterEdgeAi.installEmbedder()\n    .modelFromNetwork(\n      'https:\u002F\u002Fhuggingface.co\u002Flitert-community\u002F'\n      'embeddinggemma-2-text-270m-litert-lm\u002Fresolve\u002F$eg2Revision\u002F'\n      'embeddinggemma-2-text-270m.litertlm',\n    )\n    .install();\nfinal embedder = await FlutterEdgeAi.getActiveEmbedder();\n\nfinal decider = await embedder.createDecider(\n  options: [\n    DeciderOption(\n      'set_timer',\n      description: 'Start a countdown timer',\n      examples: [\n        EmbeddingInput.text('set a timer for ten minutes'),\n        EmbeddingInput.text('wake me in half an hour'),\n        EmbeddingInput.text('countdown 5 minutes'),\n      ],\n      metadata: {'screen': '\u002Ftimer'},\n    ),\n    DeciderOption(\n      'call_contact',\n      description: 'Phone someone from the contacts',\n      examples: [\n        EmbeddingInput.text('call mum'),\n        EmbeddingInput.text('ring Alex on his mobile'),\n        EmbeddingInput.text('phone the office'),\n      ],\n    ),\n  ],\n);\n\nfinal answer = await decider.choose(\n  DeciderInput(EmbeddingInput.text('remind me in 20 minutes')),\n);\nswitch (answer.choice) {\n  case null:\n    \u002F\u002F \"None of these\": answer.abstainReason says why.\n    print('abstained: ${answer.abstainReason}');\n  case final id:\n    print('$id, margin ${answer.margin}, '\n        'cosine ${answer.provenance.abstainSignal}');\n}\n```\n\n`answer.ranked` lists the best `topK` candidates (default 5) with their raw\nscores; `answer.margin` is best minus runner-up. `choose(..., among: [...])`\nrestricts the candidates to some option ids; an empty `among` abstains with\n`AbstainReason.noCandidates`.\n\n## Narrow hundreds of tools for a small function-calling model\n\nFunctionGemma 270M has a 1024-token context: it cannot read hundreds of tool\ndeclarations. Let a decider pick the few likely tools, and give only those to\nthe chat. Keep each tool's declaration in the option's `metadata` or in a map\nkeyed by option id.\n\n```dart\nfinal toolDecider = await embedder.createDecider(\n  options: [\n    for (final tool in myTools)\n      DeciderOption(tool.name, description: tool.description),\n  ],\n  calibration: const EmbeddingDeciderCalibration.none(),\n);\nfinal picked = await toolDecider.choose(\n  DeciderInput(EmbeddingInput.text(prompt)),\n  topK: 3,\n);\nfinal shortlist = picked.choice == null\n    ? \u003CTool>[]\n    : [\n        for (final r in picked.ranked)\n          myTools.firstWhere((t) => t.name == r.id),\n      ];\nfinal toolChat = await model.openChat(\n  tools: shortlist,\n  supportsFunctionCalls: true,\n  modelType: ModelType.functionGemma,\n);\ntry {\n  \u002F\u002F Use toolChat for this request or screen.\n} finally {\n  await toolChat.close();\n}\n```\n\nDescriptions alone cannot cross-fit, so this router never abstains\n(`none()`): it always offers the three nearest tools. To let it say \"no tool\",\ngive each tool a few example requests and keep the default cross-fit; then\n`choice == null` means none fits, and the code above already offers no tool.\n\n## Several decisions over one request\n\n`Decider.chooseAll` answers several deciders for the same input; deciders made\nfrom one `EmbeddingModel` share one embedding of it.\n\n```dart\nfinal intent = await embedder.createDecider(options: [\n  DeciderOption('buy', examples: [\n    EmbeddingInput.text('I want to order this'),\n    EmbeddingInput.text('add it to my cart'),\n  ]),\n  DeciderOption('return', examples: [\n    EmbeddingInput.text('this arrived broken'),\n    EmbeddingInput.text('how do I send it back'),\n  ]),\n]);\nfinal tone = await embedder.createDecider(\n  options: [\n    DeciderOption('calm', description: 'calm, neutral wording'),\n    DeciderOption('upset', description: 'angry or upset wording'),\n  ],\n  calibration: const EmbeddingDeciderCalibration.none(),\n);\nfinal answers = await Decider.chooseAll(\n  DeciderInput(EmbeddingInput.text('the box was crushed, I am furious')),\n  [intent, tone],\n);\nprint('${answers[0].choice} \u002F ${answers[1].choice}');\n```\n\n## Methods and calibrations\n\n- `DeciderMethod.centroid` (default): cosine to each option's centroid. No\n  fitting.\n- `DeciderMethod.linear`: softmax regression on the frozen embeddings, weight\n  decay 1e-5, fitted when the decider is created. The most accurate with 5–30\n  examples per option. Fit time grows with options × inputs: about 0.3 s at\n  20 options × 10 examples and 50 s at 150 × 30 on an Apple M4 Pro, release\n  (AOT) build; memory about 2 · 20 · (dimension · options + options) · 8 bytes\n  (37 MB at 768 × 150, ~0.5 GB at 2000 options). Natively the fit runs on an\n  isolate of its own; on web it runs on the page's thread in 4 ms slices,\n  yielding to the event loop between them, so the page keeps drawing while it\n  fits (Chrome 155, M4 Pro, release build, 150 × 10 synthetic rows:\n  10.2–10.8 s dart2js \u002F 11.4–11.8 s wasm, longest 16 ms-timer gap 20–23 ms).\n  Scores are log-probabilities (`ScoreKind.logprob`).\n- `EmbeddingDeciderCalibration.crossFit({keep: 0.95})` (default),\n  `.minSimilarity(t)`, `.none()`, and `.fromLabelled(rows, maxError: 0.05)`,\n  which also fits a softmax temperature, so answers carry `probabilities` and\n  a Jev `confidence`.\n- `createDecider(cancelToken:, onProgress:)`: the token stops the embedding and\n  the fit (`DeciderCancelledException`, no decider); `onProgress(done,\n  total)` counts the embedded inputs for a progress bar, not the fit after\n  them. `choose(cancelToken:)` and `Decider.chooseAll(cancelToken:)` fail with\n  `DeciderCancelledException` too, as does a `choose` running when its\n  decider is closed.\n\n## Store and restore\n\n```dart\nfinal fitted = await embedder.createDecider(options: [\n  DeciderOption('yes', examples: [\n    EmbeddingInput.text('sure'),\n    EmbeddingInput.text('go ahead'),\n  ]),\n  DeciderOption('no', examples: [\n    EmbeddingInput.text('stop'),\n    EmbeddingInput.text('not now'),\n  ]),\n]);\nfinal artifact = fitted.toArtifact(); \u002F\u002F JSON-encodable, versioned\n\u002F\u002F …persist jsonEncode(artifact), later jsonDecode it…\nfinal restored = await embedder.loadDecider(artifact);\n```\n\n`loadDecider` embeds nothing. It throws `DeciderSpaceMismatchException` for\nanother embedding space and `FormatException` for an artifact this release\ncannot read or that contradicts itself. A model that\n`FlutterEdgeAi.getActiveEmbedder()` did not build (a custom subclass, a test\nfake) has no installed files to name its space, and a model that reports no\nbackend cannot tell WebGPU from WASM: pass `embedderId:` to both\n`createDecider` and `loadDecider` — an id that names the weights (and the\nbackend, when the model reports none). It replaces the installed-file check.\n\nA decider of your own (or a test fake) is a `final class … extends Decider`\n(or `base`; `Decider` is `abstract base`, so a plain `class` does not compile,\nand `implements Decider` does not compile outside core) and implements\n`decide(DeciderRequest request)` with `capabilities`, `options`, `isClosed`\nand `close()`; `toArtifact()` defaults to throwing\n`DeciderUnsupportedException`. Core does not check `isClosed` for you:\n`decide` throws `StateError` once the decider is closed, and fails with\n`DeciderCancelledException` when `close()` lands while it runs. Do not\noverride `choose`: it is core's\n(`@nonVirtual`), checks the request against `capabilities` (`among`, context,\ninput modalities, `topK`, the cancel token) and then calls `decide` with the\ncandidates as option ids. An input modality the decider does not take is a\n`DeciderUnsupportedException` for every decider.\n\n## Jev Choice JSON\n\n```dart\nfinal jevOptions = DeciderOption.fromJevChoice({\n  'type': 'choice',\n  'instructions': 'Which department should handle this?',\n  'criteria': {\n    'returns': 'Exchanges, wrong or damaged items',\n    'billing': null,\n  },\n});\n\u002F\u002F Criteria are descriptions only, so the default cross-fit does not apply.\n\u002F\u002F PLACEHOLDER — measure the threshold for your model file and prompt; this\n\u002F\u002F value is not one (0.875 was measured for EmbeddingGemma 2 int4 text 270m\n\u002F\u002F with 5–10 examples per option, not for descriptions alone). Without a\n\u002F\u002F measured value, use EmbeddingDeciderCalibration.none() and never abstain.\nconst measuredThreshold = 0.87;\nfinal jevDecider = await embedder.createDecider(\n  options: jevOptions,\n  calibration: EmbeddingDeciderCalibration.minSimilarity(measuredThreshold),\n);\nfinal jevAnswer = await jevDecider.choose(\n  DeciderInput(EmbeddingInput.text(question)),\n);\nfinal json = jevAnswer.toJevJson(); \u002F\u002F {type, choice, probabilities?, confidence?}\n```\n\n`fromJevChoice` reads Choice questions only; `noul` and `score` throw\n`ArgumentError`. A `null` criterion uses the option name as its description.\nAn abstained answer has `\"choice\": null`, which Jev itself never sends.\n`toJevJson()` writes the answer's own `questionType`: a language-model decider\ntrained on a Noul or Score question returns `{\"type\": \"noul\", \"noul\": p}` or\n`{\"type\": \"score\", \"score\": …, \"legend\": {…}, \"probabilities\": {…},\n\"confidence\": …}`.\n\n## A language model trained on the decision\n\nFor a few options that are a property of the text — a tone, an emotion, yes or\nno, a level — a small LLM tuned on exactly that question can decide by scoring\neach option's id as its reply. The model is an ordinary `.litertlm`; LiteTune\n(0.5.0 or later) writes the decision into it (a `litetune.decision` section:\nquestion, options, temperature, threshold). Pass the question and the trained\noptions; take the rest from the file with\n`InferenceDeciderCalibration.fromModel()`. LiteTune 0.5.0's `bundle` prints\nonly the `options:` part of the call; the question is in its `contract.json`.\nA file from LiteTune 0.6.0 records its scoring `method` and needs\n`flutter_edge_ai` 2.5.2; a `fresh_engine` one (LiteTune's Qwen 3.5 rule) is\nrefused by name.\n\n```dart\nimport 'package:flutter_edge_ai\u002Fflutter_edge_ai.dart';\nimport 'package:flutter_edge_ai_litertlm\u002Fflutter_edge_ai_litertlm.dart';\n\nawait FlutterEdgeAi.initialize(inferenceEngines: const [LiteRtLmEngine()]);\nawait FlutterEdgeAi.installModel(\n  modelType: ModelType.gemmaIt,\n  fileType: ModelFileType.litertlm,\n).fromFile(path).install();\n\u002F\u002F CPU or GPU; the NPU is refused. The file's temperature and threshold are\n\u002F\u002F fitted on CPU probabilities: on the GPU the top option matched the CPU's\n\u002F\u002F on 97-100 % of rows measured (Metal, Adreno 830, yes\u002Fno questions only);\n\u002F\u002F Mali, Linux and Windows GPUs and the abstain threshold on the GPU are not\n\u002F\u002F measured. The CPU keeps the calibration as fitted.\nfinal llm = await FlutterEdgeAi.getActiveModel(\n  preferredBackend: PreferredBackend.cpu,\n);\nfinal emotion = await llm.createDecider(\n  question: 'Which emotion does the text express?',\n  options: [\n    DeciderOption('sadness'), DeciderOption('joy'), DeciderOption('love'),\n    DeciderOption('anger'), DeciderOption('fear'), DeciderOption('surprise'),\n  ],\n  calibration: const InferenceDeciderCalibration.fromModel(),\n);\nconst userText = 'im feeling far more mellow than normal';\nfinal answer = await emotion.choose(DeciderInput(EmbeddingInput.text(userText)));\nswitch (answer.questionType) {\n  case DeciderQuestionType.noul:\n    print('P(yes) = ${answer.noul}');\n  case DeciderQuestionType.score:\n    print('level ${answer.expectedLevel} of ${answer.legend}');\n  default:\n    print(answer.choice ?? 'none of these (${answer.abstainReason})');\n}\n```\n\n- The call must be the trained one: another question, a missing or extra\n  option, or another description (one equal to the id is fine) throws\n  `ArgumentError` naming the trained value. Option order is free.\n- Prefer `fromModel()`: explicit temperature, threshold and `noneOption` must\n  equal the file's, which pins the app to one build of the model.\n- A model trained with a \"none of these\" option: with `fromModel()` it may be\n  left out of `options:` (the decider lists it last); when it ranks first the\n  answer abstains with `AbstainReason.noneOption`.\n- The decider borrows the active model: when core closes it (another model or\n  another `maxTokens` requested), the decider is closed too; create it again.\n  On a model from `FlutterEdgeAi.openModel`, closing that model closes it.\n- Options carry no `examples:`: a language-model decider refuses them with\n  `ArgumentError`.\n- A decision whose question and options alone exceed `maxTokens` fails\n  `createDecider` with `DeciderUnsupportedException`; load the model with a\n  larger `maxTokens`.\n- Noul (`no`\u002F`yes`) and Score (levels `0`…`K − 1`) questions never abstain.\n- Text input only, no `among`, no `context`. Input containing chat-template\n  control text (`\u003Cstart_of_turn>`, `\u003Cend_of_turn>`, `\u003Cbos>`, …), or whose\n  prompt does not fit `maxTokens`, throws `ArgumentError` — never truncated.\n- One decision costs one scoring pass per option (176 ms for 6 options on an\n  Apple M4 Pro CPU; LiteTune measured 5.0 s for 55 and 7.2 s for 151 on a server\n  CPU). Many options by topic belong to an embedding decider.\n",{"name":5,"description":7},"main","413ec57cb3e991481b0a91eb658129bf385387ee","packages\u002Fflutter_edge_ai\u002Fskills\u002Fflutter-edge-ai-decisions",180,"https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai","https:\u002F\u002Fflutteredge.ai","https:\u002F\u002Fgithub.com\u002FDenisovAV","Sasha is Flutter, Dart, Firebase and AI GDE, Co-organizer of Flutter Berlin Community, Expert in On-Device AI","2026-11-14 22:02:12",{"source":9,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add DenisovAV\u002Fflutter_edge_ai --skill flutter-edge-ai-decisions",{"tool":71,"command":72},"bunx","bunx skills add DenisovAV\u002Fflutter_edge_ai --skill flutter-edge-ai-decisions",{"tool":74,"command":75},"pnpm","pnpm dlx skills add DenisovAV\u002Fflutter_edge_ai --skill flutter-edge-ai-decisions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai\u002Fskills\u002Fflutter-edge-ai-decisions\u002FSKILL.md",true,[],[80,98,116,133,159,178],{"skillNo":81,"name":82,"nameZh":83,"description":84,"descriptionZh":85,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":86,"categories":87,"keywords":94,"publishedAt":51},"01M6BXTT3TADZ7NN5RY79ZZKDR","send-email","电子邮件发送","Send an email.","发送电子邮件。","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fsend-email\u002FSKILL.md",[88,91],{"categoryNo":89,"categoryName":90,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",{"categoryNo":92,"categoryName":93,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8CA5BYP6JTMPXCGK1Y0G4M3","邮件检索与管理",[95,96,97],"send","send email","email",{"skillNo":99,"name":100,"nameZh":101,"description":102,"descriptionZh":103,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":104,"categories":105,"keywords":110,"publishedAt":51},"01M6BXTQPW2BAVZ2SRVTMFF9FA","query-wikipedia","维基百科摘要查询","Query summary from Wikipedia for a given topic.","查询维基百科中给定主题的摘要。","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fquery-wikipedia\u002FSKILL.md",[106,109],{"categoryNo":107,"categoryName":108,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRK8296DVQW3GCBXC89NVG","网页搜索与信息研究",{"categoryNo":89,"categoryName":90,"taxonomyType":23,"taxonomyTypeDesc":24},[111,112,113,114,115],"wikipedia","query","query wikipedia","for","summary",{"skillNo":117,"name":118,"nameZh":119,"description":120,"descriptionZh":121,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":122,"categories":123,"keywords":128,"publishedAt":51},"01M6BXTN6C4R4FZ5T9GRNY5MFG","qr-code","二维码生成","Generates a QR code for the given url.","为给定的 URL 生成二维码。","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fqr-code\u002FSKILL.md",[124,125],{"categoryNo":89,"categoryName":90,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":126,"categoryName":127,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C04E308NKV6CHWPE092YR2","二维码生成与定制",[129,130,131,114,132],"qr","qr code","code","URL",{"skillNo":134,"name":135,"nameZh":136,"description":137,"descriptionZh":138,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":139,"categories":140,"keywords":147,"publishedAt":51},"01M6BXTJXNJNW59BV5JM3V9YZD","kitchen-adventure","厨房冒险文字游戏","Act as a dungeon master for a text-based adventure set in a world where everyone is a sentient kitchen appliance. Trigger when user says \"start kitchen adventure\".","扮演一款文字冒险游戏的地下城主，故事设定在一个所有人都是有感知能力的厨房电器的世界里。当用户说\"start kitchen adventure\"时触发。","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fkitchen-adventure\u002FSKILL.md",[141,144],{"categoryNo":142,"categoryName":143,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8C8ARDF73H2T1VW2ZV28HK1","游戏设计师",{"categoryNo":145,"categoryName":146,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8CA3WT74BY17JY9YCJY42FJ","创意写作与内容编排",[148,40,149,114,150,151,152,153,154,155,156,157,158],"kitchen adventure","dungeon master","trigger","as","act","world","master","user","text","SET","start",{"skillNo":160,"name":161,"nameZh":162,"description":163,"descriptionZh":164,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":165,"categories":166,"keywords":171,"publishedAt":51},"01M6BXTGEPGG025VBEQKPJZB8S","interactive-map","交互式地图展示","Show an interactive map view for the given location.","为给定位置显示交互式地图视图。","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Finteractive-map\u002FSKILL.md",[167,170],{"categoryNo":168,"categoryName":169,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQQR8A8SERY52S1DD95YW2","地图与位置服务",{"categoryNo":89,"categoryName":90,"taxonomyType":23,"taxonomyTypeDesc":24},[172,173,174,175,176,177,114],"interactive map","interactive","map","view","show","location",{"skillNo":179,"name":180,"nameZh":181,"description":182,"descriptionZh":183,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":184,"categories":185,"keywords":190,"publishedAt":51},"01M6BXTED45RFKX4EYF9BSWC7H","get-current-time","当前日期时间查询","Get the user's current local date, time, and day of the week.","获取用户当前的本地日期、时间和星期几。","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fget-current-time\u002FSKILL.md",[186,187],{"categoryNo":89,"categoryName":90,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":188,"categoryName":189,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9YENBBTPQMH1CHGQPFWJQ","工具调用与实时数据查询",[191,192,193,194,155,195],"current time","get current time","time","get","local"]