parent
abf2048f5b
commit
a7ca5b79a5
@ -0,0 +1,25 @@
|
||||
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)
|
@ -0,0 +1,26 @@
|
||||
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,
|
||||
)
|
||||
|
||||
|
||||
# Run the model
|
||||
out = model.run("Create the code for a react component that displays a name")
|
||||
print(out)
|
Loading…
Reference in new issue