-
Notifications
You must be signed in to change notification settings - Fork 173
feat(app): adding Preferences/Wingman for OpenAI and ollama (vibe coded) #1558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: enh-1539/ollama-llm-choice
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # Copilot instructions | ||
|
|
||
| This document provides instructions to the copilot AI assistants for dvorka/mindforger project. | ||
|
|
||
| ## General instructions | ||
|
|
||
| - Always write beautiful, readable, and maintainable code. | ||
| - Handle errors, exceptions, and corner cases. | ||
| - Prefer clarity over cleverness. Optimize only when needed and measured. | ||
| - Always KISS - keep changes small and focused. | ||
| - Always DRY the code - do not duplicate code; create reusable classes, functions and methods; do not repeat yourself. | ||
| - Always add tests alongside code changes. | ||
|
|
||
| ## Functional architecture instructions | ||
|
|
||
| - Contribute to this repository which is the thinking notebook and Markdown IDE desktop. | ||
|
|
||
| ## Technology stack instructions | ||
|
|
||
| - The project is written in C++. | ||
| - The code is portable so that it can be compiled on Linux, Windows and macOS. | ||
| - The application is written using Qt framework. | ||
| - Always use C++ 11 and avoid newer language features. | ||
| - Always start code comments with lowercase letter. | ||
| - Always use `MF_DEBUG` to write debugging output. | ||
| - Always use `_WIN32` to identify Windows specific code. | ||
| - Always use `__APPLE__` to identify macOS specific code. | ||
|
|
||
| ## Code quality instructions | ||
|
|
||
| - Use code formatting style as used in mindforger.cpp - comments, indentatation, parenthesis, namespaces, directives, ... | ||
|
|
||
| ## Repository conventions | ||
|
|
||
| - The project is structured to the library which is then used by Qt application. | ||
| - Library dependencies are stored in `deps/` - each have its own build style. | ||
| - Library code lives under `lib/`. | ||
| - Qt application code lives under `app/`. | ||
| - Tests code lives under `lib/tests/`. | ||
| - Licenses are stored in `licenses/`. | ||
|
|
||
| ## Test instructions | ||
|
|
||
| - Always use `gtest` (Google test) framework to write the test. | ||
| - Each test (function) is structured into 3 sections: `// GIVEN`, `// WHEN`, and `// THEN`. `GIVEN` section prepares the data, `WHEN` section calls the function, and `THEN` section prints results, asserts results and checks results. | ||
| - `THEN` section of the test must have at least one assert statement. | ||
| - Keep tests deterministic. | ||
| - Always use text to indicate success/failure/progress like DONE, ERROR or WIP - never use (unicode) characters like ✓ or ✗. | ||
| - Always print or log intermediate values only when they aid debugging. | ||
| - Always make sure that tests which test new feature or fix are in green. | ||
|
|
||
| ## Build instructions | ||
|
|
||
| - Qt is used to describe the project structure using `*.pro` files and to build it using `qmake`. | ||
| - Makefile to build, test, run and package the project is located in `build/Makefile`. | ||
| - Always use `make help` to find out what are the targets. | ||
|
|
||
| ## Documentation instructions | ||
|
|
||
| - Markdown user documentation sources live under `doc/`. | ||
| - Doxygen documentation can be build using a target defined in `build/Makefile` - use details from that target. | ||
| - Always use `build/Makefile` targets to build the Doxygen documentation. | ||
|
|
||
| ## Continuous Integration instructions | ||
|
|
||
| - GitHub Actions is used as CI for Linux and macOS. | ||
| - AppVeyor is used as CI for Windows. | ||
| - GitHub Actions CI configuration is stored under `.github/workflows/`. | ||
|
|
||
| ## Security and secrets instructions | ||
|
|
||
| - Always use environment variables and secret stores. | ||
| - Always use GitHub actions secrets. | ||
| - Never commit secrets, credentials or sensitive data. | ||
| - Validate, sanitize and anonymize all external inputs. | ||
| - Always run security-focused checks. | ||
| - Always add new license to `licenses/` when you add new direct dependency. | ||
|
|
||
| ## Release versioning instructions | ||
|
|
||
| - Always use semantic versioning: MAJOR.MINOR.PATCH. | ||
| - Note that releases has Git tag like `vMAJOR.MINOR.PATCH`. | ||
| - Note that releases are being developed in `dev-MAJOR.MINOR.PATCH` branches. | ||
| - Note that Git branches use naming convention for fix branch (`bug-NUMBER/DESCRIPTION`), features and enhancements (`feat-NUMBER/DESCRIPTION`) and documentation (`doc-NUMBER/DESCRIPTION`). | ||
| - Note that Conventional commits (conventionalcommits.org) are used for the commit messages. | ||
| - Always update change log stored in `Changelog` whenever you do a fix, change, or enhancement. | ||
| - Always make sure that the version is consistent in `app_info.h`, `Makefile`, `debian/debian-make-deb.sh`, `debian/changelog`, `macos/env.h`, `snap/snapcraft.yaml`, `tarball/tarball-build.sh` and `ubuntu/debian/changelog` - `app_info.h.py` is the one and only authoritative version source. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| /* | ||
| add_llm_provider_dialog.cpp MindForger thinking notebook | ||
|
|
||
| Copyright (C) 2016-2026 Martin Dvorak <martin.dvorak@mindforger.com> | ||
|
|
||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU General Public License | ||
| as published by the Free Software Foundation; either version 2 | ||
| of the License, or (at your option) any later version. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| #include "add_llm_provider_dialog.h" | ||
|
|
||
| namespace m8r { | ||
|
|
||
| using namespace std; | ||
|
|
||
| AddLlmProviderDialog::AddLlmProviderDialog(QWidget* parent) | ||
| : QDialog(parent), | ||
| selectedProviderType(WINGMAN_PROVIDER_NONE) | ||
| { | ||
| questionLabel = new QLabel(tr("Which provider do you want to configure?"), this); | ||
|
|
||
| providerTypeCombo = new QComboBox(this); | ||
| providerTypeCombo->addItem(tr("OpenAI"), WINGMAN_PROVIDER_OPENAI); | ||
| providerTypeCombo->addItem(tr("ollama"), WINGMAN_PROVIDER_OLLAMA); | ||
|
|
||
| nextButton = new QPushButton(tr("Next >"), this); | ||
| nextButton->setDefault(true); | ||
|
|
||
| cancelButton = new QPushButton(tr("Cancel"), this); | ||
|
|
||
| // layout | ||
| QVBoxLayout* mainLayout = new QVBoxLayout(this); | ||
| mainLayout->addWidget(questionLabel); | ||
| mainLayout->addWidget(providerTypeCombo); | ||
|
|
||
| QHBoxLayout* buttonLayout = new QHBoxLayout(); | ||
| buttonLayout->addStretch(); | ||
| buttonLayout->addWidget(cancelButton); | ||
| buttonLayout->addWidget(nextButton); | ||
|
|
||
| mainLayout->addLayout(buttonLayout); | ||
| setLayout(mainLayout); | ||
|
|
||
| // signals | ||
| QObject::connect(nextButton, &QPushButton::clicked, this, &AddLlmProviderDialog::handleNext); | ||
| QObject::connect(cancelButton, &QPushButton::clicked, this, &QDialog::reject); | ||
|
|
||
| // dialog | ||
| setWindowTitle(tr("New LLM Provider")); | ||
| resize(fontMetrics().averageCharWidth()*55, height()); | ||
| setModal(true); | ||
| } | ||
|
|
||
| AddLlmProviderDialog::~AddLlmProviderDialog() | ||
| { | ||
| } | ||
|
|
||
| void AddLlmProviderDialog::show() | ||
| { | ||
| providerTypeCombo->setCurrentIndex(0); | ||
| selectedProviderType = WINGMAN_PROVIDER_NONE; | ||
|
|
||
| QDialog::show(); | ||
| } | ||
|
|
||
| void AddLlmProviderDialog::handleNext() | ||
| { | ||
| selectedProviderType = static_cast<WingmanLlmProviders>( | ||
| providerTypeCombo->itemData(providerTypeCombo->currentIndex()).toInt()); | ||
|
|
||
| accept(); | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||||||||||
| /* | ||||||||||||||
| add_llm_provider_dialog.h MindForger thinking notebook | ||||||||||||||
|
|
||||||||||||||
| Copyright (C) 2016-2026 Martin Dvorak <martin.dvorak@mindforger.com> | ||||||||||||||
|
|
||||||||||||||
| This program is free software; you can redistribute it and/or | ||||||||||||||
| modify it under the terms of the GNU General Public License | ||||||||||||||
| as published by the Free Software Foundation; either version 2 | ||||||||||||||
| of the License, or (at your option) any later version. | ||||||||||||||
|
|
||||||||||||||
| This program is distributed in the hope that it will be useful, | ||||||||||||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||||
| GNU General Public License for more details. | ||||||||||||||
|
|
||||||||||||||
| You should have received a copy of the GNU General Public License | ||||||||||||||
| along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||
| */ | ||||||||||||||
| #ifndef M8RUI_ADD_LLM_PROVIDER_DIALOG_H | ||||||||||||||
| #define M8RUI_ADD_LLM_PROVIDER_DIALOG_H | ||||||||||||||
|
|
||||||||||||||
| #include <QtWidgets> | ||||||||||||||
|
|
||||||||||||||
| #include "../../lib/src/config/configuration.h" | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The relative include Severity: high Other Locations
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||||||||||||||
|
|
||||||||||||||
| namespace m8r { | ||||||||||||||
|
|
||||||||||||||
| class AddLlmProviderDialog : public QDialog | ||||||||||||||
| { | ||||||||||||||
| Q_OBJECT | ||||||||||||||
|
|
||||||||||||||
| private: | ||||||||||||||
| QLabel* questionLabel; | ||||||||||||||
| QComboBox* providerTypeCombo; | ||||||||||||||
| QPushButton* nextButton; | ||||||||||||||
| QPushButton* cancelButton; | ||||||||||||||
|
|
||||||||||||||
| WingmanLlmProviders selectedProviderType; | ||||||||||||||
|
|
||||||||||||||
| public: | ||||||||||||||
| explicit AddLlmProviderDialog(QWidget* parent); | ||||||||||||||
| AddLlmProviderDialog(const AddLlmProviderDialog&) = delete; | ||||||||||||||
| AddLlmProviderDialog(const AddLlmProviderDialog&&) = delete; | ||||||||||||||
| AddLlmProviderDialog& operator=(const AddLlmProviderDialog&) = delete; | ||||||||||||||
| AddLlmProviderDialog& operator=(const AddLlmProviderDialog&&) = delete; | ||||||||||||||
|
Comment on lines
+43
to
+45
|
||||||||||||||
| AddLlmProviderDialog(const AddLlmProviderDialog&&) = delete; | |
| AddLlmProviderDialog& operator=(const AddLlmProviderDialog&) = delete; | |
| AddLlmProviderDialog& operator=(const AddLlmProviderDialog&&) = delete; | |
| AddLlmProviderDialog(AddLlmProviderDialog&&) = delete; | |
| AddLlmProviderDialog& operator=(const AddLlmProviderDialog&) = delete; | |
| AddLlmProviderDialog& operator=(AddLlmProviderDialog&&) = delete; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Copilot project instructions claim tests live under
lib/tests/, but this repo useslib/test/(and the design doc also referenceslib/test/src/...). Update this path to avoid steering contributors/tools to a non-existent directory.