robotframework-gemini 0.3.2__tar.gz → 0.3.3__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.2 → robotframework_gemini-0.3.3}/PKG-INFO +58 -56
- robotframework_gemini-0.3.3/README.md +166 -0
- robotframework_gemini-0.3.2/README.md → robotframework_gemini-0.3.3/README.pt-BR.md +4 -2
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/pyproject.toml +3 -2
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/__init__.py +1 -1
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/.gitignore +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/LICENSE +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/BrowserGeminiLibrary.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/GeminiLibrary.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/browser_helpers.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/client.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/legacy_env.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/library.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/prompt_build.py +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/py.typed +0 -0
- {robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/response_parse.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: robotframework-gemini
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
-
Project-URL: Documentation, https://github.com/carlosnizolli/robotframework-gemini
|
|
6
|
+
Project-URL: Documentation, https://github.com/carlosnizolli/robotframework-gemini/blob/main/README.md
|
|
7
7
|
Project-URL: Repository, https://github.com/carlosnizolli/robotframework-gemini
|
|
8
8
|
Project-URL: Issues, https://github.com/carlosnizolli/robotframework-gemini/issues
|
|
9
9
|
Project-URL: Changelog, https://github.com/carlosnizolli/robotframework-gemini/releases
|
|
@@ -34,91 +34,93 @@ Description-Content-Type: text/markdown
|
|
|
34
34
|
|
|
35
35
|
# robotframework-gemini
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
**English** | [Português (Brasil)](README.pt-BR.md)
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
- **Fluxo recomendado**: duas entradas — **contexto** (enquadramento do teste) e **avaliação** (critério ou pergunta objetiva).
|
|
41
|
-
- **Browser opcional**: keywords de screenshot exigem `Library Browser`; keywords de texto funcionam sem navegador.
|
|
39
|
+
Robot Framework **keyword library** for **Google Gemini** oracles: **text-only** evaluation (API payloads, logs, JSON, etc.) or **multimodal** checks with an image (PNG file or a **Robot Framework Browser** screenshot).
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
- **Multimodal**: sends prompt text and the capture as a byte `Part` (`google-genai`).
|
|
42
|
+
- **Recommended flow**: two inputs — **context** (test framing) and **evaluation** (criterion or yes/no question).
|
|
43
|
+
- **Browser optional**: screenshot keywords need `Library Browser`; text keywords work without a browser.
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
48
|
pip install robotframework-gemini
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
With Robot Framework Browser (Playwright) screenshot support:
|
|
50
52
|
|
|
51
53
|
```bash
|
|
52
54
|
pip install "robotframework-gemini[browser]"
|
|
53
55
|
python -m pip install robotframework
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
Local development:
|
|
57
59
|
|
|
58
60
|
```bash
|
|
59
61
|
python -m pip install -e ".[dev]"
|
|
60
62
|
```
|
|
61
63
|
|
|
62
|
-
##
|
|
64
|
+
## Environment variables and Library import
|
|
63
65
|
|
|
64
|
-
|
|
|
65
|
-
|
|
66
|
-
| `GEMINI_API_KEY` |
|
|
67
|
-
| `GEMINI_MODEL` |
|
|
68
|
-
| `api_key` (import) |
|
|
69
|
-
| `model` (import) |
|
|
66
|
+
| Variable / argument | Purpose |
|
|
67
|
+
|---------------------|---------|
|
|
68
|
+
| `GEMINI_API_KEY` | Gemini API key (required unless you pass `api_key` on the Library) |
|
|
69
|
+
| `GEMINI_MODEL` | Model id (e.g. `gemini-2.5-flash`). If omitted, defaults to `gemini-2.5-flash`. |
|
|
70
|
+
| `api_key` (import) | Overrides `GEMINI_API_KEY` at Library import |
|
|
71
|
+
| `model` (import) | Overrides `GEMINI_MODEL` at Library import |
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
By default the Library reads key and model from the environment. You can also pass them on import (useful in CI or suites that keep credentials in Robot variables):
|
|
72
74
|
|
|
73
75
|
```robot
|
|
74
76
|
*** Variables ***
|
|
75
77
|
${GEMINI_API_KEY} %{GEMINI_API_KEY}
|
|
76
|
-
${GEMINI_MODEL} gemini-2.5-flash
|
|
78
|
+
${GEMINI_MODEL} gemini-2.5-flash
|
|
77
79
|
|
|
78
80
|
*** Settings ***
|
|
79
81
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
80
82
|
```
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
Model only (key still comes from the environment):
|
|
83
85
|
|
|
84
86
|
```robot
|
|
85
87
|
Library GeminiLibrary model=gemini-2.5-flash
|
|
86
88
|
```
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
Explicit package import (equivalent):
|
|
89
91
|
|
|
90
92
|
```robot
|
|
91
93
|
Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
92
94
|
```
|
|
93
95
|
|
|
94
|
-
>
|
|
96
|
+
> Do not commit a literal API key; prefer `%{GEMINI_API_KEY}` or CI secrets.
|
|
95
97
|
|
|
96
|
-
##
|
|
98
|
+
## Keyword documentation
|
|
97
99
|
|
|
98
|
-
- Português: [docs/KEYWORDS.pt-BR.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md)
|
|
99
100
|
- English: [docs/KEYWORDS.en.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.en.md)
|
|
101
|
+
- Português: [docs/KEYWORDS.pt-BR.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md)
|
|
100
102
|
|
|
101
|
-
##
|
|
103
|
+
## Usage in Robot Framework
|
|
102
104
|
|
|
103
|
-
> **
|
|
105
|
+
> **Note:** examples use `Set Variable` and `Catenate` instead of the `VAR` keyword (Robot Framework 7.0+) to stay compatible with older Robot Framework versions.
|
|
104
106
|
|
|
105
|
-
###
|
|
107
|
+
### Text only (no Browser)
|
|
106
108
|
|
|
107
109
|
```robot
|
|
108
110
|
*** Settings ***
|
|
109
111
|
Library GeminiLibrary
|
|
110
112
|
|
|
111
113
|
*** Keywords ***
|
|
112
|
-
|
|
114
|
+
Validate API response
|
|
113
115
|
${context}= Set Variable {"status": "ok", "items": 3}
|
|
114
|
-
${evaluation}= Set Variable
|
|
116
|
+
${evaluation}= Set Variable Does the payload indicate success with items?
|
|
115
117
|
${model_response}= Gemini Evaluate Text ${context} ${evaluation}
|
|
116
118
|
Log ${model_response}
|
|
117
119
|
```
|
|
118
120
|
|
|
119
|
-
###
|
|
121
|
+
### With a screenshot (Browser)
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
Import **Browser** before **Gemini**:
|
|
122
124
|
|
|
123
125
|
```robot
|
|
124
126
|
*** Settings ***
|
|
@@ -126,73 +128,73 @@ Library Browser
|
|
|
126
128
|
Library GeminiLibrary
|
|
127
129
|
|
|
128
130
|
*** Keywords ***
|
|
129
|
-
|
|
130
|
-
${context}= Set Variable
|
|
131
|
-
${evaluation}= Set Variable
|
|
131
|
+
Check screen against a neutral criterion
|
|
132
|
+
${context}= Set Variable List filtered by Active status.
|
|
133
|
+
${evaluation}= Set Variable Do all visible items show Active status?
|
|
132
134
|
${model_response}= Gemini Evaluate With Screen ${context} ${evaluation}
|
|
133
135
|
Log ${model_response}
|
|
134
136
|
```
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
Recommended import (RobotCode, runtime, and PyPI):
|
|
137
139
|
|
|
138
140
|
```robot
|
|
139
141
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
140
142
|
```
|
|
141
143
|
|
|
142
|
-
|
|
144
|
+
Explicit package path (IDEs that prefer a full Python path):
|
|
143
145
|
|
|
144
146
|
```robot
|
|
145
147
|
Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
146
148
|
```
|
|
147
149
|
|
|
148
|
-
### IDE
|
|
150
|
+
### IDE and RobotCode
|
|
149
151
|
|
|
150
|
-
|
|
|
151
|
-
|
|
152
|
-
| `Library GeminiLibrary` |
|
|
153
|
-
| `Library robotframework_gemini.library.GeminiLibrary` |
|
|
152
|
+
| Import form | Resolved by |
|
|
153
|
+
|-------------|-------------|
|
|
154
|
+
| `Library GeminiLibrary` | Top-level `GeminiLibrary.py` module (installed in the wheel or via `src/` in a clone) |
|
|
155
|
+
| `Library robotframework_gemini.library.GeminiLibrary` | Standard Python package path |
|
|
154
156
|
|
|
155
|
-
|
|
157
|
+
In a **repository clone**, without installing:
|
|
156
158
|
|
|
157
|
-
- [`robot.toml`](robot.toml) — `python-path = ["src"]`
|
|
158
|
-
- [`.vscode/settings.json`](.vscode/settings.json) — `extraPaths`
|
|
159
|
+
- [`robot.toml`](robot.toml) — `python-path = ["src"]` for RobotCode/LSP
|
|
160
|
+
- [`.vscode/settings.json`](.vscode/settings.json) — `extraPaths` for Pylance/Cursor
|
|
159
161
|
|
|
160
|
-
|
|
162
|
+
With a local venv: `pip install -e ".[dev]"`, then reload the IDE window after changes.
|
|
161
163
|
|
|
162
|
-
|
|
164
|
+
With an image file already saved:
|
|
163
165
|
|
|
164
166
|
```robot
|
|
165
|
-
Browser.Take Screenshot ${OUTPUT_DIR}/
|
|
166
|
-
${model_response}= Gemini Evaluate With Image File ${context} ${evaluation} ${OUTPUT_DIR}/
|
|
167
|
+
Browser.Take Screenshot ${OUTPUT_DIR}/screen.png
|
|
168
|
+
${model_response}= Gemini Evaluate With Image File ${context} ${evaluation} ${OUTPUT_DIR}/screen.png
|
|
167
169
|
```
|
|
168
170
|
|
|
169
|
-
|
|
171
|
+
Verdict via prompt (first line) and 1–5 score:
|
|
170
172
|
|
|
171
173
|
```robot
|
|
172
174
|
${model_response}= Gemini Evaluate With Screen ${context} ${evaluation}
|
|
173
|
-
... extra_instructions=
|
|
175
|
+
... extra_instructions=Reply with one word on the first line: Yes or No.
|
|
174
176
|
${verdict}= Get Line ${model_response} 0
|
|
175
|
-
Should Be Equal As Strings ${verdict}
|
|
177
|
+
Should Be Equal As Strings ${verdict} Yes
|
|
176
178
|
|
|
177
|
-
#
|
|
179
|
+
# Score 1–5: two steps (log the reason) or one-line shortcut
|
|
178
180
|
${model_response}= Gemini Evaluate Text Rating ${context} ${evaluation}
|
|
179
181
|
${rating_score}= Gemini Parse Rating ${model_response}
|
|
180
182
|
|
|
181
183
|
${rating_score}= Gemini Evaluate Text Rating Score ${context} ${evaluation}
|
|
182
184
|
```
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
Details for the three rating keywords: [Scores 1–5 (EN)](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.en.md#scores-15-three-keywords-when-to-use).
|
|
185
187
|
|
|
186
|
-
|
|
188
|
+
See also [examples/demo_template.robot](https://github.com/carlosnizolli/robotframework-gemini/blob/main/examples/demo_template.robot).
|
|
187
189
|
|
|
188
|
-
##
|
|
190
|
+
## Tests
|
|
189
191
|
|
|
190
192
|
```bash
|
|
191
193
|
pytest
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
|
|
196
|
+
Tests mock `generate_content`; there are no real API calls.
|
|
195
197
|
|
|
196
|
-
##
|
|
198
|
+
## License
|
|
197
199
|
|
|
198
200
|
MIT.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# robotframework-gemini
|
|
2
|
+
|
|
3
|
+
**English** | [Português (Brasil)](README.pt-BR.md)
|
|
4
|
+
|
|
5
|
+
Robot Framework **keyword library** for **Google Gemini** oracles: **text-only** evaluation (API payloads, logs, JSON, etc.) or **multimodal** checks with an image (PNG file or a **Robot Framework Browser** screenshot).
|
|
6
|
+
|
|
7
|
+
- **Multimodal**: sends prompt text and the capture as a byte `Part` (`google-genai`).
|
|
8
|
+
- **Recommended flow**: two inputs — **context** (test framing) and **evaluation** (criterion or yes/no question).
|
|
9
|
+
- **Browser optional**: screenshot keywords need `Library Browser`; text keywords work without a browser.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install robotframework-gemini
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
With Robot Framework Browser (Playwright) screenshot support:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install "robotframework-gemini[browser]"
|
|
21
|
+
python -m pip install robotframework
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Local development:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python -m pip install -e ".[dev]"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Environment variables and Library import
|
|
31
|
+
|
|
32
|
+
| Variable / argument | Purpose |
|
|
33
|
+
|---------------------|---------|
|
|
34
|
+
| `GEMINI_API_KEY` | Gemini API key (required unless you pass `api_key` on the Library) |
|
|
35
|
+
| `GEMINI_MODEL` | Model id (e.g. `gemini-2.5-flash`). If omitted, defaults to `gemini-2.5-flash`. |
|
|
36
|
+
| `api_key` (import) | Overrides `GEMINI_API_KEY` at Library import |
|
|
37
|
+
| `model` (import) | Overrides `GEMINI_MODEL` at Library import |
|
|
38
|
+
|
|
39
|
+
By default the Library reads key and model from the environment. You can also pass them on import (useful in CI or suites that keep credentials in Robot variables):
|
|
40
|
+
|
|
41
|
+
```robot
|
|
42
|
+
*** Variables ***
|
|
43
|
+
${GEMINI_API_KEY} %{GEMINI_API_KEY}
|
|
44
|
+
${GEMINI_MODEL} gemini-2.5-flash
|
|
45
|
+
|
|
46
|
+
*** Settings ***
|
|
47
|
+
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Model only (key still comes from the environment):
|
|
51
|
+
|
|
52
|
+
```robot
|
|
53
|
+
Library GeminiLibrary model=gemini-2.5-flash
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Explicit package import (equivalent):
|
|
57
|
+
|
|
58
|
+
```robot
|
|
59
|
+
Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> Do not commit a literal API key; prefer `%{GEMINI_API_KEY}` or CI secrets.
|
|
63
|
+
|
|
64
|
+
## Keyword documentation
|
|
65
|
+
|
|
66
|
+
- English: [docs/KEYWORDS.en.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.en.md)
|
|
67
|
+
- Português: [docs/KEYWORDS.pt-BR.md](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.pt-BR.md)
|
|
68
|
+
|
|
69
|
+
## Usage in Robot Framework
|
|
70
|
+
|
|
71
|
+
> **Note:** examples use `Set Variable` and `Catenate` instead of the `VAR` keyword (Robot Framework 7.0+) to stay compatible with older Robot Framework versions.
|
|
72
|
+
|
|
73
|
+
### Text only (no Browser)
|
|
74
|
+
|
|
75
|
+
```robot
|
|
76
|
+
*** Settings ***
|
|
77
|
+
Library GeminiLibrary
|
|
78
|
+
|
|
79
|
+
*** Keywords ***
|
|
80
|
+
Validate API response
|
|
81
|
+
${context}= Set Variable {"status": "ok", "items": 3}
|
|
82
|
+
${evaluation}= Set Variable Does the payload indicate success with items?
|
|
83
|
+
${model_response}= Gemini Evaluate Text ${context} ${evaluation}
|
|
84
|
+
Log ${model_response}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### With a screenshot (Browser)
|
|
88
|
+
|
|
89
|
+
Import **Browser** before **Gemini**:
|
|
90
|
+
|
|
91
|
+
```robot
|
|
92
|
+
*** Settings ***
|
|
93
|
+
Library Browser
|
|
94
|
+
Library GeminiLibrary
|
|
95
|
+
|
|
96
|
+
*** Keywords ***
|
|
97
|
+
Check screen against a neutral criterion
|
|
98
|
+
${context}= Set Variable List filtered by Active status.
|
|
99
|
+
${evaluation}= Set Variable Do all visible items show Active status?
|
|
100
|
+
${model_response}= Gemini Evaluate With Screen ${context} ${evaluation}
|
|
101
|
+
Log ${model_response}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Recommended import (RobotCode, runtime, and PyPI):
|
|
105
|
+
|
|
106
|
+
```robot
|
|
107
|
+
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Explicit package path (IDEs that prefer a full Python path):
|
|
111
|
+
|
|
112
|
+
```robot
|
|
113
|
+
Library robotframework_gemini.library.GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### IDE and RobotCode
|
|
117
|
+
|
|
118
|
+
| Import form | Resolved by |
|
|
119
|
+
|-------------|-------------|
|
|
120
|
+
| `Library GeminiLibrary` | Top-level `GeminiLibrary.py` module (installed in the wheel or via `src/` in a clone) |
|
|
121
|
+
| `Library robotframework_gemini.library.GeminiLibrary` | Standard Python package path |
|
|
122
|
+
|
|
123
|
+
In a **repository clone**, without installing:
|
|
124
|
+
|
|
125
|
+
- [`robot.toml`](robot.toml) — `python-path = ["src"]` for RobotCode/LSP
|
|
126
|
+
- [`.vscode/settings.json`](.vscode/settings.json) — `extraPaths` for Pylance/Cursor
|
|
127
|
+
|
|
128
|
+
With a local venv: `pip install -e ".[dev]"`, then reload the IDE window after changes.
|
|
129
|
+
|
|
130
|
+
With an image file already saved:
|
|
131
|
+
|
|
132
|
+
```robot
|
|
133
|
+
Browser.Take Screenshot ${OUTPUT_DIR}/screen.png
|
|
134
|
+
${model_response}= Gemini Evaluate With Image File ${context} ${evaluation} ${OUTPUT_DIR}/screen.png
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Verdict via prompt (first line) and 1–5 score:
|
|
138
|
+
|
|
139
|
+
```robot
|
|
140
|
+
${model_response}= Gemini Evaluate With Screen ${context} ${evaluation}
|
|
141
|
+
... extra_instructions=Reply with one word on the first line: Yes or No.
|
|
142
|
+
${verdict}= Get Line ${model_response} 0
|
|
143
|
+
Should Be Equal As Strings ${verdict} Yes
|
|
144
|
+
|
|
145
|
+
# Score 1–5: two steps (log the reason) or one-line shortcut
|
|
146
|
+
${model_response}= Gemini Evaluate Text Rating ${context} ${evaluation}
|
|
147
|
+
${rating_score}= Gemini Parse Rating ${model_response}
|
|
148
|
+
|
|
149
|
+
${rating_score}= Gemini Evaluate Text Rating Score ${context} ${evaluation}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Details for the three rating keywords: [Scores 1–5 (EN)](https://github.com/carlosnizolli/robotframework-gemini/blob/main/docs/KEYWORDS.en.md#scores-15-three-keywords-when-to-use).
|
|
153
|
+
|
|
154
|
+
See also [examples/demo_template.robot](https://github.com/carlosnizolli/robotframework-gemini/blob/main/examples/demo_template.robot).
|
|
155
|
+
|
|
156
|
+
## Tests
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pytest
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Tests mock `generate_content`; there are no real API calls.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
MIT.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# robotframework-gemini
|
|
2
2
|
|
|
3
|
+
[English](README.md) | **Português (Brasil)**
|
|
4
|
+
|
|
3
5
|
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
6
|
|
|
5
7
|
- **Multimodal**: envia o texto do prompt e a captura como `Part` em bytes (`google-genai`).
|
|
@@ -30,7 +32,7 @@ python -m pip install -e ".[dev]"
|
|
|
30
32
|
| Variável / argumento | Função |
|
|
31
33
|
|----------------------|--------|
|
|
32
34
|
| `GEMINI_API_KEY` | Chave da API Gemini (obrigatória se não passar `api_key` na Library) |
|
|
33
|
-
| `GEMINI_MODEL` | Modelo (ex.: `gemini-
|
|
35
|
+
| `GEMINI_MODEL` | Modelo (ex.: `gemini-2.5-flash`). Se omitido, usa `gemini-2.5-flash`. |
|
|
34
36
|
| `api_key` (import) | Sobrescreve `GEMINI_API_KEY` na importação da Library |
|
|
35
37
|
| `model` (import) | Sobrescreve `GEMINI_MODEL` na importação da Library |
|
|
36
38
|
|
|
@@ -39,7 +41,7 @@ Por padrão, a Library lê chave e modelo das variáveis de ambiente. Você tamb
|
|
|
39
41
|
```robot
|
|
40
42
|
*** Variables ***
|
|
41
43
|
${GEMINI_API_KEY} %{GEMINI_API_KEY}
|
|
42
|
-
${GEMINI_MODEL} gemini-2.5-flash
|
|
44
|
+
${GEMINI_MODEL} gemini-2.5-flash
|
|
43
45
|
|
|
44
46
|
*** Settings ***
|
|
45
47
|
Library GeminiLibrary api_key=${GEMINI_API_KEY} model=${GEMINI_MODEL}
|
|
@@ -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.3"
|
|
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"
|
|
@@ -31,7 +31,7 @@ dependencies = [
|
|
|
31
31
|
|
|
32
32
|
[project.urls]
|
|
33
33
|
Homepage = "https://github.com/carlosnizolli/robotframework-gemini"
|
|
34
|
-
Documentation = "https://github.com/carlosnizolli/robotframework-gemini
|
|
34
|
+
Documentation = "https://github.com/carlosnizolli/robotframework-gemini/blob/main/README.md"
|
|
35
35
|
Repository = "https://github.com/carlosnizolli/robotframework-gemini"
|
|
36
36
|
Issues = "https://github.com/carlosnizolli/robotframework-gemini/issues"
|
|
37
37
|
Changelog = "https://github.com/carlosnizolli/robotframework-gemini/releases"
|
|
@@ -67,6 +67,7 @@ include = [
|
|
|
67
67
|
"src/BrowserGeminiLibrary.py",
|
|
68
68
|
"LICENSE",
|
|
69
69
|
"README.md",
|
|
70
|
+
"README.pt-BR.md",
|
|
70
71
|
]
|
|
71
72
|
|
|
72
73
|
[tool.pytest.ini_options]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/client.py
RENAMED
|
File without changes
|
{robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/legacy_env.py
RENAMED
|
File without changes
|
{robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/library.py
RENAMED
|
File without changes
|
|
File without changes
|
{robotframework_gemini-0.3.2 → robotframework_gemini-0.3.3}/src/robotframework_gemini/py.typed
RENAMED
|
File without changes
|
|
File without changes
|