update working branch#419
Merged
marc-romu merged 5 commits intofeature/2.0.0-text2jsonfrom Mar 26, 2026
Merged
Conversation
…onversion, and AI settings components (#416) ## Description This PR introduces major new capabilities to SmartHopper including asynchronous batch processing for cost-efficient AI operations, vision/image understanding support, file-to-markdown conversion tools, and a new flexible AI settings system. ### Key Features **Batch API Support** - Implemented `IAIBatchProvider` in OpenAI, Anthropic, and MistralAI providers for asynchronous batch processing - Multi-item queue system with `BuildRequest` delegate for request aggregation without immediate execution - Live progress counter during batch polling with per-provider completed count tracking - Batch state persistence across file save/close/reopen cycles via `Write`/`Read` in `AIStatefulAsyncComponentBase` - `ReconstructOutputTree<T>` helper to restore results into Grasshopper data trees using sentinel placeholders **Vision Input Support** - New `AIInteractionImage` with `CreateVisionInput()` and `CreateVisionInputFromBase64()` methods - `AIBodyBuilder.AddImageInput()` fluent methods for vision requests - Provider implementations: OpenAI (base64 data URI), Anthropic (image content blocks), MistralAI (OpenAI-compatible) - New `img_to_text` AI tool for image description/analysis with `AICapability.Image2Text` - New `GH_ExtractedImage` goo type carrying `Base64Data`, `MimeType`, `Id`, `Context`, and `PageOrSlide` - New `AIImgToTextComponent` standalone component for vision-based image description - `FileToMdComponent` and `AIFileToMdComponent` with image extraction and multiple display modes (embed/describe/caption) **File-to-Markdown & Web-to-Markdown Conversion** - New `file_to_md` AI tool supporting 12 formats (PDF, DOCX, XLSX, PPTX, HTML, CSV, JSON, XML, TXT, EML, EPUB, RTF) - PDF conversion with layout intelligence (column detection, reading order, header/footer removal, table detection) - Office document conversion preserving headings, tables, lists, and formatting - `web_to_md` tool with specialized handlers for Wikipedia, GitHub, GitLab, Discourse, Stack Exchange - `FileToMdComponent` (stateless) and `WebToMdComponent` for canvas-based conversion **AI Settings Components** - New `AISettingsComponent` assembling `AIRequestParameters` from universal inputs (Model, Temperature, Max Tokens, Top P, Seed, Batch) - New `AIExtraSettingsComponent` with dynamically generated inputs driven by provider-specific descriptors - `AIRequestParameters` immutable record with fluent `AIRequestParametersBuilder` - `GH_AIRequestParameters` goo wrapper with backwards-compatible string casting - `AIExtraDescriptor` for provider-specific parameter definitions - Per-property resolution in all providers (values from `AIRequestParameters` first, falling back to global settings) - New `BatchTier` boolean property replacing the `service_tier=batch` extra **Prompt Caching** - Added prompt caching support in OpenAI, Anthropic, and OpenRouter providers via extra descriptors ### Breaking Changes - `IAIBatchProvider.SubmitBatchAsync` signature changed from single-item to multi-item `(IReadOnlyList<(string CustomId, AIRequestCall Request)>, CancellationToken)` - `AIBatchStatus.ResultBody` replaced by `Results` (`IReadOnlyDictionary<string, JObject>`) - `OnBatchCompleted` signature changed from `(AIReturn)` to `(IReadOnlyDictionary<string, JObject>)` - `AIStatefulAsyncComponentBase` `Model (M)` input replaced by `Settings (S)` generic parameter - `service_tier` extra descriptor removed from OpenAI, Anthropic, and MistralAI providers (use `BatchTier` instead) ### Testing Done - Batch processing tested with OpenAI, Anthropic, and MistralAI providers NOT already tested: - Vision input with base64 and URL-based images - File-to-markdown conversion across all supported formats - AI settings components with all five providers ## Checklist - [x] This PR is focused on a single feature or bug fix (well, a coordinated set of features) - [x] Version in Solution.props was updated (1.5.0-dev) - [x] CHANGELOG.md has been updated - [x] PR title follows Conventional Commits format - [x] PR description follows Pull Request Description Template
… whitespace - Change component display names from 'Ai' to 'AI' prefix in DEV.md table - Rename `img_to_text.md` to `img2text.md` to match new tool naming convention - Remove trailing whitespace from CHANGELOG.md - Add `resultUrls` field to `AIMcNeelForumPostSummarizeWorker` (unused variable) - Add `url` field to post summary JSON output in `DiscourseToolsBase` - Add `date` field mapping from `created_at` in `DiscourseUtils.Filter
…onvention (#417) ## Description This PR introduces a breaking change to standardize AI tool and component naming conventions for improved clarity and consistency. ### AI Tools Renamed (old → new): - `text_generate` → `text2text` - `text_evaluate` → `text2boolean` - `list_generate` → `text2textlist` - `list_evaluate` → `textlist2boolean` - `img_generate` → `text2img` - `img_to_text` → `img2text` - `file_to_md` → `file2md` - `web_to_md` → `web2md` - `web_generic_page_read` → **REMOVED** (use `web2md` instead) ### Components Renamed (class and file names changed): - `AITextGenerate` → `AIText2TextComponent` - `AITextEvaluate` → `AIText2BooleanComponent` - `AITextListGenerate` → `AIText2TextListComponent` - `AIListEvaluate` → `AIList2BooleanComponent` - `AIImgGenerateComponent` → `AIText2ImgComponent` - `AIImgToTextComponent` → `AIImg2TextComponent` - `AIFileToMdComponent` → `AIFile2MdComponent` - `WebPageReadComponent` → **REMOVED** (use `Web2MdComponent` instead) ## Breaking Changes All existing Grasshopper definitions using the old component names will need to be updated. The new naming follows a consistent pattern: `input2output` format for tools and `AI{Input}2{Output}Component` format for components. ## Testing Done (not tested) ## Checklist - [x] This PR is focused on a single feature or bug fix - [x] Version in Solution.props was updated, if necessary, and follows semantic versioning - [x] CHANGELOG.md has been updated - [x] PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.1.0/) format - [x] PR description follows [Pull Request Description Template](https://github.com/architects-toolkit/SmartHopper/blob/main/CONTRIBUTING.md#pull-request-description-template)
This PR updates the contributors section in CHANGELOG.md under [Unreleased] to acknowledge new contributors since the last release. This is an automated PR created by the Update Contributors workflow.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Discourse post summarization outputs to include a usable date field and a post url, and aligns developer documentation/tool naming with the newer *2* tool naming scheme.
Changes:
- Add
dateto filtered Discourse post JSON (aliasingcreated_at) and include post URL in*_forum_post_summarizeresults. - Extend the McNeel Forum Post Summarize component worker to persist URL outputs.
- Add/update documentation entries (new
img2texttool doc, DEV table capitalization, and changelog edits).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/SmartHopper.Core.Grasshopper/AITools/DiscourseUtils.cs | Adds date field to the filtered post JSON payload. |
| src/SmartHopper.Core.Grasshopper/AITools/DiscourseToolsBase.cs | Builds a post URL from topic_id/post_number and returns it in summary tool output. |
| src/SmartHopper.Components/Knowledge/AIMcNeelForumPostSummarizeComponent.cs | Adds a worker field to store URL result trees. |
| docs/Tools/img2text.md | Adds documentation for the image-to-text tool (needs naming/source/reference alignment). |
| DEV.md | Normalizes component names/casing in the development status table. |
| CHANGELOG.md | Adds contributor acknowledgment and minor formatting edits under [Unreleased]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10
to
+14
| Many thanks to the following contributors to this release: | ||
|
|
||
| - [marc-romu](https://github.com/marc-romu) | ||
|
|
||
| ---- |
There was a problem hiding this comment.
This “contributors to this release” note is placed under the [Unreleased] section, which can be confusing since it reads like a finalized release acknowledgment. Consider moving it into the next versioned release entry, or rewording it to “upcoming release” while still under [Unreleased].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.