Skip to content

Commit

Permalink
Fix a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ncoop57 committed Sep 30, 2024
1 parent b107de6 commit 238d982
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,7 @@
" **kwargs):\n",
" \"Make a call to Claude.\"\n",
" if tools: kwargs['tools'] = [get_schema(o) for o in listify(tools)]\n",
" if tool_choice and pr: kwargs['tool_choice'] = mk_tool_choice(tool_choice)\n",
" if tool_choice: kwargs['tool_choice'] = mk_tool_choice(tool_choice)\n",
" msgs = self._precall(msgs, prefill, stop, kwargs)\n",
" if stream: return self._stream(msgs, prefill=prefill, max_tokens=maxtok, system=sp, temperature=temp, **kwargs)\n",
" res = self.c.messages.create(model=self.model, messages=msgs, max_tokens=maxtok, system=sp, temperature=temp, **kwargs)\n",
Expand Down Expand Up @@ -1953,7 +1953,7 @@
" \"Return the value of all tool calls (generally used for structured outputs)\"\n",
" res = self(msgs, **kwargs)\n",
" if ns is None: ns=globals()\n",
" cts = getattr(r, 'content', [])\n",
" cts = getattr(res, 'content', [])\n",
" tcs = [call_func(o, ns=ns, obj=obj) for o in cts if isinstance(o,ToolUseBlock)]\n",
" return tcs"
]
Expand Down
4 changes: 2 additions & 2 deletions claudette/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def __call__(self:Client,
**kwargs):
"Make a call to Claude."
if tools: kwargs['tools'] = [get_schema(o) for o in listify(tools)]
if tool_choice and pr: kwargs['tool_choice'] = mk_tool_choice(tool_choice)
if tool_choice: kwargs['tool_choice'] = mk_tool_choice(tool_choice)
msgs = self._precall(msgs, prefill, stop, kwargs)
if stream: return self._stream(msgs, prefill=prefill, max_tokens=maxtok, system=sp, temperature=temp, **kwargs)
res = self.c.messages.create(model=self.model, messages=msgs, max_tokens=maxtok, system=sp, temperature=temp, **kwargs)
Expand All @@ -228,7 +228,7 @@ def structured(self:Client,
"Return the value of all tool calls (generally used for structured outputs)"
res = self(msgs, **kwargs)
if ns is None: ns=globals()
cts = getattr(r, 'content', [])
cts = getattr(res, 'content', [])
tcs = [call_func(o, ns=ns, obj=obj) for o in cts if isinstance(o,ToolUseBlock)]
return tcs

Expand Down

0 comments on commit 238d982

Please sign in to comment.