Skip to content
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

Fixed type problems from llmclient #770

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

maykcaldas
Copy link
Collaborator

No description provided.

paperqa/clients/__init__.py Outdated Show resolved Hide resolved
tests/test_paperqa.py Outdated Show resolved Hide resolved
Comment on lines +57 to +58
docname: str | None = None
dockey: DocKey | None = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make these optional and defaulted to None?

I am not against it, but more just wondering why. Can you add a description stating what these should be and what None means

@@ -683,7 +683,7 @@ def test_sparse_embedding(stub_data_dir: Path, vector_store: type[VectorStore])
citation="WikiMedia Foundation, 2023, Accessed now",
embedding_model=SparseEmbeddingModel(),
)
assert any(docs.texts[0].embedding)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the any assertions around? Why move to list?

If you think the assertion is the same behavior, can you add an assertion failure message, to help make what it's checking for clear?

--- assert any(docs.texts[0].embedding), "We require the embedding to be populated"
+++ assert isinstance(docs.texts[0].embedding, list), "We require the embedding to be populated"

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