Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify method for with_structured_output #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@
relationship_properties: Union[bool, List[str]] = False,
ignore_tool_usage: bool = False,
additional_instructions: str = "",
method: str = "json_schema"
) -> None:
# Validate and check allowed relationships input
self._relationship_type = validate_and_get_relationship_type(
Expand All @@ -784,7 +785,7 @@
# Check if the LLM really supports structured output
if self._function_call:
try:
llm.with_structured_output(_Graph)
llm.with_structured_output(_Graph, method=method)
except NotImplementedError:
self._function_call = False
if not self._function_call:
Expand Down Expand Up @@ -824,7 +825,7 @@
relationship_properties,
self._relationship_type,
)
structured_llm = llm.with_structured_output(schema, include_raw=True)
structured_llm = llm.with_structured_output(schema, method=method, include_raw=True)

Check failure on line 828 in libs/experimental/langchain_experimental/graph_transformers/llm.py

View workflow job for this annotation

GitHub Actions / cd libs/experimental / make lint #3.11

Ruff (E501)

langchain_experimental/graph_transformers/llm.py:828:89: E501 Line too long (96 > 88)
prompt = prompt or get_default_prompt(additional_instructions)
self.chain = prompt | structured_llm

Expand Down
Loading