Skip to content

Commit

Permalink
dunno
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasonjo committed Nov 25, 2023
1 parent e6d0289 commit 6e01339
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libs/langchain/langchain/chains/graph_qa/cypher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def extract_cypher(text: str) -> str:


def construct_schema(
structured_schema: Dict[str, Union[Any, Dict[str, Any]]],
structured_schema: Dict[str, Any],
include_types: List[str],
exclude_types: List[str],
) -> str:
Expand Down Expand Up @@ -168,9 +168,11 @@ def from_llm(
"""Initialize from LLM."""

if not cypher_llm and not llm:
raise ValueError("Either `llm` or `cypher_llm` parameters must be provided")
raise ValueError(
"Either `llm` or `cypher_llm` parameters must be provided")
if not qa_llm and not llm:
raise ValueError("Either `llm` or `qa_llm` parameters must be provided")
raise ValueError(
"Either `llm` or `qa_llm` parameters must be provided")
if cypher_llm and qa_llm and llm:
raise ValueError(
"You can specify up to two of 'cypher_llm', 'qa_llm'"
Expand Down Expand Up @@ -254,7 +256,8 @@ def _call(
if self.cypher_query_corrector:
generated_cypher = self.cypher_query_corrector(generated_cypher)

_run_manager.on_text("Generated Cypher:", end="\n", verbose=self.verbose)
_run_manager.on_text("Generated Cypher:",
end="\n", verbose=self.verbose)
_run_manager.on_text(
generated_cypher, color="green", end="\n", verbose=self.verbose
)
Expand All @@ -271,7 +274,8 @@ def _call(
if self.return_direct:
final_result = context
else:
_run_manager.on_text("Full Context:", end="\n", verbose=self.verbose)
_run_manager.on_text("Full Context:", end="\n",
verbose=self.verbose)
_run_manager.on_text(
str(context), color="green", end="\n", verbose=self.verbose
)
Expand Down

0 comments on commit 6e01339

Please sign in to comment.