From a1badeebd84df8aeb44cc09844a8944e907324c3 Mon Sep 17 00:00:00 2001 From: Clifford Ressel Date: Mon, 1 Jan 2024 17:23:57 -0500 Subject: [PATCH] Small documentation updates (#313) --- docs/index.md | 6 +++--- docs/why.md | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/index.md b/docs/index.md index 6509400..daae4e1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -42,7 +42,7 @@ assert user.age == 25 **Using async clients** -For async clients you must use apatch vs patch like so: +For async clients you must use `apatch` vs `patch` like so: ```py import instructor @@ -88,7 +88,7 @@ assert isinstance(model, UserExtract) The question of using Instructor is fundamentally a question of why to use Pydantic. -1. **Powered by type hints** — Instructor is powered by Pydantic, which is powered by type hints. Schema validation, prompting is controleld by type annotations; less to learn, less code ot write, and integrates with your IDE. +1. **Powered by type hints** — Instructor is powered by Pydantic, which is powered by type hints. Schema validation, prompting is controlled by type annotations; less to learn, less code to write, and integrates with your IDE. 2. **Powered by OpenAI** — Instructor is powered by OpenAI's function calling API. This means you can use the same API for both prompting and extraction. @@ -108,7 +108,7 @@ If you'd like to see more check out our [cookbook](examples/index.md). ## Contributing -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. +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. ## License diff --git a/docs/why.md b/docs/why.md index 5036c6f..be847b9 100644 --- a/docs/why.md +++ b/docs/why.md @@ -37,7 +37,7 @@ Lets go over the `patch` function. And see how we can leverage it to make use of ### Step 1: Patch the client -First, import the required libraries and apply the patch function to the OpenAI module. This exposes new functionality with the response_model parameter. +First, import the required libraries and apply the `patch` function to the OpenAI module. This exposes new functionality with the `response_model` parameter. ```python import instructor @@ -63,8 +63,7 @@ class UserDetail(BaseModel): ### Step 3: Extract -Use the `client.chat.completions.create` method to send a prompt and extract the data into the Pydantic object. The response_model parameter specifies the Pydantic model to use for extraction. Its helpful to annotate the variable with the type of the response model. -which will help your IDE provide autocomplete and spell check. +Use the `client.chat.completions.create` method to send a prompt and extract the data into the Pydantic object. The `response_model` parameter specifies the Pydantic model to use for extraction. Its helpful to annotate the variable with the type of the response model, which will help your IDE provide autocomplete and spell check. ```python user: UserDetail = client.chat.completions.create( @@ -104,7 +103,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 @@ -148,4 +147,4 @@ model = client.chat.completions.create( assert model.name == "JASON" ``` -As you can see, we've baked in a self correcting mechanism into the model. This is a powerful way to make your models more robust and less brittle without include a lot of extra code or prompt. +As you can see, we've baked in a self correcting mechanism into the model. This is a powerful way to make your models more robust and less brittle without including a lot of extra code or prompts.