From 367d7bb04a263a430245c942cc0a049dcad96f61 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 24 Nov 2024 05:28:03 +0000 Subject: [PATCH] fix: Black formatting issues in documentation code examples --- .../posts/introducing-structured-outputs.md | 18 +++++++++--------- docs/blog/posts/version-1.md | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/blog/posts/introducing-structured-outputs.md b/docs/blog/posts/introducing-structured-outputs.md index 9d38672a7..d816b8864 100644 --- a/docs/blog/posts/introducing-structured-outputs.md +++ b/docs/blog/posts/introducing-structured-outputs.md @@ -117,15 +117,15 @@ with client.beta.chat.completions.stream( for event in stream: if event.type == "content.delta": print(event.snapshot, flush=True, end="\n") - # > - # > {"name - # > {"name":" - # > {"name":"Jason - # > {"name":"Jason"," - # > {"name":"Jason","age - # > {"name":"Jason","age": - # > {"name":"Jason","age":25 - # > {"name":"Jason","age":25} + #> + #> {"name + #> {"name":" + #> {"name":"Jason + #> {"name":"Jason"," + #> {"name":"Jason","age + #> {"name":"Jason","age": + #> {"name":"Jason","age":25 + #> {"name":"Jason","age":25} ``` ## Why use `instructor` diff --git a/docs/blog/posts/version-1.md b/docs/blog/posts/version-1.md index 03860e2e8..473b8f881 100644 --- a/docs/blog/posts/version-1.md +++ b/docs/blog/posts/version-1.md @@ -78,6 +78,7 @@ client = instructor.from_litellm(litellm.completion) # all of these will route to the same underlying create function # allow you to add instructor to try it out, while easily removing it + def create(model: str, response_model: 'Any') -> 'T': ... # type: ignore def chat_completions_create(model: str, response_model: 'Any') -> 'T': ... # type: ignore def messages_create(model: str, response_model: 'Any') -> 'T': ... # type: ignore @@ -221,7 +222,7 @@ for user in user_stream: #> name='John Doe' age=None #> name='John Doe' age=30 -Notice now that the type infered is `Generator[User, None]` +# Note: The return type is Generator[User, None, None] ![generator](./img/generator.png)