Skip to content

Commit

Permalink
Fix name typo
Browse files Browse the repository at this point in the history
  • Loading branch information
scosman committed Sep 30, 2024
1 parent 5ee3d2f commit 4ab9aba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions libs/core/kiln_ai/adapters/base_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions libs/core/kiln_ai/adapters/langchain_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
):
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 4ab9aba

Please sign in to comment.