Skip to content

Commit

Permalink
Changed types to use factories (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitead authored Jul 18, 2023
1 parent 9db08fa commit 497f870
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions paperqa/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
CallbackManagerForChainRun,
)
from langchain.prompts import PromptTemplate
from pydantic import BaseModel, validator
from pydantic import BaseModel, Field, validator

from .prompts import citation_prompt, qa_prompt, select_paper_prompt, summary_prompt

Expand All @@ -31,10 +31,10 @@ class Text(BaseModel):


class PromptCollection(BaseModel):
summary: PromptTemplate = summary_prompt
qa: PromptTemplate = qa_prompt
select: PromptTemplate = select_paper_prompt
cite: PromptTemplate = citation_prompt
summary: PromptTemplate = Field(default_factory=lambda: summary_prompt)
qa: PromptTemplate = Field(default_factory=lambda: qa_prompt)
select: PromptTemplate = Field(default_factory=lambda: select_paper_prompt)
cite: PromptTemplate = Field(default_factory=lambda: citation_prompt)
pre: Optional[PromptTemplate] = None
post: Optional[PromptTemplate] = None

Expand Down
2 changes: 1 addition & 1 deletion paperqa/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.3.1"
__version__ = "3.3.2"

0 comments on commit 497f870

Please sign in to comment.