Skip to content

Commit

Permalink
Adding support for Gemini-8b and 2.0 (#1274)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanleomk authored Dec 25, 2024
1 parent 5742e3d commit b0c968b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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]

0 comments on commit b0c968b

Please sign in to comment.