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 for rebuilding Vector Store #9133

Conversation

miya
Copy link
Member

@miya miya commented Sep 17, 2024

Task

  • #153746 [RAG] 管理画面の OpenAI 設定画面から vector store の再構築ができる
    • #153986 vector store 再構築のための API を作成
    • #153987 管理画面に vector store の再構築ボタンを実装し、ボタン押下時に API にリクエストを送信できる

Demo

2024-09-18.16.19.54.mov

@miya miya self-assigned this Sep 17, 2024
Copy link

changeset-bot bot commented Sep 17, 2024

⚠️ No Changeset found

Latest commit: 3465b56

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 changed the title feat: Implement api for regenerating vector store feat: Implement api for regenerating Vector Store Sep 18, 2024
@miya miya changed the title feat: Implement api for regenerating Vector Store feat: Implement api for rebuilding Vector Store Sep 18, 2024
}

next();
};
Copy link
Member Author

Choose a reason for hiding this comment

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

AI 機能が利用可能かどうかを判断するための express middleware

return res.apiv3({});
},
];
};
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 1154 to 1155
"rebuild_vector_store_succeeded": "Vector Store のリビルドに成功しました",
"rebuild_vector_store_failed": "Vector Store のリビルドに失敗しました"
Copy link
Member

Choose a reason for hiding this comment

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

クリック時に表示するメッセージは成功可否ではなく「リビルドを受け付けた」という内容ではないか?

Copy link
Member Author

Choose a reason for hiding this comment

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

修正しました

if (!aiEnabled) {
const message = 'AI_ENABLED is not true';
logger.error(message);
return res.apiv3Err(message, 400);
Copy link
Member

Choose a reason for hiding this comment

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

403 かなあ
400 だとパラメータ次第でリクエスト通りそうな印象

Copy link
Member Author

Choose a reason for hiding this comment

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

修正しました


const router = express.Router();

module.exports = (crowi) => {
router.post('/chat', chatHandlersFactory(crowi));
router.put('/rebuild-vector-store', rebuildVectorStoreHandlersFactory(crowi));
Copy link
Member

Choose a reason for hiding this comment

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

post でよい

Copy link
Member Author

Choose a reason for hiding this comment

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

修正しました

@miya miya merged commit 183bff9 into feat/openai-vector-searching Sep 19, 2024
5 checks passed
@miya miya deleted the feat/153986-implement-api-for-regenerating-vector-store branch September 19, 2024 16:45
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