include tool calls

This commit is contained in:
Josh Yan 2024-07-16 11:39:42 -07:00
parent 1a15742705
commit 98b3a44b14
2 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,7 @@ class Client(BaseClient):
raw: bool = False, raw: bool = False,
format: Literal['', 'json'] = '', format: Literal['', 'json'] = '',
images: Optional[Sequence[AnyStr]] = None, images: Optional[Sequence[AnyStr]] = None,
tools: Optional[Sequence[Any]] = None,
options: Optional[Options] = None, options: Optional[Options] = None,
keep_alive: Optional[Union[float, str]] = None, keep_alive: Optional[Union[float, str]] = None,
) -> Mapping[str, Any]: ... ) -> Mapping[str, Any]: ...
@ -125,6 +126,7 @@ class Client(BaseClient):
raw: bool = False, raw: bool = False,
format: Literal['', 'json'] = '', format: Literal['', 'json'] = '',
images: Optional[Sequence[AnyStr]] = None, images: Optional[Sequence[AnyStr]] = None,
tools: Optional[Sequence[Any]] = None,
options: Optional[Options] = None, options: Optional[Options] = None,
keep_alive: Optional[Union[float, str]] = None, keep_alive: Optional[Union[float, str]] = None,
) -> Iterator[Mapping[str, Any]]: ... ) -> Iterator[Mapping[str, Any]]: ...
@ -140,6 +142,7 @@ class Client(BaseClient):
raw: bool = False, raw: bool = False,
format: Literal['', 'json'] = '', format: Literal['', 'json'] = '',
images: Optional[Sequence[AnyStr]] = None, images: Optional[Sequence[AnyStr]] = None,
tools: Optional[Sequence[Any]] = None,
options: Optional[Options] = None, options: Optional[Options] = None,
keep_alive: Optional[Union[float, str]] = None, keep_alive: Optional[Union[float, str]] = None,
) -> Union[Mapping[str, Any], Iterator[Mapping[str, Any]]]: ) -> Union[Mapping[str, Any], Iterator[Mapping[str, Any]]]:
@ -168,6 +171,7 @@ class Client(BaseClient):
'stream': stream, 'stream': stream,
'raw': raw, 'raw': raw,
'images': [_encode_image(image) for image in images or []], 'images': [_encode_image(image) for image in images or []],
'tools': tools or [],
'format': format, 'format': format,
'options': options or {}, 'options': options or {},
'keep_alive': keep_alive, 'keep_alive': keep_alive,

View File

@ -52,6 +52,8 @@ class GenerateResponse(BaseGenerateResponse):
context: Sequence[int] context: Sequence[int]
'Tokenized history up to the point of the response.' 'Tokenized history up to the point of the response.'
tool_calls: Sequence[Any]
'List of tool calls made by the model.'
class Message(TypedDict): class Message(TypedDict):
""" """