Example

from phi.agent import Agent
from phi.model.vertexai import Gemini
from phi.tools.yfinance import YFinanceTools

agent = Agent(
    model=Gemini(id="gemini-1.5-flash"),
    tools=[YFinanceTools(stock_price=True)],
    show_tool_calls=True,
    markdown=True,
)

agent.print_response("What is the stock price of NVDA and TSLA")

Gemini Params

ParameterTypeDefaultDescription
idstr"gemini-1.5-flash"The specific model ID used for generating responses.
namestr"Gemini"The name identifier for the agent.
providerstr"VertexAI"The provider of the model.
function_declarationsOptional[List[FunctionDeclaration]]-A list of function declarations that the model can utilize during the response generation process.
generation_configOptional[Any]-Configuration settings for the generation process, such as parameters for controlling output behavior.
safety_settingsOptional[Any]-Settings related to safety measures, ensuring the generation of appropriate and safe content.
generative_model_kwargsOptional[Dict[str, Any]]-Additional keyword arguments for the generative model.
clientOptional[GenerativeModel]-A pre-configured instance of the Gemini client.

VertexAI is a subclass of the Model class and has access to the same params.