-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat: Implement api to delete ai assistant #9626
Conversation
|
apps/app/src/features/openai/server/services/openai-api-error-handler.ts
Show resolved
Hide resolved
@@ -205,22 +206,21 @@ class OpenaiService implements IOpenaiService { | |||
return uploadedFile; | |||
} | |||
|
|||
// TODO: https://redmine.weseek.co.jp/issues/160333 |
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.
https://redmine.weseek.co.jp/issues/160333 で着手予定でしたが別タスクで着手したため却下しました
// } | ||
try { | ||
await this.client.deleteVectorStore(vectorStoreDocument.vectorStoreId); | ||
await vectorStoreDocument.markAsDeleted(); |
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.
旧ナレッジアシスタントのやり方を踏襲し、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 }) => { |
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.
ご相談なのですが、ファイル名の一貫性を持たせるために 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 等、リソースを意味するものにしていいと思う
どうせ肥大化するので、create と get とで route を実装するファイルは分けてください
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.
「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 }) => { |
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.
「REST 的に」という要求とコードの肥大化対策の両方が満たされるのであれば変更してもらって問題ないです
Task