Skip to content

Test#40

Open
gamichalski wants to merge 56 commits intoThe-Fabricators:mainfrom
gamichalski:main
Open

Test#40
gamichalski wants to merge 56 commits intoThe-Fabricators:mainfrom
gamichalski:main

Conversation

@gamichalski
Copy link

@gamichalski gamichalski commented Sep 17, 2025

234

AnthonyLoche and others added 30 commits November 28, 2024 15:21
FEAT: Make the authentication with the passsage [Refs: #2]
Copilot AI review requested due to automatic review settings September 17, 2025 20:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR sets up a complete Django-based backend system for a chatbot platform that integrates with multiple AI services including Google Gemini, OpenAI GPT, and Cohere. The system includes user authentication, specialized AI modules for different academic subjects, and a bias detection/classification system.

Key changes:

  • Complete project structure with Django configuration, models, views, and API endpoints
  • Multi-AI integration with specialized modules for different academic subjects (languages, mathematics, natural sciences, human sciences, text writing)
  • Cohere-based text classification system with training capabilities
  • User authentication system using Passage identity

Reviewed Changes

Copilot reviewed 102 out of 146 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
pyproject.toml Project dependencies and PDM configuration
manage.py Standard Django management script
config/ Django settings, URLs, and WSGI/ASGI configuration
core/authUser/ Custom user authentication system with Passage integration
core/geminiIA/ Google Gemini AI integration modules for different subjects
core/chatgptIA/ OpenAI GPT integration for generic AI responses
core/cohereIA/ Cohere AI classification system with training capabilities
core/chat/ Chat management system with conversation history
core/bias/ Message classification and routing system

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

import os
import google.generativeai as genai

genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

API key is hardcoded in the source code. This should be moved to environment variables for security. Use os.getenv('GEMINI_API_KEY') instead of hardcoding the key.

Suggested change
genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
genai.configure(api_key=os.getenv('GEMINI_API_KEY'))

Copilot uses AI. Check for mistakes.
import os
import google.generativeai as genai

genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

API key is hardcoded in the source code. This should be moved to environment variables for security. Use os.getenv('GEMINI_API_KEY') instead of hardcoding the key.

Suggested change
genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
genai.configure(api_key=os.getenv('GEMINI_API_KEY'))

Copilot uses AI. Check for mistakes.
import os
import google.generativeai as genai

genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

API key is hardcoded in the source code. This should be moved to environment variables for security. Use os.getenv('GEMINI_API_KEY') instead of hardcoding the key.

Suggested change
genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
genai.configure(api_key=os.getenv('GEMINI_API_KEY'))

Copilot uses AI. Check for mistakes.
import os
import google.generativeai as genai

genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

API key is hardcoded in the source code. This should be moved to environment variables for security. Use os.getenv('GEMINI_API_KEY') instead of hardcoding the key.

Suggested change
genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
genai.configure(api_key=os.getenv('GEMINI_API_KEY'))

Copilot uses AI. Check for mistakes.
import os
import google.generativeai as genai

genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

API key is hardcoded in the source code. This should be moved to environment variables for security. Use os.getenv('GEMINI_API_KEY') instead of hardcoding the key.

Suggested change
genai.configure(api_key="AIzaSyAnxlo6QW7qp8PaosOdU-4ECehA9gHMnMA")
genai.configure(api_key=os.getenv('GEMINI_API_KEY'))

Copilot uses AI. Check for mistakes.
"google-generativeai>=0.8.3",
"django-filter>=24.3",
"pillow>=11.0.0",
"openai==0.28",
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Using an outdated version of OpenAI library (0.28) which may contain security vulnerabilities. Consider updating to a more recent version and verify compatibility.

Suggested change
"openai==0.28",
"openai>=1.14.3",

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +19











Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

[nitpick] Remove unnecessary empty lines at the end of the file to improve code cleanliness.

Suggested change

Copilot uses AI. Check for mistakes.

# Realiza a classificação
response = co.classify(
model="6c419c46-f7b4-4dc4-986e-7519a8cc002d-ft",
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The model ID is hardcoded. This should use the dynamic model ID from current_model.currentModel that was retrieved earlier in the method for consistency and flexibility.

Suggested change
model="6c419c46-f7b4-4dc4-986e-7519a8cc002d-ft",
model=model_id,

Copilot uses AI. Check for mistakes.
class TextWritingAISerializer(ModelSerializer):
class Meta:
model = TextWritingAI
fields: list[str] = ['id', 'user', 'answer', 'response', 'cover'] No newline at end of file
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Type annotation on fields is unnecessary in Django serializer Meta classes. The Django framework expects fields to be a list, so the type annotation should be removed: fields = ['id', 'user', 'answer', 'response', 'cover']

Suggested change
fields: list[str] = ['id', 'user', 'answer', 'response', 'cover']
fields = ['id', 'user', 'answer', 'response', 'cover']

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants