To run this project, you will need to add the following environment variables to your .env file
https://platform.openai.com/docs/quickstart?context=python
PINECONE_API_KEY
PINECONE_ENVIRONMENT_REGION
┌<▸> ~/D/spark-3.4.2-bin-hadoop3 | |
└➤ | |
./sbin/start-connect-server.sh --packages org.apache.spark:spark-connect_2.12:3.4.0 | |
starting org.apache.spark.sql.connect.service.SparkConnectServer, logging to /Users/aironman/Downloads/spark-3.4.2-bin-hadoop3/logs/spark-aironman-org.apache.spark.sql.connect.service.SparkConnectServer-1-MacBook-Pro-de-Alonso.local.out | |
┌<▸> ~/D/spark-3.4.2-bin-hadoop3 | |
└➤ | |
lsof -iTCP -sTCP:LISTEN -n -P | grep 15002 | |
java 4566 aironman 445u IPv6 0x75d482d23c96e711 0t0 TCP *:15002 (LISTEN) |
[[source]] | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
langchain = "*" | |
python-dotenv = "*" | |
black = "*" | |
langchain-experimental = "*" |
To run this project, you will need to add the following environment variables to your .env file
https://platform.openai.com/docs/quickstart?context=python
PINECONE_API_KEY
PINECONE_ENVIRONMENT_REGION
import requests | |
from bs4 import BeautifulSoup | |
import os | |
import urllib | |
import time | |
# Inicio del temporizador | |
start_time = time.time() | |
# Ejecución de la tarea |
import os | |
import time | |
import requests | |
from dotenv import load_dotenv # Assuming you have `python-dotenv` installed | |
def is_file_safe(file_path, api_key): | |
""" | |
Checks a file's safety using VirusTotal API. |
Aprovechar al máximo FAISS: preguntas y obtención de fuentes | |
Limitaciones de FAISS con textos técnicos: | |
FAISS es una biblioteca poderosa para la búsqueda y recuperación de información, pero tiene limitaciones al trabajar con textos técnicos como el de tu PDF de mecánica cuántica. Estos textos suelen tener un lenguaje complejo, especializado y con tecnicismos que la biblioteca no comprende del todo. | |
Preguntas que puedes hacer a FAISS: | |
Preguntas simples: Son ideales para obtener información general o superficial del contenido. | |
Preguntas sobre entidades: Puedes preguntar por nombres de personas, lugares, organizaciones o conceptos específicos mencionados en el texto. |
import os | |
from langchain.chains.retrieval_qa.base import VectorDBQA | |
from langchain_community.document_loaders import TextLoader | |
from langchain_openai import OpenAIEmbeddings, OpenAI | |
from langchain_pinecone import PineconeVectorStore | |
from langchain_text_splitters import CharacterTextSplitter | |
import logging | |
logger = logging.getLogger(__name__) |
[[source]] | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
langchain = "*" | |
black = "*" | |
pinecone-client = "*" | |
openai = "*" |
[[source]] | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
langchain = "*" | |
openai = "*" | |
black = "*" | |
python-dotenv = "*" |
/Users/aironman/.local/share/virtualenvs/react-langchain-TwV6jvy5/bin/python /Users/aironman/Desktop/react-langchain/main.py | |
/Users/aironman/.local/share/virtualenvs/react-langchain-TwV6jvy5/lib/python3.12/site-packages/langchain/chat_models/__init__.py:31: LangChainDeprecationWarning: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead: | |
`from langchain_community.chat_models import ChatOpenAI`. | |
To install langchain-community run `pip install -U langchain-community`. | |
warnings.warn( | |
Hello ReAct LangChain!, Alonso | |
/Users/aironman/.local/share/virtualenvs/react-langchain-TwV6jvy5/lib/python3.12/site-packages/langchain_core/_api/deprecation.py:117: LangChainDeprecationWarning: The class `langchain_community.chat_models.openai.ChatOpenAI` was deprecated in langchain-community 0.0.10 and will be removed in 0.2.0. An updated version of the class exists in the langchain-openai package and sh |