Código-fonte da próxima postagem do blog, Generative AI for Analytics: Performing Natural Language Queries on Amazon RDS using SageMaker, LangChain e LLMs. Aprenda a usar o SQL Database Chain and Agent da LangChain com grandes modelos de linguagem para realizar consultas de linguagem natural (NLQ) do Amazon RDS para PostgreSQL.
Kernel: Python básico 3.0 (Python 3)
Tipo de instância: ml.m5.medium
Seus arquivos .env
devem ter a seguinte aparência:
# add required values, then rename this file to .env
# mv env.txt .env
# API Keys
OPENAI_API_KEY =<your_value_here>
ANTHROPIC_API_KEY =<your_value_here>
# Demo 1: Amazon RDS Connection
RDS_ENDPOINT =<your_value_here>
RDS_PORT =<your_value_here>
RDS_USERNAME =<your_value_here>
RDS_PASSWORD =<your_value_here>
RDS_DB_NAME =<your_value_here>
# Demo 2: Amazon Redshift Connection
REDSHIFT_HOST =<your_value_here>
REDSHIFT_PORT =<your_value_here>
REDSHIFT_USERNAME =<your_value_here>
REDSHIFT_PASSWORD =<your_value_here>
REDSHIFT_DATABASE =<your_value_here>
# Amazon SageMaker terminal
yum install bind-utils -y
# Get your SageMaker Notebook environment IP
dig +short txt ch whoami.cloudflare @1.0.0.1
# Curl RDS database instance to check connectivity
curl -v ****** . ****** .us-east-1.rds.amazonaws.com:5432
jupyter-black
foi usado para formatar notebooks e aplicativo Steamlit.
pip install black " black[jupyter] "
black * .ipynb
black * .py
O conteúdo deste repositório representa meus pontos de vista e não dos meus empregadores anteriores ou atuais, incluindo Amazon Web Services (AWS). Todas as bibliotecas, módulos, plug-ins e SDKs de terceiros são propriedade de seus respectivos proprietários.