Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5cd0901
feat(hprompt): support audio input (`input_audio` type)
atomiechen Dec 18, 2024
7ebef83
fix(PromptConverter): msgs_replace_variables ensure deep copy when no…
atomiechen Dec 18, 2024
66301aa
test: add test for audio input in chat
atomiechen Dec 18, 2024
0488a75
feat(hprompt): add methods for adding content parts to certain message
atomiechen Dec 18, 2024
7eed785
feat(ChatPrompt.add_message): now only accepts keyword arguments
atomiechen Dec 18, 2024
b2140c5
test(conftest): revert temporary skipping of respx
atomiechen Dec 20, 2024
049b61a
style: improve type hint to prevent incompatible report; format
atomiechen Aug 15, 2025
1d606e8
fix(PromptConverter): msgs2raw add missing quotes in extra properties
atomiechen Aug 15, 2025
bcebcb2
fix(PromptConverter): extra properties in header escape quotes & new …
atomiechen Aug 15, 2025
2164fbe
test: add test for hprompt extra properties escaping
atomiechen Aug 15, 2025
c5244a3
fix(PromptConverter): msgs2raw disable ensure ASCII for extra properties
atomiechen Aug 15, 2025
ab23b45
feat: add reasoning content support; change callback type
atomiechen Aug 15, 2025
b0f4639
feat!: change all DictProxy to TypedDict definitions
atomiechen Aug 15, 2025
2962fa2
fix(PromptConverter): show reasoning_content when not None
atomiechen Aug 15, 2025
c8fd19a
feat(PromptConverter): add new line after reasoning content
atomiechen Aug 15, 2025
b40a4b0
feat!: better type hint; merge response.py into types.py; fix content…
atomiechen Aug 15, 2025
4bb417f
perf: remove all __all__, no need for import *
atomiechen Aug 15, 2025
3659851
fix(utils.trans_stream_chat): stream reasoning_content
atomiechen Aug 15, 2025
348cd31
feat(hprompt): default do not overwrite already existing output paths
atomiechen Aug 15, 2025
d4b085a
style: better type hint
atomiechen Aug 16, 2025
710740b
fix(ChatPrompt): ensure result_str always return a str
atomiechen Aug 16, 2025
0712354
feat(ChatPrompt): add result_reasoning to get reasoning content from …
atomiechen Aug 16, 2025
4399153
style(hprompt): add more docstring
atomiechen Aug 16, 2025
bc1b032
test: add test for reasoning model chat fetch / stream
atomiechen Aug 16, 2025
5ee3776
perf(requestor): remove redundant call/acall wrapping & typing cast
atomiechen Aug 16, 2025
1eeb8f9
build(lint): show diff about where to reformat
atomiechen Aug 16, 2025
2a29cc0
style(requestor): format code using latest ruff
atomiechen Aug 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ set -e
set -x

ruff check src tests examples
ruff format src tests examples --check
ruff format src tests examples --check --diff
4 changes: 4 additions & 0 deletions src/handyllm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
from .prompt_converter import PromptConverter as PromptConverter
from .utils import (
stream_chat_all as stream_chat_all,
stream_chat_with_role as stream_chat_with_role,
stream_chat_with_reasoning as stream_chat_with_reasoning,
stream_chat as stream_chat,
stream_completions as stream_completions,
astream_chat_all as astream_chat_all,
astream_chat_with_role as astream_chat_with_role,
astream_chat_with_reasoning as astream_chat_with_reasoning,
astream_chat as astream_chat,
astream_completions as astream_completions,
stream_to_file as stream_to_file,
Expand Down
7 changes: 1 addition & 6 deletions src/handyllm/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import yaml
from functools import wraps

from .response import DictProxy


# add multi representer for Path, for YAML serialization
class MySafeDumper(yaml.SafeDumper):
Expand All @@ -14,13 +12,10 @@ class MySafeDumper(yaml.SafeDumper):
MySafeDumper.add_multi_representer(
Path, lambda dumper, data: dumper.represent_str(str(data))
)
MySafeDumper.add_multi_representer(
DictProxy, lambda dumper, data: dumper.represent_dict(data)
)


@wraps(yaml.dump)
def yaml_dump(*args, **kwargs):
def yaml_dump(*args, **kwargs) -> str:
kwargs.setdefault("Dumper", MySafeDumper)
kwargs.setdefault("allow_unicode", True)
return yaml.dump(*args, **kwargs)
Expand Down
2 changes: 0 additions & 2 deletions src/handyllm/cache_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
__all__ = ["CacheManager"]

from functools import wraps
from inspect import iscoroutinefunction
from os import PathLike
Expand Down
5 changes: 0 additions & 5 deletions src/handyllm/endpoint_manager.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from __future__ import annotations

__all__ = [
"Endpoint",
"EndpointManager",
]

import os
from json import JSONDecodeError
from threading import Lock
Expand Down
Loading
Loading