Skip to content

Commit 93a3eec

Browse files
Allow non-litellm clients to use tools (#36)
* allow non-litellm clients to use tools * format * added precommit to justfile to simplify life * added precommit to justfile to simplify life * bump patch * Increase GitHub Actions test timeout to 10 minutes * Update justfile to use uv run for pre-commit hook * Add concurrency control to GitHub Actions workflow --------- Co-authored-by: Ethan Knox <[email protected]>
1 parent ea5e2a4 commit 93a3eec

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Tests
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
37
on:
48
push:
59
branches: [main]
@@ -30,7 +34,7 @@ jobs:
3034
uv sync
3135
3236
- name: Run Tests
33-
timeout-minutes: 8
37+
timeout-minutes: 10
3438
env:
3539
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
3640
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ test-fn fn:
2121
# Run tests with coverage
2222
test-cov: format
2323
uv run pytest --cov=promptic --cov-report=term-missing tests/
24+
25+
pre-commit:
26+
uv run pre-commit

promptic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pydantic import BaseModel
1818
from litellm import completion as litellm_completion
1919

20-
__version__ = "5.0.0"
20+
__version__ = "5.0.1"
2121

2222
SystemPrompt = Optional[Union[str, List[str], List[Dict[str, str]]]]
2323

@@ -335,7 +335,9 @@ def wrapper(*args, **kwargs):
335335
self.logger.debug(f"{kwargs = }")
336336
self.logger.debug(f"{self.cache = }")
337337

338-
if self.tools:
338+
if (
339+
self.tools and not self.openai_client
340+
): # assume oai clients support tools
339341
assert litellm.supports_function_calling(self.model), (
340342
f"Model {self.model} does not support function calling"
341343
)

0 commit comments

Comments
 (0)