Skip to content

Commit

Permalink
fix extra stop
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Sep 27, 2024
1 parent 7c5d81a commit 5c33028
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 @@ -1836,7 +1836,7 @@
" 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",
" msgs = self._precall(msgs, prefill, stop, kwargs)\n",
" if stream: return self._stream(msgs, prefill=prefill, max_tokens=maxtok, system=sp, temperature=temp, stop=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",
" return self._log(res, prefill, msgs, maxtok, sp, temp, stream=stream, stop=stop, **kwargs)"
]
Expand Down Expand Up @@ -2762,7 +2762,7 @@
" if isinstance(content, abc.Mapping): content=content.get('content', content)\n",
" if not isinstance(content, list): content=[content]\n",
" content = [_mk_content(o, cache if islast else False) for islast,o in loop_last(content)] if content else '.'\n",
" return dict2obj(dict(role=role, content=content, **kw))"
" return dict(role=role, content=content, **kw)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions claudette/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __call__(self:Client,
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)
msgs = self._precall(msgs, prefill, stop, kwargs)
if stream: return self._stream(msgs, prefill=prefill, max_tokens=maxtok, system=sp, temperature=temp, stop=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)
return self._log(res, prefill, msgs, maxtok, sp, temp, stream=stream, stop=stop, **kwargs)

Expand Down Expand Up @@ -311,7 +311,7 @@ def mk_msg(content, # A string, list, or dict containing the contents of the mes
if isinstance(content, abc.Mapping): content=content.get('content', content)
if not isinstance(content, list): content=[content]
content = [_mk_content(o, cache if islast else False) for islast,o in loop_last(content)] if content else '.'
return dict2obj(dict(role=role, content=content, **kw))
return dict(role=role, content=content, **kw)

# %% ../00_core.ipynb
models_aws = ('anthropic.claude-3-haiku-20240307-v1:0', 'anthropic.claude-3-sonnet-20240229-v1:0',
Expand Down

0 comments on commit 5c33028

Please sign in to comment.