You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/playground/demos/gemini_benchmarking/gemini_chat.py

29 lines
579 B

import os
from dotenv import load_dotenv
from swarms.models.gemini import Gemini
from swarms.prompts.react import react_prompt
load_dotenv()
api_key = os.environ["GEMINI_API_KEY"]
# Establish the prompt and image
task = "What is your name"
img = "images/github-banner-swarms.png"
# Initialize the model
model = Gemini(
gemini_api_key=api_key,
model_name="gemini-pro",
max_tokens=1000,
system_prompt=react_prompt(task=task),
temperature=0.5,
)
out = model.chat(
"Create the code for a react component that displays a name",
img=img,
)
print(out)