This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dotenv import load_dotenv | |
| from langchain.llms import OpenAI | |
| from langchain import SQLDatabase | |
| from langchain_experimental.sql import SQLDatabaseChain | |
| # Load environment variables from the .env file | |
| load_dotenv() | |
| # Connection parameters | |
| server = '***' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import List | |
| from dotenv import load_dotenv | |
| from langchain.llms import OpenAI | |
| from langchain.output_parsers import PydanticOutputParser | |
| from langchain.prompts import PromptTemplate | |
| from pydantic import BaseModel, Field | |
| load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.gettingstarted.ai | |
| # do not forget to set your OPEN_API_KEY environment variable | |
| from langchain.embeddings.openai import OpenAIEmbeddings | |
| from langchain.text_splitter import CharacterTextSplitter | |
| from langchain.vectorstores import Milvus | |
| from langchain.document_loaders import TextLoader | |
| loader = TextLoader("state_of_the_union.txt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.gettingstarted.ai | |
| # email: jeff@gettingstarted.ai | |
| # written by jeff | |
| import time | |
| from openai import OpenAI | |
| client = OpenAI( | |
| api_key="YOUR_API_KEY", | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.gettingstarted.ai | |
| # email: jeff@gettingstarted.ai | |
| # written by jeff | |
| # Import necessary libraries | |
| import json | |
| import time | |
| from openai import OpenAI | |
| # Initialize OpenAI client with your API key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.gettingstarted.ai | |
| # email: jeff@gettingstarted.ai | |
| # written by jeff | |
| # Don't forget to set your OPEN_AI_KEY | |
| # In your terminal execute this command: export OPENAI_API_KEY="YOUR_KEY_HERE" | |
| # Import required modules from the LangChain package | |
| from langchain.chains import RetrievalQA | |
| from langchain.vectorstores import Chroma |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Logging; | |
| using Microsoft.SemanticKernel; | |
| using Plugins; | |
| // Import the Kernel class from the Microsoft.SemanticKernel namespace | |
| using Kernel = Microsoft.SemanticKernel.Kernel; | |
| // Create a new Kernel builder | |
| var builder = Kernel.CreateBuilder(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from pinecone import Pinecone | |
| from llama_index.llms import Gemini | |
| from llama_index.vector_stores import PineconeVectorStore | |
| from llama_index.storage.storage_context import StorageContext | |
| from llama_index.embeddings import GeminiEmbedding | |
| from llama_index import ServiceContext, VectorStoreIndex, download_loader, set_global_service_context | |
| GOOGLE_API_KEY = "..." | |
| PINECONE_API_KEY = "..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.gettingstarted.ai | |
| # email: jeff@gettingstarted.ai | |
| # written by jeff | |
| from dotenv import find_dotenv, load_dotenv | |
| from langchain_openai import ChatOpenAI | |
| from langchain_core.prompts import PromptTemplate | |
| from langchain_core.pydantic_v1 import BaseModel, Field | |
| from langchain_core.output_parsers import JsonOutputParser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.gettingstarted.ai | |
| # email: jeff@gettingstarted.ai | |
| # written by jeff | |
| from langchain.chains import LLMChain | |
| from botocore.client import Config | |
| from langchain_community.llms import Bedrock | |
| from langchain_core.prompts import PromptTemplate | |
| from langchain.chains import RetrievalQA |
OlderNewer