diff --git a/00_core.ipynb b/00_core.ipynb index e57ce92..c6b1995 100644 --- a/00_core.ipynb +++ b/00_core.ipynb @@ -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)" ] @@ -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)" ] }, { diff --git a/claudette/core.py b/claudette/core.py index 87a7d93..1367e5c 100644 --- a/claudette/core.py +++ b/claudette/core.py @@ -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) @@ -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',