robotframework-gemini 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/PKG-INFO +10 -39
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/README.md +9 -38
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/pyproject.toml +1 -1
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/__init__.py +1 -1
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/.gitignore +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/LICENSE +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/BrowserGeminiLibrary.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/GeminiLibrary.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/browser_helpers.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/client.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/legacy_env.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/library.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/prompt_build.py +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/py.typed +0 -0
- {robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/response_parse.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: robotframework-gemini
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Google Gemini oracles for Robot Framework: text-only and multimodal (image) assertions.
|
|
5
5
|
Project-URL: Homepage, https://github.com/carlosnizolli/robotframework-gemini
|
|
6
6
|
Project-URL: Documentation, https://github.com/carlosnizolli/robotframework-gemini#readme
|
|
@@ -34,7 +34,7 @@ Description-Content-Type: text/markdown
|
|
|
34
34
|
|
|
35
35
|
# robotframework-gemini
|
|
36
36
|
|
|
37
|
-
Biblioteca
|
|
37
|
+
Biblioteca de **keywords do Robot Framework** para oráculos com **Google Gemini**: avaliação **só texto** (API, logs, JSON, etc.) ou **multimodal** com imagem (arquivo PNG ou captura do **Robot Framework Browser**).
|
|
38
38
|
|
|
39
39
|
- **Multimodal**: envia o texto do prompt e a captura como `Part` em bytes (`google-genai`).
|
|
40
40
|
- **Fluxo recomendado**: duas entradas — **contexto** (enquadramento do teste) e **avaliação** (critério ou pergunta objetiva).
|
|
@@ -64,7 +64,7 @@ python -m pip install -e ".[dev]"
|
|
|
64
64
|
| Variável / argumento | Função |
|
|
65
65
|
|----------------------|--------|
|
|
66
66
|
| `GEMINI_API_KEY` | Chave da API Gemini (obrigatória se não passar `api_key` na Library) |
|
|
67
|
-
| `GEMINI_MODEL` | Modelo (ex.: `gemini-
|
|
67
|
+
| `GEMINI_MODEL` | Modelo (ex.: `gemini-3.1-flash-lite`). Se omitido, usa `gemini-2.5-flash`. |
|
|
68
68
|
| `api_key` (import) | Sobrescreve `GEMINI_API_KEY` na importação da Library |
|
|
69
69
|
| `model` (import) | Sobrescreve `GEMINI_MODEL` na importação da Library |
|
|
70
70
|
|
|
@@ -73,7 +73,7 @@ Por padrão, a Library lê chave e modelo das variáveis de ambiente. Você tamb
|
|
|
73
73
|
```robot
|
|
74
74
|
*** Variables ***
|
|
75
75
|
${GEMINI_API_KEY} %{GEMINI_API_KEY}
|
|
76
|
-
${GEMINI_MODEL} gemini-2.5-flash
|
|
76
|
+
${GEMINI_MODEL} gemini-2.5-flash-lite
|
|
77
77
|
|
|
78
78
|
*** Settings ***
|
|
79
79
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
@@ -93,29 +93,10 @@ Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_K
|
|
|
93
93
|
|
|
94
94
|
> Evite commitar a chave literal no repositório; prefira `%{GEMINI_API_KEY}` ou secrets do CI.
|
|
95
95
|
|
|
96
|
-
##
|
|
97
|
-
|
|
98
|
-
```python
|
|
99
|
-
from pathlib import Path
|
|
100
|
-
from robotframework_gemini import GeminiOrchestrator
|
|
101
|
-
|
|
102
|
-
orchestrator = GeminiOrchestrator()
|
|
103
|
-
# ou explicitamente:
|
|
104
|
-
# orchestrator = GeminiOrchestrator(api_key="...", model="gemini-2.5-flash")
|
|
105
|
-
context = "Web dashboard with the 'Active' category filter applied."
|
|
106
|
-
evaluation = "Do the visible list items match the selected category?"
|
|
107
|
-
model_response = orchestrator.evaluate_with_image(context, evaluation, Path("screen.png"))
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Para formato de saída restrito (ex.: Yes/No), use `extra_instructions`:
|
|
96
|
+
## Documentação de Keywords
|
|
111
97
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
context,
|
|
115
|
-
evaluation,
|
|
116
|
-
extra_instructions="Reply with one word only: Yes or No.",
|
|
117
|
-
)
|
|
118
|
-
```
|
|
98
|
+
- Português: [docs/KEYWORDS.pt-BR.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md)
|
|
99
|
+
- English: [docs/KEYWORDS.en.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.en.md)
|
|
119
100
|
|
|
120
101
|
## Uso no Robot Framework
|
|
121
102
|
|
|
@@ -158,7 +139,7 @@ Import recomendado (RobotCode, runtime e PyPI):
|
|
|
158
139
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
159
140
|
```
|
|
160
141
|
|
|
161
|
-
Import explícito do pacote (
|
|
142
|
+
Import explícito do pacote (IDEs que preferem o caminho completo):
|
|
162
143
|
|
|
163
144
|
```robot
|
|
164
145
|
Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
@@ -200,19 +181,9 @@ ${rating_score}= Gemini Parse Rating ${model_response}
|
|
|
200
181
|
${rating_score}= Gemini Evaluate Text Rating Score ${context} ${evaluation}
|
|
201
182
|
```
|
|
202
183
|
|
|
203
|
-
Detalhes das três keywords de nota: [
|
|
204
|
-
|
|
205
|
-
Consulte também [`examples/demo_template.robot`](examples/demo_template.robot).
|
|
206
|
-
|
|
207
|
-
## Documentação de Keywords
|
|
208
|
-
|
|
209
|
-
- Português: [`docs/KEYWORDS.pt-BR.md`](docs/KEYWORDS.pt-BR.md)
|
|
210
|
-
- English: [`docs/KEYWORDS.en.md`](docs/KEYWORDS.en.md)
|
|
211
|
-
|
|
212
|
-
## Compatibilidade
|
|
184
|
+
Detalhes das três keywords de nota: [Notas 1–5 (pt-BR)](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md#notas-15-três-keywords-quando-usar).
|
|
213
185
|
|
|
214
|
-
|
|
215
|
-
- Variáveis legadas (`LLM_API_KEY`, `LLM_API_KEY_LIA`, `LLM_LIA_MODEL`) são mapeadas para `GEMINI_*` ao importar o pacote.
|
|
186
|
+
Consulte também [examples/demo_template.robot](https://github.com/carlosnizolli/robotframework-gemini/blob/main/examples/demo_template.robot).
|
|
216
187
|
|
|
217
188
|
## Testes
|
|
218
189
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# robotframework-gemini
|
|
2
2
|
|
|
3
|
-
Biblioteca
|
|
3
|
+
Biblioteca de **keywords do Robot Framework** para oráculos com **Google Gemini**: avaliação **só texto** (API, logs, JSON, etc.) ou **multimodal** com imagem (arquivo PNG ou captura do **Robot Framework Browser**).
|
|
4
4
|
|
|
5
5
|
- **Multimodal**: envia o texto do prompt e a captura como `Part` em bytes (`google-genai`).
|
|
6
6
|
- **Fluxo recomendado**: duas entradas — **contexto** (enquadramento do teste) e **avaliação** (critério ou pergunta objetiva).
|
|
@@ -30,7 +30,7 @@ python -m pip install -e ".[dev]"
|
|
|
30
30
|
| Variável / argumento | Função |
|
|
31
31
|
|----------------------|--------|
|
|
32
32
|
| `GEMINI_API_KEY` | Chave da API Gemini (obrigatória se não passar `api_key` na Library) |
|
|
33
|
-
| `GEMINI_MODEL` | Modelo (ex.: `gemini-
|
|
33
|
+
| `GEMINI_MODEL` | Modelo (ex.: `gemini-3.1-flash-lite`). Se omitido, usa `gemini-2.5-flash`. |
|
|
34
34
|
| `api_key` (import) | Sobrescreve `GEMINI_API_KEY` na importação da Library |
|
|
35
35
|
| `model` (import) | Sobrescreve `GEMINI_MODEL` na importação da Library |
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ Por padrão, a Library lê chave e modelo das variáveis de ambiente. Você tamb
|
|
|
39
39
|
```robot
|
|
40
40
|
*** Variables ***
|
|
41
41
|
${GEMINI_API_KEY} %{GEMINI_API_KEY}
|
|
42
|
-
${GEMINI_MODEL} gemini-2.5-flash
|
|
42
|
+
${GEMINI_MODEL} gemini-2.5-flash-lite
|
|
43
43
|
|
|
44
44
|
*** Settings ***
|
|
45
45
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
@@ -59,29 +59,10 @@ Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_K
|
|
|
59
59
|
|
|
60
60
|
> Evite commitar a chave literal no repositório; prefira `%{GEMINI_API_KEY}` ou secrets do CI.
|
|
61
61
|
|
|
62
|
-
##
|
|
63
|
-
|
|
64
|
-
```python
|
|
65
|
-
from pathlib import Path
|
|
66
|
-
from robotframework_gemini import GeminiOrchestrator
|
|
67
|
-
|
|
68
|
-
orchestrator = GeminiOrchestrator()
|
|
69
|
-
# ou explicitamente:
|
|
70
|
-
# orchestrator = GeminiOrchestrator(api_key="...", model="gemini-2.5-flash")
|
|
71
|
-
context = "Web dashboard with the 'Active' category filter applied."
|
|
72
|
-
evaluation = "Do the visible list items match the selected category?"
|
|
73
|
-
model_response = orchestrator.evaluate_with_image(context, evaluation, Path("screen.png"))
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Para formato de saída restrito (ex.: Yes/No), use `extra_instructions`:
|
|
62
|
+
## Documentação de Keywords
|
|
77
63
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
context,
|
|
81
|
-
evaluation,
|
|
82
|
-
extra_instructions="Reply with one word only: Yes or No.",
|
|
83
|
-
)
|
|
84
|
-
```
|
|
64
|
+
- Português: [docs/KEYWORDS.pt-BR.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md)
|
|
65
|
+
- English: [docs/KEYWORDS.en.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.en.md)
|
|
85
66
|
|
|
86
67
|
## Uso no Robot Framework
|
|
87
68
|
|
|
@@ -124,7 +105,7 @@ Import recomendado (RobotCode, runtime e PyPI):
|
|
|
124
105
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
125
106
|
```
|
|
126
107
|
|
|
127
|
-
Import explícito do pacote (
|
|
108
|
+
Import explícito do pacote (IDEs que preferem o caminho completo):
|
|
128
109
|
|
|
129
110
|
```robot
|
|
130
111
|
Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
@@ -166,19 +147,9 @@ ${rating_score}= Gemini Parse Rating ${model_response}
|
|
|
166
147
|
${rating_score}= Gemini Evaluate Text Rating Score ${context} ${evaluation}
|
|
167
148
|
```
|
|
168
149
|
|
|
169
|
-
Detalhes das três keywords de nota: [
|
|
170
|
-
|
|
171
|
-
Consulte também [`examples/demo_template.robot`](examples/demo_template.robot).
|
|
172
|
-
|
|
173
|
-
## Documentação de Keywords
|
|
174
|
-
|
|
175
|
-
- Português: [`docs/KEYWORDS.pt-BR.md`](docs/KEYWORDS.pt-BR.md)
|
|
176
|
-
- English: [`docs/KEYWORDS.en.md`](docs/KEYWORDS.en.md)
|
|
177
|
-
|
|
178
|
-
## Compatibilidade
|
|
150
|
+
Detalhes das três keywords de nota: [Notas 1–5 (pt-BR)](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md#notas-15-três-keywords-quando-usar).
|
|
179
151
|
|
|
180
|
-
|
|
181
|
-
- Variáveis legadas (`LLM_API_KEY`, `LLM_API_KEY_LIA`, `LLM_LIA_MODEL`) são mapeadas para `GEMINI_*` ao importar o pacote.
|
|
152
|
+
Consulte também [examples/demo_template.robot](https://github.com/carlosnizolli/robotframework-gemini/blob/main/examples/demo_template.robot).
|
|
182
153
|
|
|
183
154
|
## Testes
|
|
184
155
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "robotframework-gemini"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "Google Gemini oracles for Robot Framework: text-only and multimodal (image) assertions."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/client.py
RENAMED
|
File without changes
|
{robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/legacy_env.py
RENAMED
|
File without changes
|
{robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/library.py
RENAMED
|
File without changes
|
|
File without changes
|
{robotframework_gemini-0.3.1 → robotframework_gemini-0.3.2}/src/robotframework_gemini/py.typed
RENAMED
|
File without changes
|
|
File without changes
|