You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run: uv run pytest tests/ -k 'not llm and not openai and not gemini and not anthropic and not cohere and not vertexai and not mistral and not xai and not docs'
25
+
run: >-
26
+
uv run pytest tests/ --asyncio-mode=auto -n auto
27
+
-k 'not test_core_providers and not test_openai and not test_anthropic
28
+
and not test_gemini and not test_genai and not test_writer and not
29
+
test_vertexai and not docs'
26
30
env:
27
31
INSTRUCTOR_ENV: CI
28
32
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@@ -31,15 +35,110 @@ jobs:
31
35
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
32
36
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
33
37
38
+
# Core provider tests for OpenAI
39
+
core-openai:
40
+
name: Core Provider Tests (OpenAI)
41
+
runs-on: ubuntu-latest
42
+
needs: core-tests
43
+
44
+
steps:
45
+
- uses: actions/checkout@v2
46
+
- name: Install uv
47
+
uses: astral-sh/setup-uv@v4
48
+
with:
49
+
enable-cache: true
50
+
- name: Set up Python
51
+
run: uv python install 3.11
52
+
- name: Install the project
53
+
run: uv sync --all-extras
54
+
- name: Run core provider tests (OpenAI)
55
+
run: uv run pytest tests/llm/test_core_providers -v --asyncio-mode=auto -n auto -k "openai"
56
+
env:
57
+
INSTRUCTOR_ENV: CI
58
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
59
+
60
+
# Core provider tests for Anthropic
61
+
core-anthropic:
62
+
name: Core Provider Tests (Anthropic)
63
+
runs-on: ubuntu-latest
64
+
needs: core-tests
65
+
66
+
steps:
67
+
- uses: actions/checkout@v2
68
+
- name: Install uv
69
+
uses: astral-sh/setup-uv@v4
70
+
with:
71
+
enable-cache: true
72
+
- name: Set up Python
73
+
run: uv python install 3.11
74
+
- name: Install the project
75
+
run: uv sync --all-extras
76
+
- name: Run core provider tests (Anthropic)
77
+
run: uv run pytest tests/llm/test_core_providers -v --asyncio-mode=auto -n auto -k "anthropic"
run: uv run pytest tests/llm/test_core_providers -v --asyncio-mode=auto -n auto -k "google"
100
+
env:
101
+
INSTRUCTOR_ENV: CI
102
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
103
+
104
+
# Core provider tests for other providers
105
+
core-other:
106
+
name: Core Provider Tests (Other)
107
+
runs-on: ubuntu-latest
108
+
needs: core-tests
109
+
110
+
steps:
111
+
- uses: actions/checkout@v2
112
+
- name: Install uv
113
+
uses: astral-sh/setup-uv@v4
114
+
with:
115
+
enable-cache: true
116
+
- name: Set up Python
117
+
run: uv python install 3.11
118
+
- name: Install the project
119
+
run: uv sync --all-extras
120
+
- name: Run core provider tests (Cohere, xAI, Mistral, etc)
121
+
run: uv run pytest tests/llm/test_core_providers -v --asyncio-mode=auto -n auto -k "cohere or xai or mistral or cerebras or fireworks or writer or perplexity"
Copy file name to clipboardExpand all lines: docs/integrations/google.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,6 +275,16 @@ for user in users:
275
275
#> name='Mike' age=28
276
276
```
277
277
278
+
## Known Limitations (as of Nov 12, 2024)
279
+
280
+
Google Gemini has the following known limitations when used with Instructor:
281
+
282
+
1.**Union Types**: Gemini does not support Union types (except for Optional). Use separate response models or Literal types instead.
283
+
2.**Enum Types**: Gemini returns string values instead of properly typed Enum instances. You may need to manually convert strings to enums after extraction.
284
+
3.**Union Streaming**: Streaming is not supported for Union types with Iterable.
285
+
286
+
These limitations are specific to Google Gemini and do not affect other providers like OpenAI or Anthropic. Tests automatically skip these features for Google to prevent failures.
287
+
278
288
## Instructor Modes
279
289
280
290
We provide several modes to make it easy to work with the different response models that Gemini supports:
0 commit comments