[PR #3041] [CLOSED] feat: created lib for rust ai api wrapper #5534

Closed
opened 2026-03-23 22:19:10 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/3041
Author: @yatendra2001
Created: 7/22/2023
Status: Closed

Base: mainHead: main


📝 Commits (10+)

  • fc4b21f fix: row banner overlay
  • 7f7ab6e tests: added integration test for title
  • 9f6dfac fix: removed unused imports
  • 2c10e43 Merge branch 'AppFlowy-IO:main' into main
  • bd8b929 feat: created ai wrapper lib + api call to openai
  • 3733ce3 feat: added flowy-ai to cargo.toml
  • 804a0de test: added api test + chores: changed file structure
  • 4e4d3b3 Merge branch 'AppFlowy-IO:main' into main
  • 11c5c8f feat: added prompt selection + test: call API
  • 0502248 refactor: api wrapper + made code modular, test: api+prompt test

📊 Changes

8 files changed (+156 additions, -0 deletions)

View changed files

📝 frontend/rust-lib/Cargo.toml (+1 -0)
frontend/rust-lib/flowy-ai/Cargo.toml (+11 -0)
frontend/rust-lib/flowy-ai/src/api.rs (+34 -0)
frontend/rust-lib/flowy-ai/src/lib.rs (+3 -0)
frontend/rust-lib/flowy-ai/src/main.rs (+18 -0)
frontend/rust-lib/flowy-ai/src/prompt.rs (+57 -0)
frontend/rust-lib/flowy-ai/tests/api_tests.rs (+18 -0)
frontend/rust-lib/flowy-ai/tests/prompt_tests.rs (+14 -0)

📄 Description

Feature Preview

Related to project #2782

Created lib for rust wrapper to integrate the OpenAI chat model with appflowy.

@LucasXu0 Could you please check once and let me know if any changes required.

I've written a simple API call to the OpenAI chat model in main.rs.
Also added tests for the call under flowy-ai/tests/api_test.rs.


PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • I've listed at least one issue this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/3041 **Author:** [@yatendra2001](https://github.com/yatendra2001) **Created:** 7/22/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`fc4b21f`](https://github.com/AppFlowy-IO/AppFlowy/commit/fc4b21f553df802e080e66bce76c365dc49a83b2) fix: row banner overlay - [`7f7ab6e`](https://github.com/AppFlowy-IO/AppFlowy/commit/7f7ab6e9f7cd37b7b8bc8b52687edcbbf42daef0) tests: added integration test for title - [`9f6dfac`](https://github.com/AppFlowy-IO/AppFlowy/commit/9f6dfac6f1f813bc277dcf7c69db8dbd5df0988e) fix: removed unused imports - [`2c10e43`](https://github.com/AppFlowy-IO/AppFlowy/commit/2c10e4315bde554d17c2af2f9109ea4a8c8fe87e) Merge branch 'AppFlowy-IO:main' into main - [`bd8b929`](https://github.com/AppFlowy-IO/AppFlowy/commit/bd8b929865d81dd01c34ca8368d52dffe936525b) feat: created ai wrapper lib + api call to openai - [`3733ce3`](https://github.com/AppFlowy-IO/AppFlowy/commit/3733ce3a7667408a7c3531c4ba054271f9043c48) feat: added flowy-ai to cargo.toml - [`804a0de`](https://github.com/AppFlowy-IO/AppFlowy/commit/804a0de78793458b576da2551f9f8c2ef5971c27) test: added api test + chores: changed file structure - [`4e4d3b3`](https://github.com/AppFlowy-IO/AppFlowy/commit/4e4d3b3718f7a1aa737d92d2290e4e52cc69ca77) Merge branch 'AppFlowy-IO:main' into main - [`11c5c8f`](https://github.com/AppFlowy-IO/AppFlowy/commit/11c5c8fb8f7b79d492c8a1f5ab82c56f58915f58) feat: added prompt selection + test: call API - [`0502248`](https://github.com/AppFlowy-IO/AppFlowy/commit/05022480da0f30bc8b90399e94100a1b5b47e67c) refactor: api wrapper + made code modular, test: api+prompt test ### 📊 Changes **8 files changed** (+156 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `frontend/rust-lib/Cargo.toml` (+1 -0) ➕ `frontend/rust-lib/flowy-ai/Cargo.toml` (+11 -0) ➕ `frontend/rust-lib/flowy-ai/src/api.rs` (+34 -0) ➕ `frontend/rust-lib/flowy-ai/src/lib.rs` (+3 -0) ➕ `frontend/rust-lib/flowy-ai/src/main.rs` (+18 -0) ➕ `frontend/rust-lib/flowy-ai/src/prompt.rs` (+57 -0) ➕ `frontend/rust-lib/flowy-ai/tests/api_tests.rs` (+18 -0) ➕ `frontend/rust-lib/flowy-ai/tests/prompt_tests.rs` (+14 -0) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview Related to project #2782 Created lib for rust wrapper to integrate the OpenAI chat model with appflowy. @LucasXu0 Could you please check once and let me know if any changes required. I've written a simple API call to the OpenAI chat model in `main.rs`. Also added tests for the call under `flowy-ai/tests/api_test.rs`. <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [x] I've listed at least one issue this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:19:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#5534
No description provided.