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

feat: Implement api to delete ai assistant #9626

Conversation

miya
Copy link
Member

@miya miya commented Feb 5, 2025

Task

  • #160106 [GROWI AI Next][特化型アシスタント] アシスタント一覧画面を表示できる
    • #161373 アシスタントを削除するための API 実装
    • #161372 アシスタントを削除するための API クライアントの実装

@miya miya self-assigned this Feb 5, 2025
Copy link

changeset-bot bot commented Feb 5, 2025

⚠️ No Changeset found

Latest commit: 1b28717

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@miya miya requested a review from yuki-takei February 5, 2025 03:10
@@ -205,22 +206,21 @@ class OpenaiService implements IOpenaiService {
return uploadedFile;
}

// TODO: https://redmine.weseek.co.jp/issues/160333
Copy link
Member Author

Choose a reason for hiding this comment

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

https://redmine.weseek.co.jp/issues/160333 で着手予定でしたが別タスクで着手したため却下しました

// }
try {
await this.client.deleteVectorStore(vectorStoreDocument.vectorStoreId);
await vectorStoreDocument.markAsDeleted();
Copy link
Member Author

@miya miya Feb 5, 2025

Choose a reason for hiding this comment

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

旧ナレッジアシスタントのやり方を踏襲し、VectorStore の実態はアシスタント削除時に削除、VectorStoreFile document と VectorStoreFIle の実態は cron により自動削除する

@@ -38,6 +38,10 @@ export const factory = (crowi: Crowi): express.Router => {
import('./ai-assistants').then(({ getAiAssistantsFactory }) => {
router.get('/ai-assistants', getAiAssistantsFactory(crowi));
});

import('./delete-ai-assistant').then(({ deleteAiAssistantsFactory }) => {
Copy link
Member Author

@miya miya Feb 5, 2025

Choose a reason for hiding this comment

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

ご相談なのですが、ファイル名の一貫性を持たせるために AiAssistant の削除ロジックを delete-ai-assistant.ts ではなくて routes/ai-assistant.ts に書くか、ファイル名はこのままで AiAssistant の作成ロジックがある ai-assistant.ts などを create-ai-assistant.ts のようなファイル名に寄せたい (エンドポイントの path は POST: /openai/ai-assistant のようにそのまま) と思っているのすがどうでしょうか?個人的には後者にしたいと思っています。

以前に以下のコメントをいただいています。

REST 的に post が create の意味を持つから、/create-ai-assistant は /ai-assistant 等、リソースを意味するものにしていいと思う

#9497 (comment)

どうせ肥大化するので、create と get とで route を実装するファイルは分けてください

#9573 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

「REST 的に」という要求とコードの肥大化対策の両方が満たされるのであれば変更してもらって問題ないです

@@ -38,6 +38,10 @@ export const factory = (crowi: Crowi): express.Router => {
import('./ai-assistants').then(({ getAiAssistantsFactory }) => {
router.get('/ai-assistants', getAiAssistantsFactory(crowi));
});

import('./delete-ai-assistant').then(({ deleteAiAssistantsFactory }) => {
Copy link
Member

Choose a reason for hiding this comment

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

「REST 的に」という要求とコードの肥大化対策の両方が満たされるのであれば変更してもらって問題ないです

@yuki-takei yuki-takei merged commit f28ad1b into feat/growi-ai-next Feb 5, 2025
10 checks passed
@yuki-takei yuki-takei deleted the feat/161373-implement-api-to-delete-ai-assistant branch February 5, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants