Skip to content

Commit

Permalink
fix: update code block formatting in blog posts to match Black standards
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed Nov 23, 2024
1 parent 491027d commit 5383fdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/blog/posts/rag-timelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ from datetime import datetime
from typing import Optional
from pydantic import BaseModel


class TimeFilter(BaseModel):
start_date: Optional[datetime] = None
end_date: Optional[datetime] = None
Expand Down
14 changes: 5 additions & 9 deletions docs/blog/posts/version-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ 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!
Expand All @@ -79,9 +75,9 @@ 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
client.create(model="gpt-4", response_model=type[T]) -> T
client.chat.completions.create(model="gpt-4", response_model=type[T]) -> T
client.messages.create(model="gpt-4", response_model=type[T]) -> T
client.create(model="gpt-4", response_model=T)
client.chat.completions.create(model="gpt-4", response_model=T)
client.messages.create(model="gpt-4", response_model=T)
```

## Type are infered correctly
Expand Down Expand Up @@ -110,7 +106,7 @@ user = client.chat.completions.create(
)
```

Now if you use a ID, you can see the type is correctly infered.
Now if you use a ID, you can see the type is correctly inferred.

![type](./img/type.png)

Expand Down

0 comments on commit 5383fdc

Please sign in to comment.