Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ed4aaa0
feat(release): 0.3.0-alpha with AI tools, UI enhancement, security en…
marc-romu Apr 27, 2025
56d1dea
feat(aichat): enhanced ai chat with timestamp, visual errors, and spe…
marc-romu Apr 27, 2025
fe84a1b
feat(aichat): enhanced ai chat with inlinne metrics per message
marc-romu Apr 27, 2025
4926521
feat(aichat): button to copy codeblocks to clipboard
marc-romu Apr 27, 2025
f322c8b
docs
marc-romu Apr 27, 2025
41066fe
fix(aitools): incorrect tool format being sent to providers
marc-romu Apr 27, 2025
e1feed9
fix(openai): issue with tool calls
marc-romu Apr 27, 2025
cc4e373
fix(aichat): metrics tooltip not showing in place
marc-romu Apr 27, 2025
3473ea5
feat(aichat): restored missed mcneel forum webtools
marc-romu Apr 28, 2025
a4b5e0c
feat: add GitHub Actions workflows for badge management in main
marc-romu Apr 28, 2025
1520c92
feat: add GitHub Actions workflows for badge management in main (#187)
marc-romu Apr 28, 2025
5b456ad
ci: autodelete also ci, release, feature, hotfix and bugfix branches
marc-romu Apr 28, 2025
a45300f
ci: autodelete also ci, release, feature, hotfix and bugfix branches …
marc-romu Apr 28, 2025
1e4233b
feat(aichat): well formatted copying of messages
marc-romu Apr 28, 2025
c6ea8e3
chore: remove date from version for main release
actions-user Apr 28, 2025
0d8e104
Merge branch 'main' into release/0.3.0-beta
marc-romu Apr 28, 2025
03b9115
fix: ci-dotnet-tests being called twice
marc-romu Apr 28, 2025
b6fee1b
refactor: limit search_rhino_forum tool call to 10 results
marc-romu Apr 28, 2025
4d0dee3
fix(aichat): tooltip was not visible in the last message because it w…
marc-romu Apr 28, 2025
fcdd737
Potential fix for code scanning alert no. 14: DOM text reinterpreted …
marc-romu Apr 28, 2025
2c035b7
docs: update changelog with 1 closed issues
actions-user Apr 28, 2025
7cda954
refactor(aichat): enhanced status label in aichat component to match …
marc-romu Apr 28, 2025
e297f04
Merge branch 'release/0.3.0-beta' of https://github.com/architects-to…
marc-romu Apr 28, 2025
f40f706
chore: remove date from version for main release
actions-user Apr 28, 2025
f8b5b88
fix(aichat): incorrect tooltip position
marc-romu Apr 28, 2025
f5c0d9e
Merge branch 'release/0.3.0-beta' of https://github.com/architects-to…
marc-romu Apr 28, 2025
bb0888f
fix(aichat): copy messages format when author and date are not includ…
marc-romu Apr 29, 2025
96429b9
Release/0.3.0 beta (#189)
marc-romu Apr 29, 2025
3d46431
Merge branch 'dev' into main
marc-romu Apr 29, 2025
bc15b44
docs: update version badge for main
actions-user Apr 29, 2025
d917348
docs: update version badge for main to 0.3.1-dev.250429 (#192)
marc-romu Apr 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
color: "DDA0DD"
description: "Requires more details to proceed"
- name: "status: needs triage"
color: "9E4B18"
color: "0E8A16"
description: "Ready for triage"
- name: "status: help wanted"
color: "E9C6C2"
Expand All @@ -59,6 +59,12 @@
- name: "component: AI TextGenerate"
color: "000"
description: "Issues related to the AI Text Generate component"
- name: "component: AI ScriptEvaluate"
color: "000"
description: "Issues related to the AI Script Evaluate component"
- name: "component: AI ScriptGenerate"
color: "000"
description: "Issues related to the AI Script Generate component"
- name: "component: AI ListEvaluate"
color: "000"
description: "Issues related to the AI List Evaluate component"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/chore-version-badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ name: 🔄 Update Version Badge
on:
workflow_dispatch:
push:
branches: [ main, dev ]
branches:
- main
- dev
- release/*
paths:
- 'Solution.props'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🔄 Update Development Version Date
name: 🔄 Update Version Date

# Description: This workflow automatically updates the date component in development versions
# when changes are pushed to development branches. It creates a PR with the updated date
# Description: This workflow automatically updates the date component
# when the version includes it. It creates a PR with the updated date
# to ensure the version reflects the latest changes.
#
# Triggers:
Expand All @@ -14,7 +14,9 @@ name: 🔄 Update Development Version Date

on:
push:
branches: [ dev ]
branches:
- dev
- release/*
paths:
- '**/*.cs'
- '**/*.csproj'
Expand Down Expand Up @@ -81,7 +83,7 @@ jobs:
uses: ./.github/actions/versioning/calculate-version
with:
version: ${{ steps.current-version.outputs.version }}
increment: auto-date
increment: date
change-pre-release: none

# Only proceed if the date was actually updated
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/chore-version-main-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 🔄 Remove Release Version Date

# Description: Automatically strips the date component from the version in Solution.props
# when a pull request targets the main branch. Commits the updated version back to the PR branch.

on:
pull_request:
branches: [ main ]
paths:
- 'Solution.props'
workflow_dispatch:

permissions:
contents: write

jobs:
remove-release-date:
name: 🔄 Remove Release Version Date
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Get current version
id: get-version
uses: ./.github/actions/versioning/get-version

- name: Strip date from version
id: strip-date
shell: bash
run: |
VERSION="${{ steps.get-version.outputs.version }}"
echo "Original version: $VERSION"
if [[ "$VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-([a-zA-Z0-9]+)\.[0-9]{6}$ ]]; then
BASE="${BASH_REMATCH[1]}"
PRE="${BASH_REMATCH[2]}"
NEW_VERSION="$BASE-$PRE"
else
echo "No date suffix to remove, version unchanged"
NEW_VERSION="$VERSION"
fi
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Update version in Solution.props
uses: ./.github/actions/versioning/update-version
with:
new-version: ${{ steps.strip-date.outputs.new-version }}

- name: Commit and push changes
if: steps.strip-date.outputs.new-version != steps.get-version.outputs.version
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add Solution.props
git commit -m "chore: remove date from version for main release"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
7 changes: 4 additions & 3 deletions .github/workflows/ci-dotnet-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: 🧪 .NET CI

# Description: This workflow runs .NET tests on the SmartHopper solution to ensure that changes do not break functionality.
#
# Triggers:
Expand All @@ -10,10 +11,10 @@ name: 🧪 .NET CI
# - pull-requests: read - Required to read pull request information

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- main
- release/*

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-issue-labels-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: 🏷️ Close Issue on Close Label

on:
issues:
types: [labeled]
types: [ labeled ]

permissions:
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-issue-labels-on-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: 🏷️ Update Issue Labels on Close

on:
issues:
types: [closed]
types: [ closed ]

permissions:
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-block-dev-to-main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: 📦 Block Dev Release to Main
name: 🚫 Block Dev Release to Main

# Description: This workflow blocks development release versions from being merged into the main branch.
# It checks for the presence of "-dev" in the version number and prevents the merge if found.
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/pr-delete-auto-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ on:
pull_request:
types:
- closed

permissions:
contents: write

jobs:
delete-auto-branches:
name: Delete auto branches
if: |
startsWith(github.event.pull_request.head.ref, 'update-branch/') ||
startsWith(github.event.pull_request.head.ref, 'chore/update-dev-version-date-') ||
startsWith(github.event.pull_request.head.ref, 'docs/update-version-badge-')
startsWith(github.event.pull_request.head.ref, 'docs/update-version-badge-') ||
startsWith(github.event.pull_request.head.ref, 'ci/') ||
startsWith(github.event.pull_request.head.ref, 'release/') ||
startsWith(github.event.pull_request.head.ref, 'feature/') ||
startsWith(github.event.pull_request.head.ref, 'hotfix/') ||
startsWith(github.event.pull_request.head.ref, 'bugfix/')
runs-on: ubuntu-latest
steps:
- name: Delete branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: 🏁 Create Release on Milestone Close

on:
milestone:
types: [closed]
types: [ closed ]

jobs:
create-release:
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added the "Accepted feature request: Allow for copy-paste the chat in a good format when selecting the text" ([#86](https://github.com/architects-toolkit/SmartHopper/issues/86)).

### Changed

- Improved chat UI with timestamps for messages, collapsible tool messages, inline metrics per message, button to copy codeblocks to clipboard, and better formatting.

### Fixed

- Fixed issue with tool calls in chat messages. Now the code provides exactly the json structure expected by MistralAI and OpenAI.
- Fixed tooltip visibility at the bottom of the chat.

## [0.3.0-alpha] - 2025-04-27

Expand All @@ -34,7 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Renamed the 'Branches Input' and 'Processed Branches' parameters to 'Data Count' and 'Iterations Count' in DeconstructMetricsComponents. Improved descriptions for both parameters.
- Renamed the 'Branches Input' and 'Processed Branches' parameters to 'Data Count' and 'Iterations Count' in `DeconstructMetricsComponents`. Improved descriptions for both parameters.
- Modified `FilterListAsync` in `ListTools` to return indices instead of filtered list items, with `AIListFilter` component now handling the final list construction.
- Renamed `GhGetSelectedComponents` (GhGetSel) to `GhGetComponents`.
- Moved `GhGet` execution logic to external tools managed by `ToolManager`.
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SmartHopper - AI-Powered Grasshopper3D Plugin

[![Version](https://img.shields.io/badge/version-0%2E3%2E1--dev%2E250428-brown)](https://github.com/architects-toolkit/SmartHopper/releases)
[![Version](https://img.shields.io/badge/version-0%2E3%2E1--dev%2E250429-brown)](https://github.com/architects-toolkit/SmartHopper/releases)
[![Status](https://img.shields.io/badge/status-Unstable%20Development-brown)](https://github.com/architects-toolkit/SmartHopper/releases)
[![Test results](https://img.shields.io/github/actions/workflow/status/architects-toolkit/SmartHopper/.github/workflows/ci-dotnet-tests.yml?label=.NET%20CI&logo=dotnet)](https://github.com/architects-toolkit/SmartHopper/actions/workflows/ci-dotnet-tests.yml)
[![Grasshopper](https://img.shields.io/badge/plugin_for-Grasshopper3D-darkgreen?logo=rhinoceros)](https://www.rhino3d.com/)
Expand Down Expand Up @@ -43,14 +43,16 @@ SmartHopper is not yet available through Food4Rhino. We will be releasing it soo
| AI Grasshopper Generate Definitions (AIGhGenerate)<br><sub>Automatically generate Grasshopper definitions using AI</sub> | ⚪ | - | - | - |
| AI Text Evaluate (AiTextEvaluate)<br><sub>Return a boolean from a text content using AI-powered checks</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| AI Text Generate (AiTextGenerate)<br><sub>Generate text content using AI language models</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| AI Script Evaluate (AiScriptEvaluate)<br><sub>Return a boolean from the evaluation of a script, using AI-powered checks</sub> | ⚪ | - | - | - |
| AI Script Generate (AiScriptGenerate)<br><sub>Generate a script using AI language models</sub> | ⚪ | - | - | - |
| AI List Evaluate (AiListEvaluate)<br><sub>Return a boolean from a list of elements using AI analysis</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| AI List Filter (AiListFilter)<br><sub>Process items in lists (reorder, shuffle, filter, etc.) based on AI-driven rules</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| AI List Generate (AiListGenerate)<br><sub>Generate lists dynamically using AI algorithms</sub> | ⚪ | - | - | - |
| AI GroupTitle (AiGroupTitle)<br><sub>Group components and set a meaningful title to the group</sub> | ⚪ | - | - | - |
| AI File Context (AiFileContext)<br><sub>Set a context for the current document</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| AI Chat (AiChat)<br><sub>Interactive AI-powered conversational interface</sub> | ⚪ | 🟡 | - | - |
| AI Chat Input (AiChatInput)<br><sub>Send some data from your Grasshopper to the AI Chat</sub> | ⚪ | - | - | - |
| AI Chat Output (AiChatOutput)<br><sub>Receive some data from the AI Chat to your Grasshopper</sub> | ⚪ | - | - | - |
| AI GroupTitle (AiGroupTitle)<br><sub>Group components and set a meaningful title to the group</sub> | ⚪ | - | - | - |
| AI File Context (AiFileContext)<br><sub>Set a context for the current document</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| Context Parameters (ContextParameters)<br><sub>Set context parameters for the AI component</sub> | ⚪ | - | - | - |
| Deconstruct Metrics (DeconstructMetrics)<br><sub>Break down the usage metrics into individual values</sub> | ⚪ | 🟡 | 🟠 | 🟢 |
| Save GhJSON file (SaveGhJSON)<br><sub>Save the current Grasshopper file as a GhJSON format</sub> | ⚪ | - | - | - |
Expand Down
2 changes: 1 addition & 1 deletion Solution.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<SolutionVersion>0.3.1-dev.250428</SolutionVersion>
<SolutionVersion>0.3.1-dev.250429</SolutionVersion>
</PropertyGroup>
</Project>
8 changes: 4 additions & 4 deletions src/SmartHopper.Components/AI/AIChatComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public override async System.Threading.Tasks.Task DoWorkAsync(CancellationToken
this.lastResponse = chatWorker.GetLastResponse();

Debug.WriteLine("[AIChatWorker] Web chat worker completed");
this.progressReporter?.Invoke("Web chat completed");
// this.progressReporter?.Invoke("Web chat completed");
}
catch (Exception ex)
{
Expand All @@ -189,7 +189,7 @@ public override async System.Threading.Tasks.Task DoWorkAsync(CancellationToken
/// <param name="message">Output message.</param>
public override void SetOutput(IGH_DataAccess DA, out string message)
{
message = "Web chat completed";
message = "Ready";

if (this.lastResponse != null)
{
Expand All @@ -200,13 +200,13 @@ public override void SetOutput(IGH_DataAccess DA, out string message)
// Store metrics for the base class to output
this.component.StoreResponseMetrics(this.lastResponse);

message = $"Web chat completed. Used {this.lastResponse.InTokens} input tokens, {this.lastResponse.OutTokens} output tokens.";
message = $"Ready";
}
else
{
// Set empty output if no response
this.component.SetPersistentOutput("Last Response", new GH_String(string.Empty), DA);
message = "Web chat completed without a response.";
message = "Ready";
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/SmartHopper.Config/Interfaces/AIProviderSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ namespace SmartHopper.Config.Interfaces
public interface IAIProviderSettings
{
Control CreateSettingsControl();

Dictionary<string, object> GetSettings();

void LoadSettings(Dictionary<string, object> settings);

bool ValidateSettings();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* SmartHopper - AI-powered Grasshopper Plugin
* Copyright (C) 2024 Marc Roca Musach
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
*
* Portions of this code adapted from:
* https://github.com/agreentejada/winforms-chat
* MIT License
Expand All @@ -21,39 +21,33 @@ namespace SmartHopper.Config.Models
public interface IChatModel
{
bool Inbound { get; set; }

bool Read { get; set; }

DateTime Time { get; set; }

string Author { get; set; }

string Type { get; }
string ToolName { get; set; }
string ToolArgs { get; set; }
string ToolCallId { get; set; }
}

public class TextChatModel : IChatModel
public class ChatMessageModel : IChatModel
{
public bool Inbound { get; set; }
public bool Read { get; set; }
public DateTime Time { get; set; }
public string Author { get; set; }
public string Type { get; set; } = "text";
public string Body { get; set; }
public string ToolName { get; set; } = "";
public string ToolArgs { get; set; } = "";
public string ToolCallId { get; set; } = "";
}

public class ToolChatModel : IChatModel
{
public bool Inbound { get; set; }
public bool Read { get; set; }

public DateTime Time { get; set; }
public string Author { get; set; }

public required string Author { get; set; }

public string Type { get; set; } = "text";
public string Body { get; set; }
public string ToolName { get; set; } = "";
public string ToolArgs { get; set; } = "";
public string ToolCallId { get; set; } = "";
public List<KeyValuePair<string, string>> ToolResult { get; set; }

public required string Body { get; set; }

/// <summary>
/// Gets or sets list of tool calls associated with this message.
/// </summary>
public List<AIToolCall> ToolCalls { get; set; } = new List<AIToolCall>();
}
}
Loading
Loading