Skip to content

Commit

Permalink
FIx semgrep version
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmohanraj committed Mar 12, 2024
1 parent fc88201 commit 506315a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
args: ["-r", "faststream_gen"]

- repo: https://github.com/returntocorp/semgrep
rev: "v1.14.0"
rev: "v1.61.1"
hooks:
- id: semgrep
name: Semgrep
Expand Down
2 changes: 1 addition & 1 deletion faststream_gen/_code_generator/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _get_relevant_document(query: str) -> str:
The content of the most relevant document as a string.
"""
db_path = get_root_data_path() / "docs"
db = FAISS.load_local(db_path, OpenAIEmbeddings())
db = FAISS.load_local(db_path, OpenAIEmbeddings()) # type: ignore
results = db.max_marginal_relevance_search(query, k=1, fetch_k=3)
results_str = "\n".join([result.page_content for result in results])
return results_str
Expand Down
2 changes: 1 addition & 1 deletion faststream_gen/_code_generator/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def get_relevant_prompt_examples(query: str) -> Dict[str, str]:
The dictionary of the most relevant examples for each step.
"""
db_path = get_root_data_path() / "examples"
db = FAISS.load_local(db_path, OpenAIEmbeddings())
db = FAISS.load_local(db_path, OpenAIEmbeddings()) # type: ignore
results = db.similarity_search(query, k=3, fetch_k=5)
results_page_content = [r.page_content for r in results]
prompt_examples = _format_examples(results_page_content)
Expand Down
2 changes: 1 addition & 1 deletion nbs/Chat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
" The content of the most relevant document as a string.\n",
" \"\"\"\n",
" db_path = get_root_data_path() / \"docs\"\n",
" db = FAISS.load_local(db_path, OpenAIEmbeddings())\n",
" db = FAISS.load_local(db_path, OpenAIEmbeddings()) # type: ignore\n",
" results = db.max_marginal_relevance_search(query, k=1, fetch_k=3)\n",
" results_str = \"\\n\".join([result.page_content for result in results])\n",
" return results_str"
Expand Down
2 changes: 1 addition & 1 deletion nbs/Helper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
" The dictionary of the most relevant examples for each step.\n",
" \"\"\"\n",
" db_path = get_root_data_path() / \"examples\"\n",
" db = FAISS.load_local(db_path, OpenAIEmbeddings())\n",
" db = FAISS.load_local(db_path, OpenAIEmbeddings()) # type: ignore\n",
" results = db.similarity_search(query, k=3, fetch_k=5)\n",
" results_page_content = [r.page_content for r in results]\n",
" prompt_examples = _format_examples(results_page_content)\n",
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ requirements = \
dev_requirements = \
nbdev-mkdocs==0.6.0 \
bandit==1.7.5 \
semgrep==1.34.1 \
semgrep==1.61.1 \
pytest==7.4.2 \
nbqa==1.7.0 \
black==23.7.0 \
Expand Down

0 comments on commit 506315a

Please sign in to comment.