Instructor

Latest version: v1.7.2

Safety actively analyzes 706259 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 14

1.2.4

What's Changed
* feat: update and allow strict mode by jxnl in https://github.com/jxnl/instructor/pull/618
* fix: allow openai-like clients into from_openai


**Full Changelog**: https://github.com/jxnl/instructor/compare/1.2.3...1.2.4

1.2.3

What's Changed
* Fix bullet list in README.md by xingweitian in https://github.com/jxnl/instructor/pull/621
* Update README.md by eltociear in https://github.com/jxnl/instructor/pull/625
* fix typo about Enum 'and' → 'an' by inn-0 in https://github.com/jxnl/instructor/pull/626
* Fix anthropic usage and tools by lazyhope in https://github.com/jxnl/instructor/pull/622

New Contributors
* xingweitian made their first contribution in https://github.com/jxnl/instructor/pull/621
* eltociear made their first contribution in https://github.com/jxnl/instructor/pull/625

**Full Changelog**: https://github.com/jxnl/instructor/compare/1.2.2...1.2.3

1.2.2

What's Changed
* From mistral by wassim-trabelsi in https://github.com/jxnl/instructor/pull/599
* feat: custom exceptions by jxnl in https://github.com/jxnl/instructor/pull/614

New Contributors
* wassim-trabelsi made their first contribution in https://github.com/jxnl/instructor/pull/599

**Full Changelog**: https://github.com/jxnl/instructor/compare/1.2.1...1.2.2

1.2.1

What's Changed
* feat: basic sentiment analysis eval tests by meta-boy in https://github.com/jxnl/instructor/pull/610
* [Ellipsis] docstring-parser 0.16 by ellipsis-dev in https://github.com/jxnl/instructor/pull/608
* Added support for MD_JSON for Anyscale and Together by jpetrantoni in https://github.com/jxnl/instructor/pull/611

New Contributors
* meta-boy made their first contribution in https://github.com/jxnl/instructor/pull/610

**Full Changelog**: https://github.com/jxnl/instructor/compare/1.2.0...1.2.1

1.2.0

What's Changed
* Add support for cohere models by lidiyam in https://github.com/jxnl/instructor/pull/585
* adding AnthropicVertex by dlubom in https://github.com/jxnl/instructor/pull/595
* fix: typo textblocks vi-fr in blog post by inn-0 in https://github.com/jxnl/instructor/pull/596
* Document use of SkipJsonSchema for omitting fields by boydgreenfield in https://github.com/jxnl/instructor/pull/597
* Support python 3.9 by RedTachyon in https://github.com/jxnl/instructor/pull/601

New Contributors
* lidiyam made their first contribution in https://github.com/jxnl/instructor/pull/585
* dlubom made their first contribution in https://github.com/jxnl/instructor/pull/595
* boydgreenfield made their first contribution in https://github.com/jxnl/instructor/pull/597
* RedTachyon made their first contribution in https://github.com/jxnl/instructor/pull/601

**Full Changelog**: https://github.com/jxnl/instructor/compare/1.1.0...1.2.0

1.1.0

Usage

py hl_lines="5 13"
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:

python hl_lines="4 8"
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 https://github.com/jxnl/instructor/pull/152

New Contributors
* grit-app made their first contribution in https://github.com/jxnl/instructor/pull/152

**Full Changelog**: https://github.com/jxnl/instructor/compare/0.2.11...0.3.0

Page 5 of 14

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.