Skip to content

Commit 841abe1

Browse files
committed
Add system_prompt if/else to help with pyright typing
1 parent a77119e commit 841abe1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pkg-py/src/querychat/querychat.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,14 @@ def init(
304304
)
305305

306306
# Create the system prompt, or use the override
307-
system_prompt_ = system_prompt_override or system_prompt(
308-
data_source_obj,
309-
data_description_str,
310-
extra_instructions_str,
311-
)
307+
if isinstance(system_prompt_override, Path):
308+
system_prompt_ = system_prompt_override.read_text()
309+
else:
310+
system_prompt_ = system_prompt_override or system_prompt(
311+
data_source_obj,
312+
data_description,
313+
extra_instructions,
314+
)
312315

313316
# Default chat function if none provided
314317
create_chat_callback = create_chat_callback or partial(

0 commit comments

Comments
 (0)