Skip to content

Commit 00e0aed

Browse files
committed
chore: readme and lint
1 parent 4ffd03f commit 00e0aed

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

README.md

+6-18
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ A set of tools to use when calling Narrative I/O LLMs. This package provides uti
44

55
## Features
66

7-
- REST API client with configurable authentication and parameter handling
8-
- Conversation state management for LLM interactions
9-
- JSON schema validation and enforcement for LLM outputs
10-
- Tool management system with support for both REST and non-REST tools
11-
- Caching system for format enforcers
12-
- Comprehensive test coverage
7+
- HuggingFace Inference Endpoints Handler
8+
- RestAPI Client
9+
- Conversation State Management
10+
- JSON Schema Validation and Enforcement
11+
- Tool Management System
12+
- Caching System for Format Enforcers
1313

1414
## Installation
1515

@@ -19,18 +19,6 @@ You can install the package using pip:
1919
pip install narrative-llm-tools
2020
```
2121

22-
## Requirements
23-
24-
- Python ≥ 3.11
25-
- Dependencies:
26-
- requests ≥ 2.32.3
27-
- pydantic ≥ 2.10.4
28-
- jmespath ≥ 1.0.1
29-
- lm-format-enforcer ≥ 0.10.9
30-
- cachetools ≥ 5.5.0
31-
- transformers ≥ 4.47.1
32-
- torch == 2.5.1
33-
3422
## License
3523

3624
MIT License

narrative_llm_tools/handlers/huggingface.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ def __call__(self, data: dict[str, Any]) -> dict[str, Any]:
294294
if not isinstance(tool_call, dict):
295295
raise ModelOutputError("Model output is not a list of tool calls.")
296296

297-
return HandlerResponse(tool_calls=return_msg, warnings=None).model_dump(exclude_none=True)
297+
return HandlerResponse(tool_calls=return_msg, warnings=None).model_dump(
298+
exclude_none=True
299+
)
298300

299301
except (
300302
ValidationError,
@@ -352,10 +354,7 @@ def _execute_tool_calls(self, tool_calls: list[Tool], state: ConversationState)
352354
logger.info(f"API response: {api_response}, behavior: {api_client_behavior}")
353355
behavior_type = api_client_behavior.behavior_type if api_client_behavior else None
354356

355-
if (
356-
behavior_type
357-
and behavior_type == "return_to_llm"
358-
):
357+
if behavior_type and behavior_type == "return_to_llm":
359358
llm_response_behavior: ReturnToLlmBehavior = api_client_behavior # type: ignore
360359

361360
response = (

tests/rest_api_client/test_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_default_response_behavior(self):
5252
)
5353
assert "default" in config.response_behavior
5454
assert isinstance(config.response_behavior["default"], ReturnToLlmBehavior)
55-
assert config.response_behavior["default"].llm_response is None
55+
assert config.response_behavior["default"].response is None
5656

5757
def test_equality(self):
5858
config1 = RestApiConfig(

0 commit comments

Comments
 (0)