From 4ab9abad09f59d788f5c9c9318986e073b0df109 Mon Sep 17 00:00:00 2001 From: scosman Date: Mon, 30 Sep 2024 14:50:16 -0400 Subject: [PATCH] Fix name typo --- libs/core/kiln_ai/adapters/base_adapter.py | 4 +--- libs/core/kiln_ai/adapters/langchain_adapters.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/core/kiln_ai/adapters/base_adapter.py b/libs/core/kiln_ai/adapters/base_adapter.py index bee365c..2c1463e 100644 --- a/libs/core/kiln_ai/adapters/base_adapter.py +++ b/libs/core/kiln_ai/adapters/base_adapter.py @@ -16,9 +16,7 @@ class BaseAdapter(metaclass=ABCMeta): def __init__(self, kiln_task: Task): self.kiln_task = kiln_task - self.output_schema = self.kiln_task.output_json_schema - self.input_schema = self.kiln_task.input_json_schema async def invoke( @@ -50,7 +48,7 @@ async def invoke( return result - def has_strctured_output(self) -> bool: + def has_structured_output(self) -> bool: return self.output_schema is not None @abstractmethod diff --git a/libs/core/kiln_ai/adapters/langchain_adapters.py b/libs/core/kiln_ai/adapters/langchain_adapters.py index 0fef21b..1b85b9f 100644 --- a/libs/core/kiln_ai/adapters/langchain_adapters.py +++ b/libs/core/kiln_ai/adapters/langchain_adapters.py @@ -28,7 +28,7 @@ def __init__( raise ValueError( "model_name and provider must be provided if custom_model is not provided" ) - if self.has_strctured_output(): + if self.has_structured_output(): if not hasattr(self.model, "with_structured_output") or not callable( getattr(self.model, "with_structured_output") ): @@ -54,7 +54,7 @@ def __init__( def adapter_specific_instructions(self) -> str | None: # TODO: would be better to explicitly use bind_tools:tool_choice="task_response" here - if self.has_strctured_output(): + if self.has_structured_output(): return "Always respond with a tool call. Never respond with a human readable message." return None @@ -66,7 +66,7 @@ async def _run(self, input: Dict | str) -> Dict | str: HumanMessage(content=user_msg), ] response = self.model.invoke(messages) - if self.has_strctured_output(): + if self.has_structured_output(): if ( not isinstance(response, dict) or "parsed" not in response