Skip to content
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

Remove unnecessary PathBuf usage in set_openai_api_key.rs #139

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

takanotume24
Copy link
Owner

  • Changed the way the configuration path is constructed by directly using the home directory.
  • Removed the import of PathBuf as it is no longer needed, simplifying the code.

- Changed the way the configuration path is constructed by directly using the home directory.
- Removed the import of PathBuf as it is no longer needed, simplifying the code.
@takanotume24 takanotume24 marked this pull request as ready for review December 19, 2024 12:42
@takanotume24 takanotume24 merged commit 74456d6 into develop Dec 19, 2024
14 checks passed
@takanotume24
Copy link
Owner Author

close #136

takanotume24 added a commit that referenced this pull request Dec 19, 2024
* Create rust-clippy.yml

* Remove double builds when creating release packages

* Refactor CI workflow: Simplify test and publish jobs

- Removed the matrix strategy from the test-tauri job which included multiple platforms.
- Consolidated steps in the publish-tauri job to improve clarity and maintainability.
- Introduced Rust caching using Swatinem/rust-cache@v2 for faster builds.
- Ensured dependencies are installed consistently across jobs with less redundancy.

* Improve rust-clippy workflow configuration

- Updated cron schedule syntax for consistency
- Cleaned up run command formatting for better readability
- Added working-directory specification for SARIF processing

* Refactor GitHub Actions workflow for Rust Clippy

- Moved the installation of required cargo dependencies (clippy-sarif, sarif-fmt) to the src-tauri directory for better organization.
- Updated the path for the SARIF file upload to ensure it points to the correct location within the src-tauri directory.
- Removed redundant installation steps in the workflow.

