Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ysolanky committed Nov 27, 2024
1 parent 2261a49 commit 4809f57
Show file tree
Hide file tree
Showing 10 changed files with 449 additions and 211 deletions.
10 changes: 4 additions & 6 deletions cookbook/providers/vertexai/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Google Gemini Cookbook
# VertexAI Gemini Cookbook

> Note: Fork and clone this repository if needed
Expand All @@ -9,16 +9,14 @@ python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
```

### 2. Export `GOOGLE_API_KEY`
### 2. Authenticate with Google Cloud

```shell
export GOOGLE_API_KEY=***
```
[Authenticate with Gcloud](https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal)

### 3. Install libraries

```shell
pip install -U google-generativeai duckduckgo-search yfinance phidata
pip install -U google-cloud-aiplatform duckduckgo-search yfinance phidata
```

### 4. Run Agent without Tools
Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/agent_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Iterator # noqa
from phi.agent import Agent, RunResponse # noqa
from phi.model.google import Gemini
from phi.model.vertexai import Gemini
from phi.tools.yfinance import YFinanceTools

agent = Agent(
Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/basic_stream.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Iterator # noqa
from phi.agent import Agent, RunResponse # noqa
from phi.model.google import Gemini
from phi.model.vertexai import Gemini

agent = Agent(model=Gemini(id="gemini-1.5-flash"), markdown=True)

Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/data_analyst.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from textwrap import dedent
from phi.agent import Agent
from phi.model.google import Gemini
from phi.model.vertexai import Gemini
from phi.tools.duckdb import DuckDbTools

duckdb_tools = DuckDbTools(create_tables=False, export_tables=False, summarize_tables=False)
Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/finance_agent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Run `pip install yfinance` to install dependencies."""

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

agent = Agent(
Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/knowledge.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Run `pip install duckduckgo-search sqlalchemy pgvector pypdf openai google.generativeai` to install dependencies."""

from phi.agent import Agent
from phi.model.google import Gemini
from phi.model.vertexai import Gemini
from phi.knowledge.pdf import PDFUrlKnowledgeBase
from phi.vectordb.pgvector import PgVector

Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/storage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Run `pip install duckduckgo-search sqlalchemy google.generativeai` to install dependencies."""

from phi.agent import Agent
from phi.model.google import Gemini
from phi.model.vertexai import Gemini
from phi.tools.duckduckgo import DuckDuckGo
from phi.storage.agent.postgres import PgAgentStorage

Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/structured_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from rich.pretty import pprint # noqa
from pydantic import BaseModel, Field
from phi.agent import Agent, RunResponse # noqa
from phi.model.google import Gemini
from phi.model.vertexai import Gemini


class MovieScript(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion cookbook/providers/vertexai/web_search.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Run `pip install duckduckgo-search` to install dependencies."""

from phi.agent import Agent
from phi.model.google import Gemini
from phi.model.vertexai import Gemini
from phi.tools.duckduckgo import DuckDuckGo

agent = Agent(model=Gemini(id="gemini-1.5-flash"), tools=[DuckDuckGo()], show_tool_calls=True, markdown=True)
Expand Down
Loading

0 comments on commit 4809f57

Please sign in to comment.