This file contains 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 typing import Dict, Any | |
from datetime import datetime, timedelta | |
import pytz | |
import requests | |
from openai import OpenAI | |
import chromadb | |
from chromadb.utils import embedding_functions |
This file contains 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 datetime import datetime, timedelta | |
import pytz | |
import requests | |
import json | |
from langchain_nvidia_ai_endpoints import ChatNVIDIA, NVIDIAEmbeddings | |
from langchain_community.document_loaders import WebBaseLoader | |
from langchain_text_splitters import RecursiveCharacterTextSplitter | |
from langchain_community.vectorstores import FAISS |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 huggingface_hub import InferenceClient | |
client = InferenceClient("http://127.0.0.1:8080") | |
tools = [ | |
{ | |
"type": "function", | |
"function": { | |
"name": "get_flight_status", | |
"description": "Get status of a flight", |
This file contains 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 google.generativeai as genai | |
##The Function get_flight_status is available at https://gist.github.com/janakiramm/2143b909626f5f01d64739e3fe90c9c8 | |
def get_departure_gate(flight:str): | |
"""Returns Departure Information""" | |
return "B11" | |
model = genai.GenerativeModel( | |
model_name='gemini-1.0-pro', |
This file contains 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 openai import OpenAI | |
#Initialize the environment variable OPENAI_API_KEY with your api key | |
client = OpenAI() | |
#Function is available at https://gist.github.com/janakiramm/2143b909626f5f01d64739e3fe90c9c8 | |
tools = [ | |
{ | |
"type": "function", |
This file contains 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 ast | |
import json | |
import random | |
from datetime import datetime, timedelta | |
import requests | |
import pytz | |
def get_flight_status(flight): | |
"""Returns Flight Information""" |
This file contains 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
### Install required modules and set the envvar for Gemini API Key | |
#pip install google.generativeai | |
#pip install langchain-google-genai | |
#pip install langchain | |
#pip install langchain_community | |
#pip install jupyter | |
#export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" | |
#Import Modules |
This file contains 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
### Install required modules and set the envvar for Gemini API Key | |
#pip install pypdf2 | |
#pip install chromadb | |
#pip install google.generativeai | |
#pip install langchain-google-genai | |
#pip install langchain | |
#pip install langchain_community | |
#pip install jupyter | |
#export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" |
This file contains 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
# The previous part of this tutorial is at https://gist.github.com/janakiramm/55d2d8ec5d14dd45c7e9127d81cdafcd | |
from vertexai.language_models import TextEmbeddingModel | |
from google.cloud import aiplatform | |
import vertexai | |
from vertexai.preview.generative_models import GenerativeModel, Part | |
import json | |
import os | |
project=”YOUR_GCP_PROJECT” |
NewerOlder