Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}

- name: Run Gemini Tests
run: poetry run pytest tests/llm/test_gemini
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

- name: Generate coverage report
if: matrix.python-version == '3.11'
run: |
Expand Down
9 changes: 9 additions & 0 deletions instructor/reask.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ def reask_gemini_tools(
from google.ai import generativelanguage as glm # type: ignore

reask_msgs = [
{
"role": "model",
"parts": [
glm.FunctionCall(
name=response.parts[0].function_call.name,
args=response.parts[0].function_call.args,
)
],
},
{
"role": "function",
"parts": [
Expand Down
2 changes: 1 addition & 1 deletion tests/llm/test_gemini/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import instructor

models: list[str] = ["models/gemini-1.5-flash-latest"]
models: list[str] = ["models/gemini-1.5-flash-8b"]
modes = [instructor.Mode.GEMINI_TOOLS, instructor.Mode.GEMINI_JSON]
Loading