advanced-stack / py-llm-core

A pythonic library providing light-weighted interface with LLMs
MIT License
103 stars 8 forks source link

Support history in sanitize_prompt #12

Closed DaveDeCaprio closed 3 months ago

DaveDeCaprio commented 3 months ago

sanitize_prompt has a "history" argument, but was ignoring it. Here, I convert it to a string and include it in the token count. That's not perfect, but provides a better estimate than ignoring it.