Skip to content

update working branch#419

Merged
marc-romu merged 5 commits intofeature/2.0.0-text2jsonfrom
dev
Mar 26, 2026
Merged

update working branch#419
marc-romu merged 5 commits intofeature/2.0.0-text2jsonfrom
dev

Conversation

@marc-romu
Copy link
Copy Markdown
Member

No description provided.

marc-romu and others added 5 commits March 26, 2026 21:12
…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.
Copilot AI review requested due to automatic review settings March 26, 2026 22:38
@marc-romu marc-romu merged commit 3faf562 into feature/2.0.0-text2json Mar 26, 2026
9 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 date to filtered Discourse post JSON (aliasing created_at) and include post URL in *_forum_post_summarize results.
  • Extend the McNeel Forum Post Summarize component worker to persist URL outputs.
  • Add/update documentation entries (new img2text tool 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 thread CHANGELOG.md
Comment on lines +10 to +14
Many thanks to the following contributors to this release:

- [marc-romu](https://github.com/marc-romu)

----
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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].

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants