pi-vision-handoff 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vision-handoff.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-vision-handoff",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Give text-only pi models vision — describe images with a vision model you pick via an interactive picker, then hand off the text description to non-vision models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Tom X Nguyen",
|
package/vision-handoff.ts
CHANGED
|
@@ -816,6 +816,29 @@ async function showSelector(ctx: ExtensionCommandContext): Promise<void> {
|
|
|
816
816
|
.getAll()
|
|
817
817
|
.map((m) => ({ provider: m.provider, id: m.id, name: m.name, input: m.input, reasoning: m.reasoning }));
|
|
818
818
|
|
|
819
|
+
if (ctx.mode !== "tui") {
|
|
820
|
+
const modelItems = ["None", ...allModels.map((m) => `${m.provider}/${m.id}`)];
|
|
821
|
+
const modelPick = await ctx.ui.select("Vision model", modelItems);
|
|
822
|
+
if (modelPick === undefined) return;
|
|
823
|
+
const ref = modelPick === "None" ? null : modelPick;
|
|
824
|
+
const thinkingPick = await ctx.ui.select("Thinking", ["on", "off"]);
|
|
825
|
+
if (thinkingPick === undefined) return;
|
|
826
|
+
const thinking = thinkingPick === "on";
|
|
827
|
+
const thinkingLevel = config.thinkingLevel;
|
|
828
|
+
const thinkingNote = thinking
|
|
829
|
+
? `thinking on (${thinkingLevel})${ref ? " \u2014 applies only if the vision model supports reasoning" : ""}`
|
|
830
|
+
: "thinking off";
|
|
831
|
+
updateConfig(
|
|
832
|
+
ctx,
|
|
833
|
+
(c) => ({ ...c, visionModel: ref, thinking, thinkingLevel }),
|
|
834
|
+
ref ? `Vision model set to ${ref} \u00b7 ${thinkingNote}` : `Vision model cleared \u00b7 ${thinkingNote}`,
|
|
835
|
+
);
|
|
836
|
+
if (!ref) {
|
|
837
|
+
ctx.ui.notify("Handoff is inactive until you pick a vision model.", "warning");
|
|
838
|
+
}
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
|
|
819
842
|
const result = await ctx.ui.custom<VisionModelSelectorResult>((tui, theme, _kb, done) => {
|
|
820
843
|
const selector = new VisionModelSelectorComponent(
|
|
821
844
|
theme,
|