Skip to content

Releases: jxnl/instructor

0.3.0

08 Nov 20:24
Compare
Choose a tag to compare

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

07 Nov 00:29
Compare
Choose a tag to compare
0.3.0rc Pre-release
Pre-release

Release candidate for OpenAI 1.0

Full Changelog: 0.2.11...0.3.0rc

0.2.11

06 Nov 22:03
Compare
Choose a tag to compare

What's Changed

  • Add File Validation and Hyperparameters Support to CLI by @daaniyaan in #151

Typos

New Contributors

Full Changelog: 0.2.10...0.2.11

0.2.10

04 Nov 13:51
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.2.9...0.2.10

0.2.9

22 Oct 23:32
Compare
Choose a tag to compare

What's Changed

  • Expose unpatch() function by @NISH1001 in #114
  • Implementing the Distillation Decorator by @jxnl in #118
  • Pass strict through from create to from_response by @jxnl in #119

New Contributors

Full Changelog: 0.2.8...0.2.9

0.2.8

26 Sep 01:49
f834a8f
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.2.7...0.2.8

0.2.7

08 Sep 01:27
Compare
Choose a tag to compare

What's Changed

  • Maybe helper to dynamically create a class with errors on extraction by @jxnl in #95
  • Improve Documentation by @jxnl in #96
  • Implement Simple Validators by @jxnl in #97

Full Changelog: 0.2.6...0.2.7

0.2.6

06 Sep 02:15
041f83b
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.2.5...0.2.6

0.2.5

24 Aug 07:14
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.2.4...0.2.5

0.2.4

17 Aug 04:31
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.2.3...0.2.4