From 13683b7cadf967d4800d89cad73e77fa8f92ebbf Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Tue, 20 Feb 2024 15:29:38 -0500 Subject: [PATCH] docs: clean up docs --- docs/hub/action_items.md | 4 +--- docs/hub/partial_streaming.md | 8 +++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/hub/action_items.md b/docs/hub/action_items.md index 0597f34..bf0d7a6 100644 --- a/docs/hub/action_items.md +++ b/docs/hub/action_items.md @@ -1,4 +1,4 @@ -# Example: Extracting Action Items from Meeting Transcripts +# Extracting Action Items from Meeting Transcripts In this guide, we'll walk through how to extract action items from meeting transcripts using OpenAI's API and Pydantic. This use case is essential for automating project management tasks, such as task assignment and priority setting. @@ -10,7 +10,6 @@ instructor hub pull --slug action_items --py > action_items.py For multi-label classification, we introduce a new enum class and a different Pydantic model to handle multiple labels. - !!! tips "Motivation" Significant amount of time is dedicated to meetings, where action items are generated as the actionable outcomes of these discussions. Automating the extraction of action items can save time and guarantee that no critical tasks are overlooked. @@ -27,7 +26,6 @@ To extract action items from a meeting transcript, we use the **`generate`** fun To test the **`generate`** function, we provide it with a sample transcript, and then print the JSON representation of the extracted action items. - ```python import instructor from openai import OpenAI diff --git a/docs/hub/partial_streaming.md b/docs/hub/partial_streaming.md index 80bc1a6..899ad1a 100644 --- a/docs/hub/partial_streaming.md +++ b/docs/hub/partial_streaming.md @@ -1,3 +1,9 @@ +# Streaming Partial Responses + +Field level streaming provides incremental snapshots of the current state of the response model that are immediately useable. This approach is particularly relevant in contexts like rendering UI components. + +Instructor supports this pattern by making use of `Partial[T]`. This lets us dynamically create a new class that treats all of the original model's fields as `Optional`. + If you want to try outs via `instructor hub`, you can pull it by running ```bash @@ -65,4 +71,4 @@ for extraction in extraction_stream: obj = extraction.model_dump() console.clear() console.print(obj) -``` \ No newline at end of file +```