Skip to content

Commit

Permalink
chore: schema fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 23, 2024
1 parent 4ca48bd commit e1a233b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llmling/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ class BaseTool(ABC):
# Class-level schema definition
name: ClassVar[str]
description: ClassVar[str]
parameters_schema: ClassVar[dict[str, Any]]

@classmethod
def get_schema(cls) -> py2openai.OpenAIFunctionTool:
"""Get the tool's schema for LLM function calling."""
return py2openai.create_schema(cls.execute).model_dump_openai()
schema = py2openai.create_schema(cls.execute).model_dump_openai()
schema["function"]["name"] = cls.name
return schema

@abstractmethod
async def execute(self, **params: Any) -> Any | Awaitable[Any]:
Expand Down

0 comments on commit e1a233b

Please sign in to comment.