HandyLLM v0.9.0
Release HandyLLM v0.9.0.
Added
Check πs for attractive new features!
hprompt.py
:- π
image_url
in chat hprompt file now supports local path (file://), both absolute and relative - π add
fetch()
,afetch()
,stream()
andastream()
methods for direct and typed API responses - add
RunConfig.var_map_file_format
for specifying variable map file format, including JSON / YAML;load_var_map()
supports format param
- π
requestor.py
:- π add
fetch()
,afetch()
,stream()
andastream()
methods for typed API responses - use generic and add
DictRequestor
,BinRequestor
,ChatRequestor
andCompletionsRequestor
- π add
OpenAIClient
:- π constructor supports
endpoint_manager
,endpoints
andload_path
param; supports loading from YAML file andMapping
obj - APIs support
endpoints
param - APIs
endpoint
param supportsMapping
type
- π constructor supports
- π added
cache_manager.py
:CacheManager
for general purpose caching to text files- add
load_method
anddump_method
params - infers format from file suffix when convert handler is not provided
- add
- π added
response.py
:DictProxy
for quick access to well-defined response dict EndpointManager
: supports loading from YAML file usingendpoints
key, or fromIterable
obj__init__.py
import everything from hprompt for convenience- rename
_types.py
totypes.py
and expose all definitions prompt_converter.py
:- add generator sink
consume_stream2fd()
- add generator sink
utils.py
:- add generator filter
trans_stream_chat()
, generator sinkecho_consumer()
- add generator filter
- a lot improved type hints
- added tests:
- load prompt type specification
- variable map substitution
- ChatPrompt and CompletionsPrompt's API calls, supports for RunConfig.on_chunk, and addition operations
- chat hprompt
image_url
OpenAIClient
loading, chatfetch()
&stream()
endpoint_manager.py
cache_manager.py
- audio speech
- legacy OpenAIAPI
Changed
hprompt.py
:- add 'endpoints' to default record blacklist
- remove the
var_map
related configurations from the evaluated prompt, as it is already applied
EndpointManager
:- raises ValueError when getting endpoint out of empty
Fixed
hprompt.py
: 'type' object is not subscriptable on python 3.8
Removed
prompt_converter.py
: removestream_msgs2raw()
andastream_msgs2raw()
as no longer needed