From 89ae3a9061ecd6001c4746c494f0557b96bb6e39 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Tue, 30 Jan 2024 13:43:08 -0500 Subject: [PATCH] Update modes.md (#96) --- docs/concepts/modes.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/concepts/modes.md b/docs/concepts/modes.md index 99015a03..dfd9ffa6 100644 --- a/docs/concepts/modes.md +++ b/docs/concepts/modes.md @@ -1,4 +1,4 @@ -# Modes +# Patching Modes Instructor enhances client functionality with three new keywords for backwards compatibility. This allows use of the enhanced client as usual, with structured output benefits. @@ -6,11 +6,13 @@ Instructor enhances client functionality with three new keywords for backwards c - `max_retries`: Determines retry attempts for failed `chat.completions.create` validations. - `validation_context`: Provides extra context to the validation process. -There are three methods for structured output: +## What's a `mode`? -1. **Function Calling**: The primary method. Use this for stability and testing. -2. **Tool Calling**: Useful in specific scenarios; lacks the reasking feature of OpenAI's tool calling API. -3. **JSON Mode**: Offers closer adherence to JSON but with more potential validation errors. Suitable for specific non-function calling clients. +There are many ways of extracting structured data from LLMs. Each provider or model may have a limited subset of these capabilities. The Instructor patch allows us to easily switch between any of these modes. The recommendation is to always use tool calling unless you are a provider. However, not all open source models currently support tool calling. In such cases, we can use alternatives like JSON or MD_JSON. + +1. **Function Calling**: Users open AI's function calling method. This method will soon be deprecated in favor of tool calling. +2. **Tool Calling**: Tool calling supports multiple parallel tool calls, but for the sake of using the instructor and simplicity, we limit you to one response model. +3. **JSON Mode**: Offers closer adherence to JSON but with the potential for more validation errors. This mode is suitable for specific non-function calling clients. ## Function Calling