Skip to content

Commit fd64f61

Browse files
Fix: ci tool build error (#8)
CI build error caused by not properly building circle-ooak prior to unit testing
1 parent d83fff4 commit fd64f61

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/release-test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ jobs:
2121
run: |
2222
python -m pip install --upgrade pip
2323
python -m pip install -r requirements.txt
24-
python -m pip install pytest pytest-asyncio
24+
python -m pip install pytest-asyncio
25+
26+
- name: Set up build tools
27+
run: |
28+
python -m pip install build
29+
30+
- name: Install circle-ooak
31+
run: |
32+
python -m build
2533
python -m pip install -e .
2634
2735
- name: Run tests

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ the `requirements.txt` file:
102102
git clone http://github.com/circlefin/circle-ooak
103103
cd circle-ooak
104104
pip install -r requirements.txt
105+
pip install circle-ooak
105106
```
106107

107108
We recommend you use a virtual environment:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
python-dotenv
2-
openai
32
openai-agents==0.2.6

src/circle_ooak/agent_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646

4747
def agent_tool(
48-
func: ToolFunction[...] | None = None,
48+
func: ToolFunction[ToolParams] | None = None,
4949
*,
5050
name_override: str | None = None,
5151
description_override: str | None = None,
@@ -54,7 +54,7 @@ def agent_tool(
5454
failure_error_function: ToolErrorFunction | None = default_tool_error_function,
5555
strict_mode: bool = True,
5656
is_enabled: bool | Callable[[RunContextWrapper[Any], Agent[Any]], MaybeAwaitable[bool]] = True,
57-
) -> FunctionTool | Callable[[ToolFunction[...]], FunctionTool]:
57+
) -> FunctionTool | Callable[[ToolFunction[ToolParams]], FunctionTool]:
5858
"""
5959
Decorator to create a FunctionTool from a function. By default, we will:
6060
1. Parse the function signature to create a JSON schema for the tool's parameters.
@@ -87,7 +87,7 @@ def agent_tool(
8787
from the LLM at runtime.
8888
"""
8989

90-
def _create_agent_tool(the_func: ToolFunction[...]) -> FunctionTool:
90+
def _create_agent_tool(the_func: ToolFunction[ToolParams]) -> FunctionTool:
9191
# Check if this is a method (first parameter is 'self')
9292
sig = inspect.signature(the_func)
9393
params = list(sig.parameters.values())
@@ -219,7 +219,7 @@ async def _on_invoke_tool(ctx: RunContextWrapper[Any], input: str, instance: Any
219219
return _create_agent_tool(func)
220220

221221
# Otherwise, we were used as @function_tool(...), so return a decorator
222-
def decorator(real_func: ToolFunction[...]) -> FunctionTool:
222+
def decorator(real_func: ToolFunction[ToolParams]) -> FunctionTool:
223223
return _create_agent_tool(real_func)
224224

225225
return decorator

src/circle_ooak/secure_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def after_invoke_tool(self, wfid: str, intent: str, result: str) -> SecureContex
5959

6060

6161
def secure_tool(
62-
func: ToolFunction[...] | None = None,
62+
func: ToolFunction[ToolParams] | None = None,
6363
*,
6464
name_override: str | None = None,
6565
description_override: str | None = None,
6666
docstring_style: DocstringStyle | None = None,
6767
use_docstring_info: bool = True,
6868
failure_error_function: ToolErrorFunction | None = default_tool_error_function,
69-
) -> FunctionTool | Callable[[ToolFunction[...]], FunctionTool]:
69+
) -> FunctionTool | Callable[[ToolFunction[ToolParams]], FunctionTool]:
7070
"""
7171
A secure version of the function_tool decorator that adds additional security checks and hooks.
7272
It inherits all functionality from function_tool and adds:
@@ -87,7 +87,7 @@ def secure_tool(
8787
error message will be sent and instead an Exception will be raised.
8888
"""
8989

90-
def _create_secure_function_tool(the_func: ToolFunction[...]) -> FunctionTool:
90+
def _create_secure_function_tool(the_func: ToolFunction[ToolParams]) -> FunctionTool:
9191
# First create the base function tool
9292
system_prompt = f"""
9393
This is a secure tool. You must include a 'wfid' field in your function call arguments.
@@ -204,7 +204,7 @@ async def secure_on_invoke_tool(ctx: RunContextWrapper[Any], input: str, instanc
204204
return _create_secure_function_tool(func)
205205

206206
# Otherwise, we were used as @secure_tool(...), so return a decorator
207-
def decorator(real_func: ToolFunction[...]) -> FunctionTool:
207+
def decorator(real_func: ToolFunction[ToolParams]) -> FunctionTool:
208208
return _create_secure_function_tool(real_func)
209209

210210
return decorator

0 commit comments

Comments
 (0)