Skip to content

Commit

Permalink
Add specification config for tools
Browse files Browse the repository at this point in the history
  • Loading branch information
yxjiang committed Mar 15, 2024
1 parent 37654a0 commit d19e00a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/polymind/core/test_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@


class ToolForTest(BaseTool):

def input_spec(self) -> list[Param]:
return [Param(name="query", type="str", description="The query to reverse")]

def output_spec(self) -> list[Param]:
return [Param(name="result", type="str", description="The reversed query")]

async def _execute(self, input: Message) -> Message:
"""Reverse the prompt and return the result.
Expand Down
5 changes: 5 additions & 0 deletions tests/polymind/tools/test_oai_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""Tests for OpenAIChatTool.
Run the test with the following command:
poetry run pytest tests/polymind/tools/test_oai_tools.py
"""

import pytest
from unittest.mock import AsyncMock, patch
from polymind.core.message import Message
Expand Down

0 comments on commit d19e00a

Please sign in to comment.