mirror of
https://github.com/Hopiu/llm.git
synced 2026-03-16 20:50:25 +00:00
Stash function in tool.implementation
Refs https://github.com/simonw/llm/issues/935#issuecomment-2869084490
This commit is contained in:
parent
5aac6b76f0
commit
8c2393f909
1 changed files with 2 additions and 0 deletions
|
|
@ -109,6 +109,7 @@ class Attachment:
|
|||
class Tool:
|
||||
name: str
|
||||
description: Optional[str] = None
|
||||
implementation: Optional[Callable] = None
|
||||
input_schema: Dict = field(default_factory=dict)
|
||||
output_schema: Dict = field(default_factory=dict)
|
||||
|
||||
|
|
@ -172,6 +173,7 @@ class Tool:
|
|||
return cls(
|
||||
name=name or function.__name__,
|
||||
description=function.__doc__ or None,
|
||||
implementation=function,
|
||||
input_schema=input_schema,
|
||||
output_schema=output_schema,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue