Skip to content

feat(py): pass pathlib.Path object directly without.read_text() #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

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

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.

2 participants