Skip to content

Commit

Permalink
add client parameter to instructor.Intructions (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhomass committed Jul 7, 2024
1 parent a3cc27d commit 3ba2afd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/distilations/three_digit_mul_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from pydantic import BaseModel, Field
from instructor import Instructions
import instructor
from openai import OpenAI

instructor.from_openai()
client = instructor.from_openai(OpenAI())

logging.basicConfig(level=logging.INFO)

Expand All @@ -16,6 +17,7 @@
log_handlers=[
logging.FileHandler("math_finetunes.jsonl"),
],
openai_client=client
)


Expand All @@ -25,7 +27,7 @@ class Multiply(BaseModel):
result: int = Field(..., description="The result of the multiplication")


@instructions.distil(mode="dispatch", model="ft:gpt-3.5-turbo-0613:personal::8CazU0uq")
@instructions.distil(mode="dispatch", model="ft:gpt-3.5-turbo-0125:personal::9i1JeuxJ")
def fn(a: int, b: int) -> Multiply:
"""Return the result of the multiplication as an integer"""
resp = a * b
Expand Down

0 comments on commit 3ba2afd

Please sign in to comment.