forked from matthewbolanos/sk-v1-proposal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hook_base.py
39 lines (33 loc) · 1.04 KB
/
hook_base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from typing import Any
from semantic_kernel.sk_pydantic import SKBaseModel
from python.src.plugins.sk_function import SKFunction
class HookBase(SKBaseModel):
name: str
async def on_invoke_start(
self,
functions: list[SKFunction],
variables: dict[str, Any] | None = None,
request_settings: dict[str, Any] | None = None,
kwargs: dict | None = None,
) -> tuple[
list[SKFunction],
dict[str, Any] | None,
dict[str, Any] | None,
dict | None,
]:
return functions, variables, request_settings, kwargs
async def on_invoke_end(
self,
results: list[dict],
functions: list[SKFunction],
variables: dict[str, Any] | None = None,
request_settings: dict[str, Any] | None = None,
kwargs: dict | None = None,
) -> tuple[
list[dict],
list[SKFunction],
dict[str, Any] | None,
dict[str, Any] | None,
dict | None,
]:
return results, functions, variables, request_settings, kwargs