Skip to content

Commit

Permalink
use api_key
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-sol committed Jul 16, 2024
1 parent bddd047 commit f892f10
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/gradio-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import chromadb
import gradio as gr
from dotenv import load_dotenv
from llama_index.agent.openai import OpenAIAgent
from llama_index.core import VectorStoreIndex, get_response_synthesizer
from llama_index.core.data_structs import Node
Expand All @@ -23,6 +24,8 @@
system_message_validation,
)

load_dotenv(".env")

# from utils import init_mongo_db

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -188,7 +191,12 @@ def filter_nodes_by_unique_doc_id(nodes):
print(type(node))

# llm = Gemini(model="models/gemini-1.5-flash", temperature=1, max_tokens=None)
llm = Gemini(model="models/gemini-1.5-pro", temperature=1, max_tokens=None)
llm = Gemini(
api_key=os.getenv("GOOGLE_API_KEY"),
model="models/gemini-1.5-pro",
temperature=1,
max_tokens=None,
)
# llm = OpenAI(temperature=1, model="gpt-3.5-turbo", max_tokens=None)
# llm = OpenAI(temperature=1, model="gpt-4o", max_tokens=None)

Expand Down

0 comments on commit f892f10

Please sign in to comment.