* Improved installation instructions in README.md (#114)

- Restructured the installation section for clarity.
- Added a sequential list of steps for downloading/building the Cuuri binary.
- Clarified the process for registering the OpenAI API key.

* Update README.md to include npm install step and change repository directory (#115)

* build(deps): bump chrono from 0.4.38 to 0.4.39 in /src-tauri (#116)

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.38 to 0.4.39.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](chronotope/chrono@v0.4.38...v0.4.39)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @vue/devtools from 7.6.7 to 7.6.8 (#120)

Bumps [@vue/devtools](https://github.com/vuejs/devtools/tree/HEAD/packages/devtools) from 7.6.7 to 7.6.8.
- [Release notes](https://github.com/vuejs/devtools/releases)
- [Commits](https://github.com/vuejs/devtools/commits/v7.6.8/packages/devtools)

---
updated-dependencies:
- dependency-name: "@vue/devtools"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump marked from 15.0.3 to 15.0.4 (#119)

Bumps [marked](https://github.com/markedjs/marked) from 15.0.3 to 15.0.4.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](markedjs/marked@v15.0.3...v15.0.4)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump tauri-plugin-shell from 2.0.2 to 2.2.0 in /src-tauri (#122)

Bumps [tauri-plugin-shell](https://github.com/tauri-apps/plugins-workspace) from 2.0.2 to 2.2.0.
- [Release notes](https://github.com/tauri-apps/plugins-workspace/releases)
- [Commits](tauri-apps/plugins-workspace@fs-v2.0.2...os-v2.2.0)

---
updated-dependencies:
- dependency-name: tauri-plugin-shell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump vite from 6.0.2 to 6.0.3 (#117)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump serde from 1.0.215 to 1.0.216 in /src-tauri (#121)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.215 to 1.0.216.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.215...v1.0.216)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @tauri-apps/plugin-shell from 2.0.1 to 2.2.0 (#118)

Bumps [@tauri-apps/plugin-shell](https://github.com/tauri-apps/plugins-workspace) from 2.0.1 to 2.2.0.
- [Release notes](https://github.com/tauri-apps/plugins-workspace/releases)
- [Commits](tauri-apps/plugins-workspace@os-v2.0.1...os-v2.2.0)

---
updated-dependencies:
- dependency-name: "@tauri-apps/plugin-shell"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump nanoid in the npm_and_yarn group (#123)

Bumps the npm_and_yarn group with 1 update: [nanoid](https://github.com/ai/nanoid).


Updates `nanoid` from 3.3.7 to 3.3.8
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](ai/nanoid@3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bug/112  cant input openai api key on gui (#124)

* Improved installation instructions in README.md

- Restructured the installation section for clarity.
- Added a sequential list of steps for downloading/building the Cuuri binary.
- Clarified the process for registering the OpenAI API key.

* feat: Implement router-based navigation and settings management

- Added vue-router for managing application routes.
- Removed the API key dialog component; API key management is now done from the Settings view.
- Created HomeView and SettingsView components to handle chat functionalities and API key input.
- Updated App.vue to utilize <RouterView> for dynamic routing.
- Enhanced the set_openai_api_key function to return an error if the API key is empty.
- Updated documentation in README.md to reflect changes in API key registration and installation instructions.
- Added dev dependencies for vue-router.

* Fix: Adjust button layout in SettingsView

- Changed the alignment of the "Save API Key" button to be right-aligned and added margin.
- Improved button layout for better user experience.

* feat: Introduce Diesel Migrations and Refactor Database Connection (#111)

- Added `diesel_migrations` dependency to manage database migrations.
- Created initial migration for `chat_histories` table to track chat records.
- Refactored database connection handling:
  - Removed `Database` struct and associated connection pooling code.
  - Introduced `establish_connection` function for direct database connections.
  - Replaced all calls to the old connection method with the new approach.
- Enhanced SQL queries to operate on the new `chat_histories` table.
- Implemented a configuration file initializer for storing API keys and settings.
- Streamlined code for managing database path and creation of necessary directories.
- Added migration management to the application startup process.

* Bump version from 0.2.1 to 0.2.2 (#126)

- Updated version number in package.json, package-lock.json, Cargo.toml, Cargo.lock, and tauri.conf.json from 0.2.1 to 0.2.2.
- Includes updates to dependencies in the project.

* fix(ChatSessions.vue): improve session initialization logic (#130)

- Refactored `currentSessionId` watcher to be asynchronous for better handling of session updates.
- Enhanced `mounted` lifecycle hook to check if there are any existing sessions and create a new session if none exist.

* Improve error handling for database path retrieval across Tauri components (#133)

- Refactored `get_database_path` function to return a `Result<String, io::Error>` for better error management.
- Updated calls to `get_database_path` in `get_chat_history`, `get_chat_history_by_session`, `get_chatgpt_response`, `get_session_id_list`, and `lib.rs` to handle potential errors gracefully.
- Removed direct panics from database path retrieval and directory creation by incorporating proper error handling.
- Ensured that the application can gracefully handle scenarios when the database path cannot be determined, improving overall robustness.

This update enhances the reliability of database-related operations within the application.

* Refactor database connection and configuration handling (#135)

- Updated `establish_connection` to return a Result, handling errors gracefully.
- Modified `get_chat_history`, `get_chat_history_by_session`, `get_chatgpt_response`, `get_session_id_list` to handle potential errors from `establish_connection`.
- Improved error handling in `get_config` with clearer error messages.
- Refactored `init_config_file` to return a Result, improving error reporting on config file creation.
- Enhanced `run` function to handle errors from initialization and database connection properly.
- Updated `run_migrations` to return a Result for better error handling.
- Improved error messages when loading or writing configuration.

* Remove unused 'dirs' dependency in get_database_path.rs (#138)

This commit eliminates the import of the 'dirs' crate in the get_database_path.rs file, as it was not being utilized. This cleanup helps to improve code readability and reduce unnecessary dependencies.

* Remove unnecessary PathBuf usage in set_openai_api_key.rs (#139)

- Changed the way the configuration path is constructed by directly using the home directory.
- Removed the import of PathBuf as it is no longer needed, simplifying the code.

* Version update: Upgrade Cuuri to 0.2.3 (#141)

- Updated version to 0.2.3 in package.json and package-lock.json.
- Updated Cuuri version to 0.2.3 in Cargo.toml and Cargo.lock.
- Updated version to 0.2.3 in tauri.conf.json.

This update includes new features and fixes.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

1 participant