Metadata-Version: 2.5
Name: pyflowred-node-ai-google
Version: 0.1.0
Summary: Google Gemini for PyFlowRED's AI nodes: the Gemini API or Vertex AI, as one setting.
Project-URL: Homepage, https://pypi.org/project/pyflowred/
Author: Melvin Neffle
License: Apache-2.0
Keywords: ai,flow,gemini,llm,node-red,pyflowred,vertex-ai
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.13
Requires-Dist: langchain-google-genai>=4.4
Description-Content-Type: text/markdown

# pyflowred-node-ai-google

Google Gemini for [PyFlowRED](https://pypi.org/project/pyflowred/)'s AI nodes.

```bash
pip install pyflowred-node-ai-google
```

or, in a running instance, *Menu → Manage palette → Install →
`pyflowred-node-ai-google`*, which also declares it so a rebuilt instance
installs it again by itself.

## What it adds

One configuration node, **`ai-provider-google`**. PyFlowRED's `ai chat`,
`ai structured`, `ai agent`, `ai embed` and `ai query` point at it and ask it
for a model; everything Google-specific lives here.

## The same model, two backends

`langchain-google-genai` carries both Google backends in one class, so the
**Authentication** dropdown is the whole difference between them:

| | |
|---|---|
| **An API key** | the Gemini API, with the key on this node |
| **A service account** | Vertex AI, with a key file or the JSON itself, plus project and region |
| **Application Default Credentials** | Vertex AI with whatever identity the machine already has — a metadata server, Workload Identity, `GOOGLE_APPLICATION_CREDENTIALS` |

Moving a flow from a key on a laptop to a service account in a cluster is that
dropdown and nothing else: not a different node, not a different package, not
a different model name.

## The credential is not in the flow file

It is a credential property, so it lands encrypted in the instance's
credentials file. Written as `${secret:NAME}` it is fetched from the
instance's secrets provider **when the call is made**, so a rotated key is
picked up without a deploy and neither file ever holds the value.

## Thinking is the biggest number on the bill

Measured against `gemini-3.8-flash`: the one-word answer "Paris" cost 52
output tokens, of which **51 were thinking** — and 3 with `thinking` set to
`off`. For a flow answering a thousand messages a day that is the difference
between the bill and ten times the bill. It is a field on this node, and a
function node or a message may override it for one call.

## What a message may override

`model`, `temperature`, `maxTokens`, `topP`, `thinking`, `dimensions`,
`taskType` and `extra` — through the function node's own fields or through
`msg.ai`. A credential never: it belongs to the connection, not to the
operation.

## Independent on purpose

This package depends on `langchain-google-genai` and **not** on PyFlowRED, and
it imports nothing from it. The contract a provider satisfies is three
attributes on an object, so the engine and the providers are released apart.
See `docs/writing-nodes.md` in PyFlowRED for how to write another one.

Apache-2.0.
