File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import ast
2
2
from abc import ABC
3
- from typing import Iterable
3
+ from typing import ClassVar , Iterable
4
4
5
5
from typing_extensions import Self , TypeAlias
6
6
@@ -15,9 +15,12 @@ class BaseCallerContext(ABC):
15
15
the caller environment to the filters. LLM will always return `Context()`
16
16
when the context is required and this call will be later substituted by an instance of
17
17
a class implementing this interface, selected based on the filter method signature (type hints).
18
+
19
+ Attributes:
20
+ alias: Class variable defining an alias which is defined in the prompt for the LLM to reference context.
18
21
"""
19
22
20
- alias : str = "AskerContext"
23
+ alias : ClassVar [ str ] = "AskerContext"
21
24
22
25
@classmethod
23
26
def select_context (cls , contexts : Iterable [CustomContext ]) -> Self :
@@ -38,8 +41,8 @@ class by its right instance.
38
41
39
42
if not contexts :
40
43
raise ContextNotAvailableError (
41
- "The LLM detected that the context is required to execute the query + \
42
- and the filter signature allows contextualization while the context was not provided."
44
+ "The LLM detected that the context is required to execute the query"
45
+ " and the filter signature allows contextualization while the context was not provided."
43
46
)
44
47
45
48
# TODO confirm whether it is possible to design a correct type hints here and skipping `type: ignore`
You can’t perform that action at this time.
0 commit comments