Open Lancelottery opened 5 days ago
Set Authentication:
export GOOGLE_API_KEY=your-google-api-key
Modify Agent Code:
from phi.agent import Agent
from phi.model.google import Gemini
agent = Agent(
model=Gemini(id="your-fine-tuned-model-id"), # Replace with your model ID
show_tool_calls=True,
markdown=True,
api_key="your-google-api-key"
)
agent.print_response("Test response from fine-tuned Gemini model.")
Ensure that you replace "your-fine-tuned-model-id" with the actual model ID from Vertex AI Studio.
For more customization options, you can configure generation_config with additional settings.
agent = Agent(
model=Gemini(
id="your-fine-tuned-model-id",
generation_config={"temperature": 0.7, "max_tokens": 150}, # Example settings
api_key="your-google-api-key"
),
show_tool_calls=True,
markdown=True,
)
Hey @Lancelottery !
Currently we only support Gemini via Google ai studio for the Agent Class. We are working on extending support for Vertex ai as well.
Though, with our fully functioning but older Assistant class you can use Gemini via Vertex ai. Here is a cookbook to get you started: https://github.com/phidatahq/phidata/tree/main/cookbook/assistants/llms/vertexai
Please let me know if you have any further questions
Hi, I would like to integrate my fine-tuned gemini model from vertex ai studio with Phi Agents. I have the fine-tuned model endpoints ready. According to the documentation, https://docs.phidata.com/models/google_ai_studio, it seems like it only supports pre-trained Gemini? How do I integrate them?