Skip to content

Commit

Permalink
add beta support for anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdzm committed Nov 25, 2024
1 parent 58eef74 commit 047a5bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions instructor/client_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def from_anthropic(
),
mode: instructor.Mode = instructor.Mode.ANTHROPIC_TOOLS,
enable_prompt_caching: bool = False,
beta:bool = False,
**kwargs: Any,
) -> instructor.Instructor | instructor.AsyncInstructor:
assert (
Expand Down Expand Up @@ -70,6 +71,8 @@ def from_anthropic(
raise TypeError(
"Client must be an instance of {anthropic.Anthropic, anthropic.AsyncAnthropic} to enable prompt caching"
)
elif beta:
create = client.beta.messages.create
else:
create = client.messages.create

Expand Down

0 comments on commit 047a5bb

Please sign in to comment.