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 5249509 commit 3f890e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/chatbot_laura/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_embedding(self, text, model="text-embedding-ada-002"):
try:
# Usamos directamente la función de OpenAI para obtener embeddings
response = client.embeddings.create(input=text, model=model)
return response['data'][0]['embedding']
return response.data[0].embedding
except Exception as e:
logger.error(f"Error al obtener embedding: {str(e)}")
raise
Expand Down

0 comments on commit 3f890e0

Please sign in to comment.