Skip to content

Commit

Permalink
Merge branch 'main' into feature/sambanovacloud_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-92 authored Jan 13, 2025
2 parents f65cb8d + f86df78 commit d1454ba
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion docs/concepts/patching.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Gemini tool calling comes with some known limitations:
- Gemini tool calling is incompatible with Pydantic schema customizations such as examples due to API limitations and may result in errors
- Gemini can sometimes call the wrong function name, resulting in malformed or invalid json
- Gemini tool calling could fail with enum and literal field types
- Gemini tool calling doesn't preserve the order of the fields in the response. Don't rely on the order of the fields in the response.

```python
import instructor
Expand All @@ -45,7 +46,7 @@ client = instructor.from_gemini(
)
```

### Gemini Vertex AI Tool Callin
### Gemini Vertex AI Tool Calling

This method allows us to get structured output from Gemini via tool calling with the Vertex AI SDK.

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/document_segmentation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Document Segmentation with LLMs: A Comprehensive Guide
title: 'Document Segmentation with LLMs: A Comprehensive Guide'
description: Learn effective document segmentation techniques using Cohere's LLM, enhancing comprehension of complex texts.
---

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/groq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Using Groq for Inference: Setup and Example
title: 'Using Groq for Inference: Setup and Example'
description: Learn how to use Groq for inference with the mixtral-8x7b model, including API setup and a practical Python example.
---

Expand Down Expand Up @@ -65,4 +65,4 @@ print(resp.model_dump_json(indent=2))
}
"""
```
You can find another example called groq_example2.py under examples/groq of this repository.
You can find another example called groq_example2.py under examples/groq of this repository.
2 changes: 1 addition & 1 deletion docs/examples/knowledge_graph.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Visualizing Knowledge Graphs: A Guide to Complex Topics
title: 'Visualizing Knowledge Graphs: A Guide to Complex Topics'
description: Learn how to create and update knowledge graphs using Python, OpenAI's API, Pydantic, and Graphviz for enhanced understanding of complex subjects.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/planning-tasks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Query Planning with OpenAI: A Step-by-Step Guide
title: 'Query Planning with OpenAI: A Step-by-Step Guide'
description: Learn how to effectively plan and execute complex query plans using OpenAI's Function Call model for systematic information gathering.
---

Expand Down
2 changes: 1 addition & 1 deletion examples/citations/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AnswerWithCitaton(BaseModel):

class Validation(BaseModel):
"""
Verfication response from the LLM,
Verification response from the LLM,
the error message should be detailed if the is_valid is False
but keep it to less than 100 characters, reference specific
attributes that you are comparing, use `...` is the string is too long
Expand Down
12 changes: 7 additions & 5 deletions instructor/client_gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@
@overload
def from_gemini(
client: genai.GenerativeModel,
mode: instructor.Mode = instructor.Mode.GEMINI_TOOLS,
mode: instructor.Mode = instructor.Mode.GEMINI_JSON,
use_async: Literal[True] = True,
**kwargs: Any,
) -> instructor.AsyncInstructor: ...
) -> instructor.AsyncInstructor:
...


@overload
def from_gemini(
client: genai.GenerativeModel,
mode: instructor.Mode = instructor.Mode.GEMINI_TOOLS,
mode: instructor.Mode = instructor.Mode.GEMINI_JSON,
use_async: Literal[False] = False,
**kwargs: Any,
) -> instructor.Instructor: ...
) -> instructor.Instructor:
...


def from_gemini(
client: genai.GenerativeModel,
mode: instructor.Mode = instructor.Mode.GEMINI_TOOLS,
mode: instructor.Mode = instructor.Mode.GEMINI_JSON,
use_async: bool = False,
**kwargs: Any,
) -> instructor.Instructor | instructor.AsyncInstructor:
Expand Down

0 comments on commit d1454ba

Please sign in to comment.