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

Refactor OpenAIEngine to use the openai-python package #31

Closed zhudotexe closed 7 months ago

zhudotexe commented 9 months ago

In the current version of Kani we don't use the official OpenAI package, instead calling the API ourselves with an aiohttp client. I chose to do this because in the earlier 0.x versions, the OpenAI package did not yet support async HTTP requests and had a weird module-level structure. Since the release of their 1.x version, these concerns are no longer valid, and we should move to using the official package to decrease code fragility.