Skip to content

Commit

Permalink
Ajustes en views.py para integrar correctamente FAISS y OpenAI
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaister9 committed Oct 3, 2024
1 parent 3f890e0 commit 26ffc90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions backend/chatbot_laura/models.py

This file was deleted.

4 changes: 2 additions & 2 deletions backend/chatbot_laura/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def search(self, query, k=3):

@api_view(['POST'])
@csrf_exempt
def chatbot_laura_view(request):
async def chatbot_laura_view(request):
try:
data = json.loads(request.body)
query = data.get('mensaje', '')
Expand All @@ -142,7 +142,7 @@ def chatbot_laura_view(request):
resultados = chatbot_view.search(query)

# Llamar a GPT-4
respuesta_gpt4 = generar_respuesta_gpt4(resultados)
respuesta_gpt4 = await generar_respuesta_gpt4(resultados)
return Response({'respuesta': respuesta_gpt4}, status=status.HTTP_200_OK)

except json.JSONDecodeError:
Expand Down

0 comments on commit 26ffc90

Please sign in to comment.