mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
doc: small change to readablity. (#281)
Co-authored-by: Ted Fulk <tfulk@getspiffy.com>
This commit is contained in:
@@ -26,12 +26,11 @@ Our `instructor.patch` for the `OpenAI` class introduces three key enhancements:
|
||||
|
||||
- **Response Mode:** Specify a Pydantic model to streamline data extraction.
|
||||
- **Max Retries:** Set your desired number of retry attempts for requests.
|
||||
- **Validation Context:** Provide a context object for enhanced validator access.
|
||||
A Glimpse into Instructor's Capabilities
|
||||
- **Validation Context:** Provide a context object for enhanced validator access. A Glimpse into Instructor's Capabilities.
|
||||
|
||||
!!! note "Using Validators"
|
||||
|
||||
Learn more about validators checkout our blog post [Good llm validation is just good validation](https://jxnl.github.io/instructor/blog/2023/10/23/good-llm-validation-is-just-good-validation/)
|
||||
Learn more about validators checkout our blog post [Good llm validation is just good validation](https://jxnl.github.io/instructor/blog/2023/10/23/good-llm-validation-is-just-good-validation/)
|
||||
|
||||
With Instructor, your code becomes more efficient and readable. Here’s a quick peek:
|
||||
|
||||
@@ -62,7 +61,7 @@ assert user.name == "Jason"
|
||||
assert user.age == 25
|
||||
```
|
||||
|
||||
**"Using `openai<1.0.0`"**
|
||||
### "Using `openai<1.0.0`"
|
||||
|
||||
If you're using `openai<1.0.0` then make sure you `pip install instructor<0.3.0`
|
||||
where you can patch a global client like so:
|
||||
@@ -79,7 +78,7 @@ user = openai.ChatCompletion.create(
|
||||
)
|
||||
```
|
||||
|
||||
**"Using async clients"**
|
||||
### "Using async clients"
|
||||
|
||||
For async clients you must use apatch vs patch like so:
|
||||
|
||||
@@ -174,7 +173,7 @@ except ValidationError as e:
|
||||
print(e)
|
||||
```
|
||||
|
||||
Its important to not here that the error message is generated by the LLM, not the code, so it'll be helpful for re asking the model.
|
||||
Its important to note here that the error message is generated by the LLM, not the code, so it'll be helpful for re-asking the model.
|
||||
|
||||
```plaintext
|
||||
1 validation error for QuestionAnswer
|
||||
@@ -226,7 +225,7 @@ We invite you to contribute evals in pytest as a way to monitor the quality of t
|
||||
|
||||
If you want to help out checkout some of the issues marked as `good-first-issue` or `help-wanted`. Found [here](https://github.com/jxnl/instructor/labels/good%20first%20issue). They could be anything from code improvements, a guest blog post, or a new cook book.
|
||||
|
||||
## CLI
|
||||
## CLI
|
||||
|
||||
We also provide some added CLI functionality for easy convinience
|
||||
|
||||
|
||||
Reference in New Issue
Block a user