Skip to content

Conversation

@chendaniely
Copy link
Contributor

@chendaniely chendaniely commented Jun 26, 2025

quality of life improvement where querychat will .read_text() for you on a pathlib.Path object.

Currently failing a ruff/pyright check because of system_prompt_

    # Create the system prompt, or use the override
    system_prompt_ = system_prompt_override or system_prompt(
        data_source_obj,
        data_description_str,
        extra_instructions_str,
    )

    # Default chat function if none provided
    create_chat_callback = create_chat_callback or partial(
        chatlas.ChatOpenAI,
        model="gpt-4.1",
    )

    return QueryChatConfig(
        data_source=data_source_obj,
        system_prompt=system_prompt_, # HERE
        greeting=greeting_str,
        create_chat_callback=create_chat_callback,
    )
Argument of type "str | Path" cannot be assigned to parameter "system_prompt" of type "str" in function "__init__"
  Type "str | Path" is not assignable to type "str"
    "Path" is not assignable to "str"Pyright[reportArgumentType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportArgumentType)

@schloerke
Copy link
Contributor

All currently failing lints are passing in #37. Will wait for that to merge before merging this PR.

@schloerke
Copy link
Contributor

schloerke commented Jun 27, 2025

@schloerke
Copy link
Contributor

Thank you!

@schloerke schloerke merged commit f838f16 into main Jul 1, 2025
16 checks passed
@schloerke schloerke deleted the feat-pathlib-str branch July 1, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants