kani (カニ) is a highly hackable microframework for chat-based language models with tool use/function calling. (NLP-OSS @ EMNLP 2023)
MIT License
Bot releases are hidden (Show)
Published by zhudotexe about 1 year ago
Kani.chat_round
to use Kani.full_round
when AI functions are definedPublished by zhudotexe about 1 year ago
chat_in_terminal
work in Google Colab, rather than having to use await chat_in_terminal_async
Published by zhudotexe about 1 year ago
Published by zhudotexe about 1 year ago
Kani.add_to_history
, a method that is called whenever kani adds a new message to the chat contexthttpclient.BaseClient.request
now returns a Response
to aid low-level implementation
.get()
and .post()
are unchangedPublished by zhudotexe about 1 year ago
Engine.function_token_reserve()
to dynamically reserve a number of tokens for a function listOPENAI_API_KEY
environment variable by default if no api key or client is specifiedPublished by zhudotexe about 1 year ago
These should hopefully be the last set of breaking changes until v1.0. We're finalizing some of the attribute names for clarity and publication.
Kani.always_include_messages
to Kani.always_included_messages
@ai_function
s with synchronous signatures now run in a thread pool in order to prevent blocking the asyncio event loopPublished by zhudotexe about 1 year ago
Kani.get_truncated_chat_history
to Kani.get_prompt
CTransformersEngine
and LlamaCTransformersEngine
(thanks @Maknee!)Kani.get_model_completion
to make a prediction at the current chat state (without modifying the chat history)auto_truncate
param to @ai_function
to opt in to kani trimming long responses from a function (i.e., responses that do not fit in a model's context)ChatMessage.[role]()
classmethods now pass kwargs to the constructorPublished by zhudotexe over 1 year ago
chat_in_terminal_async
for async environments (e.g. Google Colab)Published by zhudotexe over 1 year ago
Initial release!