-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: add APIBrainQA #1606
feat: add APIBrainQA #1606
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3017dfe
to
a028c32
Compare
Risk Level 2 - /home/runner/work/quivr/quivr/backend/llm/api_brain_qa.py The code seems to be well-structured and follows the SOLID principles. However, there are a few areas that could be improved for better error handling and readability:
Risk Level 2 - /home/runner/work/quivr/quivr/backend/routes/chat/brainful_chat.py The code is generally well-written, but there are a few areas that could be improved:
Risk Level 2 - /home/runner/work/quivr/quivr/backend/llm/utils/call_brain_api.py The code is generally well-written, but there are a few areas that could be improved:
👍🔧📚 Powered by Code Review GPT |
a028c32
to
5afed15
Compare
5afed15
to
8b66b61
Compare
|
||
|
||
def get_api_brain_definition_as_json_schema(brain: BrainEntity): | ||
if not brain: |
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.
How can it be "not brain" if the type is BrainEntity
?
|
||
required = [] | ||
required.extend(api_brain_definition.params.required) | ||
required.extend(api_brain_definition.search_params.required) |
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.
Nice use of the extend !
class ApiBrainDefinitionSchemaProperty(BaseModel): | ||
type: str | ||
description: str | ||
enum: list |
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.
whats this enum for ?
@@ -32,6 +32,7 @@ def get_answer_generator( | |||
user_openai_api_key, | |||
streaming, | |||
prompt_id, | |||
user_id, | |||
): |
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.
We should use the user_id and brain_id to be attributes of the class BrainlessChat and BrainfullChat
@@ -7,6 +7,15 @@ | |||
from routes.authorizations.types import RoleEnum | |||
from routes.chat.interface import ChatInterface | |||
|
|||
models_supporting_function_calls = [ |
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.
Very nice !
@@ -1,7 +1,8 @@ | |||
from uuid import UUID | |||
|
|||
from models import get_supabase_client | |||
from utils import build_secret_unique_name | |||
|
|||
from repository.external_api_secret.utils import build_secret_unique_name |
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.
from repository.external_api_secret.utils import build_secret_unique_name | |
from utils import build_secret_unique_name |
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.
Great work mamadz, just leaving a few comments to discuss later on :)
🤖 I have created a release *beep* *boop* --- ## 0.0.109 (2023-11-13) ## What's Changed * feat: add APIBrainQA by @mamadoudicko in #1606 * feat: allow users to chat with apis by @mamadoudicko in #1612 * feat(docker): use multi-stage Docker builds for smaller images by @shidenkai0 in #1614 ## New Contributors * @shidenkai0 made their first contribution in #1614 **Full Changelog**: v0.0.108...v0.0.109 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## 0.0.109 (2023-11-13) ## What's Changed * feat: add APIBrainQA by @mamadoudicko in QuivrHQ/quivr#1606 * feat: allow users to chat with apis by @mamadoudicko in QuivrHQ/quivr#1612 * feat(docker): use multi-stage Docker builds for smaller images by @shidenkai0 in QuivrHQ/quivr#1614 ## New Contributors * @shidenkai0 made their first contribution in QuivrHQ/quivr#1614 **Full Changelog**: QuivrHQ/quivr@v0.0.108...v0.0.109 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Issue: #1566