From 9cf5ede97b5cbddcc8fd48e3894a0524d1eb2e27 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 04:58:42 +0000 Subject: [PATCH] fix: formatting in documentation code blocks to pass Black checks --- ...troducing-structured-outputs-with-cerebras-inference.md | 6 +++--- docs/blog/posts/pairwise-llm-judge.md | 7 +++---- docs/blog/posts/version-1.md | 4 +++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/blog/posts/introducing-structured-outputs-with-cerebras-inference.md b/docs/blog/posts/introducing-structured-outputs-with-cerebras-inference.md index a3b84b0a9..8bf67ad33 100644 --- a/docs/blog/posts/introducing-structured-outputs-with-cerebras-inference.md +++ b/docs/blog/posts/introducing-structured-outputs-with-cerebras-inference.md @@ -123,9 +123,9 @@ resp = client.chat.completions.create( for person in resp: print(person) - # > Person(name='Chris', age=27) - # > Person(name='John', age=30) - # > Person(name='Jessica', age=26) + #> Person(name='Chris', age=27) + #> Person(name='John', age=30) + #> Person(name='Jessica', age=26) ``` And that’s it! We're excited to see what you build with Instructor and Cerebras! If you have any questions about Cerebras or need to get off the API key waitlist, please reach out to sarah.chieng@cerebras.net. diff --git a/docs/blog/posts/pairwise-llm-judge.md b/docs/blog/posts/pairwise-llm-judge.md index d5e084dcf..4a752b60f 100644 --- a/docs/blog/posts/pairwise-llm-judge.md +++ b/docs/blog/posts/pairwise-llm-judge.md @@ -33,7 +33,6 @@ First, let's set up our environment with the necessary imports: ```python import instructor import openai -from pydantic import BaseModel, Field client = instructor.from_openai(openai.OpenAI()) ``` @@ -88,7 +87,7 @@ def judge_relevance(question: str, text: str) -> Judgment: Before giving your final judgment, provide a justification for your decision. Explain the key factors that led to your conclusion. Please ensure your analysis is thorough, impartial, and based on the content provided. - """ + """, }, { "role": "user", @@ -103,8 +102,8 @@ def judge_relevance(question: str, text: str) -> Judgment: {{text}} - """ - } + """, + }, ], response_model=Judgment, context={"question": question, "text": text}, diff --git a/docs/blog/posts/version-1.md b/docs/blog/posts/version-1.md index 91c03b38a..b93abdfbe 100644 --- a/docs/blog/posts/version-1.md +++ b/docs/blog/posts/version-1.md @@ -50,7 +50,9 @@ IF you know you want to pass in tempurature, seed, or model, you can do so. import openai import instructor -client = instructor.from_openai(openai.OpenAI(), model="gpt-4-turbo-preview", temperature=0.2) +client = instructor.from_openai( + openai.OpenAI(), model="gpt-4-turbo-preview", temperature=0.2 +) ``` Now, whenever you call `client.chat.completions.create` the `model` and `temperature` will be passed to the openai client!