Releases: jxnl/instructor
Releases · jxnl/instructor
0.3.0
Upgrading to openai 1.1.0
Usage
from openai import OpenAI()
import instructor
# Enables `response_model`
client = instructor.patch(OpenAI())
class UserDetail(BaseModel):
name: str
age: int
user = client.chat.completions.create(
model="gpt-3.5-turbo",
response_model=UserDetail,
messages=[
{"role": "user", "content": "Extract Jason is 25 years old"},
]
)
assert isinstance(user, UserDetail)
assert user.name == "Jason"
assert user.age == 25
note "Using openai<1.0.0
"
If you're using openai<1.0.0
then make sure you pip install instructor<0.3.0
where you can patch a global client like so:
import openai
import instructor
instructor.patch()
user = openai.ChatCompletion.create(
...,
response_model=UserDetail,
)
What's Changed
- Migration to OpenAI 1.1.0 by @grit-app in #152
New Contributors
- @grit-app made their first contribution in #152
Full Changelog: 0.2.11...0.3.0
0.3.0rc
Release candidate for OpenAI 1.0
Full Changelog: 0.2.11...0.3.0rc
0.2.11
What's Changed
- Add File Validation and Hyperparameters Support to CLI by @daaniyaan in #151
Typos
- fix end quote on model by @rgbkrk in #141
- Include missing quote in function_calls.py by @rgbkrk in #142
- fix typo in Validator by @pablopalafox in #144
- Fix example link by @maxjeblick in #147
New Contributors
- @rgbkrk made their first contribution in #141
- @pablopalafox made their first contribution in #144
- @maxjeblick made their first contribution in #147
- @daaniyaan made their first contribution in #151
Full Changelog: 0.2.10...0.2.11
0.2.10
What's Changed
- Blog post: Validation is Validation by @jxnl in #121
- Update README.md typo by @jeff3071 in #124
- Validation part 1 proposed edits by @ivanleomk in #125
- Remove openaischema from index.md by @jxnl in #129
- Updated Distillation Article with some added points by @ivanleomk in #131
- Update hash of requirements by @jxnl in #137
- Azure support multitask.py by @zboyles in #136
New Contributors
Full Changelog: 0.2.9...0.2.10
0.2.9
0.2.8
What's Changed
- Reasking logic on validations by @jxnl in #98
- better docs for reasking by @jxnl in #99
- Implement validation context by @jxnl in #100
- Blog post for Search by @jxnl in #105
- Rag Blog Feedback by @jxnl in #106
- Minor edits by @amorriscode in #107
- Chain of density in examples by @jxnl in #110
- Fix MkDocs Build in CI Pipeline by @jlondonobo in #108
- Add minify plugin to requirements-doc.txt by @jlondonobo in #111
- Install
pngquant
in MkDocs Pipeline for correct image optimization by @jlondonobo in #112
New Contributors
- @amorriscode made their first contribution in #107
- @jlondonobo made their first contribution in #108
Full Changelog: 0.2.7...0.2.8
0.2.7
0.2.6
What's Changed
- Add citations examples by @jxnl in #88
- fix fine-tune CLI readme formatting by @dhruv-anand-aintech in #89
- Upgrade typer by @jxnl in #90
- Improve some prompt engineering tips by @jxnl in #91
- Usage CLI by @jxnl in #93
New Contributors
- @dhruv-anand-aintech made their first contribution in #89
Full Changelog: 0.2.5...0.2.6
0.2.5
What's Changed
- update message assignment by @neilneuwirth in #80
- Implement CLI for finetuning by @jxnl in #85
- Docstring parsing by @AIexanderDicke in #83
New Contributors
- @neilneuwirth made their first contribution in #80
- @AIexanderDicke made their first contribution in #76
Full Changelog: 0.2.4...0.2.5