Skip to content

Commit

Permalink
Revert "feat(api): add COHERE_MAX_CHUNKS_PER_DOC"
Browse files Browse the repository at this point in the history
This reverts commit 1407d79.
  • Loading branch information
Lee-W committed Nov 22, 2023
1 parent 1407d79 commit 185e7f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions api/ask_astro/chains/answer_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ def _get_docs(
):
docs = super()._get_docs(question=question, inputs=inputs, run_manager=run_manager)
if CohereConfig.cohere_api_key:
compressor = CohereRerank(
top_n=CohereConfig.top_n,
user_agent="langchain",
max_chunks_per_doc=CohereConfig.max_chunks_per_doc,
)
compressor = CohereRerank(top_n=CohereConfig.top_n, user_agent="langchain")
return compressor.compress_documents(docs, question)
return docs

Expand Down
1 change: 0 additions & 1 deletion api/ask_astro/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ class CohereConfig:

cohere_api_key = os.environ.get("COHERE_API_KEY")
top_n = int(os.environ.get("COHERE_TOP_N", 3))
max_chunks_per_doc = int(os.environ.get("COHERE_MAX_CHUNKS_PER_DOC", 10))

0 comments on commit 185e7f1

Please sign in to comment.