Skip to content

Commit 469cc7a

Browse files
committed
chore: add knowledge paramter
1 parent 940e65d commit 469cc7a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

test/collection/test_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,7 @@ def test_config_with_vectorizer_and_properties(
10571057
max_new_tokens=512,
10581058
system_prompt="You are a helpful assistant that provides accurate and informative responses based on the given context.",
10591059
avoid_commentary=False,
1060+
knowledge=["fact1", "fact2"],
10601061
),
10611062
{
10621063
"generative-contextualai": {
@@ -1066,6 +1067,7 @@ def test_config_with_vectorizer_and_properties(
10661067
"maxNewTokens": 512,
10671068
"systemPrompt": "You are a helpful assistant that provides accurate and informative responses based on the given context.",
10681069
"avoidCommentary": False,
1070+
"knowledge": ["fact1", "fact2"],
10691071
}
10701072
},
10711073
),

weaviate/collections/classes/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ class _GenerativeContextualAIConfig(_GenerativeProvider):
473473
maxNewTokens: Optional[int]
474474
systemPrompt: Optional[str]
475475
avoidCommentary: Optional[bool]
476+
knowledge: Optional[List[str]]
476477

477478

478479
class _GenerativeGoogleConfig(_GenerativeProvider):
@@ -871,6 +872,7 @@ def contextualai(
871872
top_p: Optional[float] = None,
872873
system_prompt: Optional[str] = None,
873874
avoid_commentary: Optional[bool] = None,
875+
knowledge: Optional[List[str]] = None,
874876
) -> _GenerativeProvider:
875877
"""Create a `_GenerativeContextualAIConfig` object for use when performing AI generation using the `generative-contextualai` module.
876878
@@ -884,6 +886,7 @@ def contextualai(
884886
top_p: Nucleus sampling parameter (0 < x <= 1). Defaults to `None`, which uses the server-defined default
885887
system_prompt: System instructions the model follows. Defaults to `None`, which uses the server-defined default
886888
avoid_commentary: If `True`, reduce conversational commentary in responses. Defaults to `None`, which uses the server-defined default
889+
knowledge: Additional detailed knowledge sources with varied information. Defaults to `None`, which uses the server-defined default
887890
"""
888891
return _GenerativeContextualAIConfig(
889892
model=model,
@@ -892,6 +895,7 @@ def contextualai(
892895
maxNewTokens=max_new_tokens,
893896
systemPrompt=system_prompt,
894897
avoidCommentary=avoid_commentary,
898+
knowledge=knowledge,
895899
)
896900

897901
@staticmethod

0 commit comments

Comments
 (0)