zhudotexe / kani

kani (カニ) is a highly hackable microframework for chat-based language models with tool use/function calling. (NLP-OSS @ EMNLP 2023)
https://kani.readthedocs.io
MIT License
558 stars 30 forks source link

Message Parts API #22

Closed zhudotexe closed 1 year ago

zhudotexe commented 1 year ago

This PR introduces the MessagePart API, which allows messages to be comprised of a number of MessageParts rather than a singular str. To accomplish this, the following changes were made:

This will lay the foundation for future implementation of multimodal models and engines with engine-specific metadata (e.g. ReAct).

zhudotexe commented 1 year ago

We discussed these comments IRL and will make an update to _auto_truncate_message in a future update that will also allow function calls to return ChatMessages rather than just strings.