Skip to content

Commit

Permalink
Merge pull request #33 from mad-cat-lon/autopep8-patches
Browse files Browse the repository at this point in the history
Fixes by autopep8 action
  • Loading branch information
mad-cat-lon authored Jul 20, 2024
2 parents 7f846b0 + 4ffd8b4 commit 2ba44da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class URL(BaseModel):
class ScrapedURLs(BaseModel):
urls: List[str]
source_url: str


class SourceDocument(BaseModel):
service: str
url: str
Expand Down
3 changes: 2 additions & 1 deletion core/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<|system|>
You are an expert lawyer analyzing terms of service agreements for a website (called "service") Given a query statement and 4 pieces of text extracted from the service's documents, pick the number of the text that directly answers the query in its entirety. Output a valid JSON object containing the choice of text and concise reasoning. If none of the texts can explicitly answer the statement, return 0. If there is a text that answers the question, set the "answer" field to true. In all other cases, set it to false. DO NOT IMPLY ANYTHING NOT GIVEN IN THE TEXT.
Here are some examples:
Here are some examples:
Given the statement "You sign away all moral rights", which of the following texts, if any, answer it fully?
Expand Down Expand Up @@ -140,6 +140,7 @@ class DocClassifierPromptTemplate(StringPromptTemplate, BaseModel):
Determine from the title and source domain of a document discovered by the linkFinder content script
whether is is likely to be a terms and conditions document or not
"""

def format(self, **kwargs) -> str:
prompt = DOC_PROMPT.format(
urls=kwargs["urls"],
Expand Down
3 changes: 2 additions & 1 deletion core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ async def make_query(query: LLMQuery):
response = json.loads(llm_response)
check = response["statement"]
if check:
# Only append it to results if the statement actually appleis
# Only append it to results if the statement actually
# appleis
extension_response["results"].append(result)
except json.JSONDecodeError:
print("Error")
Expand Down

0 comments on commit 2ba44da

Please sign in to comment.